This source file includes following definitions.
- hypervisor_is_type
- init_hypervisor_platform
- hypervisor_is_type
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #ifndef _ASM_X86_HYPERVISOR_H
21 #define _ASM_X86_HYPERVISOR_H
22
23
24 enum x86_hypervisor_type {
25 X86_HYPER_NATIVE = 0,
26 X86_HYPER_VMWARE,
27 X86_HYPER_MS_HYPERV,
28 X86_HYPER_XEN_PV,
29 X86_HYPER_XEN_HVM,
30 X86_HYPER_KVM,
31 X86_HYPER_JAILHOUSE,
32 X86_HYPER_ACRN,
33 };
34
35 #ifdef CONFIG_HYPERVISOR_GUEST
36
37 #include <asm/kvm_para.h>
38 #include <asm/x86_init.h>
39 #include <asm/xen/hypervisor.h>
40
41 struct hypervisor_x86 {
42
43 const char *name;
44
45
46 uint32_t (*detect)(void);
47
48
49 enum x86_hypervisor_type type;
50
51
52 struct x86_hyper_init init;
53
54
55 struct x86_hyper_runtime runtime;
56
57
58 bool ignore_nopv;
59 };
60
61 extern const struct hypervisor_x86 x86_hyper_vmware;
62 extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
63 extern const struct hypervisor_x86 x86_hyper_xen_pv;
64 extern const struct hypervisor_x86 x86_hyper_kvm;
65 extern const struct hypervisor_x86 x86_hyper_jailhouse;
66 extern const struct hypervisor_x86 x86_hyper_acrn;
67 extern struct hypervisor_x86 x86_hyper_xen_hvm;
68
69 extern bool nopv;
70 extern enum x86_hypervisor_type x86_hyper_type;
71 extern void init_hypervisor_platform(void);
72 static inline bool hypervisor_is_type(enum x86_hypervisor_type type)
73 {
74 return x86_hyper_type == type;
75 }
76 #else
77 static inline void init_hypervisor_platform(void) { }
78 static inline bool hypervisor_is_type(enum x86_hypervisor_type type)
79 {
80 return type == X86_HYPER_NATIVE;
81 }
82 #endif
83 #endif