diff options
Diffstat (limited to 'arch/x86/include/asm/hypervisor.h')
-rw-r--r-- | arch/x86/include/asm/hypervisor.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hypervisor.h index 0eca7239a7aa..1b0a5abcd8ae 100644 --- a/arch/x86/include/asm/hypervisor.h +++ b/arch/x86/include/asm/hypervisor.h | |||
@@ -29,6 +29,16 @@ | |||
29 | /* | 29 | /* |
30 | * x86 hypervisor information | 30 | * x86 hypervisor information |
31 | */ | 31 | */ |
32 | |||
33 | enum x86_hypervisor_type { | ||
34 | X86_HYPER_NATIVE = 0, | ||
35 | X86_HYPER_VMWARE, | ||
36 | X86_HYPER_MS_HYPERV, | ||
37 | X86_HYPER_XEN_PV, | ||
38 | X86_HYPER_XEN_HVM, | ||
39 | X86_HYPER_KVM, | ||
40 | }; | ||
41 | |||
32 | struct hypervisor_x86 { | 42 | struct hypervisor_x86 { |
33 | /* Hypervisor name */ | 43 | /* Hypervisor name */ |
34 | const char *name; | 44 | const char *name; |
@@ -36,6 +46,9 @@ struct hypervisor_x86 { | |||
36 | /* Detection routine */ | 46 | /* Detection routine */ |
37 | uint32_t (*detect)(void); | 47 | uint32_t (*detect)(void); |
38 | 48 | ||
49 | /* Hypervisor type */ | ||
50 | enum x86_hypervisor_type type; | ||
51 | |||
39 | /* init time callbacks */ | 52 | /* init time callbacks */ |
40 | struct x86_hyper_init init; | 53 | struct x86_hyper_init init; |
41 | 54 | ||
@@ -43,15 +56,7 @@ struct hypervisor_x86 { | |||
43 | struct x86_hyper_runtime runtime; | 56 | struct x86_hyper_runtime runtime; |
44 | }; | 57 | }; |
45 | 58 | ||
46 | extern const struct hypervisor_x86 *x86_hyper; | 59 | extern enum x86_hypervisor_type x86_hyper_type; |
47 | |||
48 | /* Recognized hypervisors */ | ||
49 | extern const struct hypervisor_x86 x86_hyper_vmware; | ||
50 | extern const struct hypervisor_x86 x86_hyper_ms_hyperv; | ||
51 | extern const struct hypervisor_x86 x86_hyper_xen_pv; | ||
52 | extern const struct hypervisor_x86 x86_hyper_xen_hvm; | ||
53 | extern const struct hypervisor_x86 x86_hyper_kvm; | ||
54 | |||
55 | extern void init_hypervisor_platform(void); | 60 | extern void init_hypervisor_platform(void); |
56 | #else | 61 | #else |
57 | static inline void init_hypervisor_platform(void) { } | 62 | static inline void init_hypervisor_platform(void) { } |