1 /******************************************************************************
2  * arch/x86/guest/hyperv/private.h
3  *
4  * Definitions / declarations only useful to Hyper-V code.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Copyright (c) 2020 Microsoft.
20  */
21 
22 #ifndef __XEN_HYPERV_PRIVIATE_H__
23 #define __XEN_HYPERV_PRIVIATE_H__
24 
25 #include <xen/cpumask.h>
26 #include <xen/percpu.h>
27 
28 DECLARE_PER_CPU(void *, hv_input_page);
29 DECLARE_PER_CPU(void *, hv_vp_assist);
30 DECLARE_PER_CPU(unsigned int, hv_vp_index);
31 extern unsigned int hv_max_vp_index;
32 
hv_vp_index(unsigned int cpu)33 static inline unsigned int hv_vp_index(unsigned int cpu)
34 {
35     return per_cpu(hv_vp_index, cpu);
36 }
37 
38 int hyperv_flush_tlb(const cpumask_t *mask, const void *va,
39                      unsigned int flags);
40 
41 /* Returns number of banks, -ev if error */
42 int cpumask_to_vpset(struct hv_vpset *vpset, const cpumask_t *mask);
43 
44 #endif /* __XEN_HYPERV_PRIVIATE_H__  */
45