aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/hypervisor.c
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2017-11-09 08:27:36 -0500
committerIngo Molnar <mingo@kernel.org>2017-11-10 04:03:12 -0500
commit03b2a320b19f1424e9ac9c21696be9c60b6d0d93 (patch)
tree90a3a16cf837ea9a25cdd991771b1bdcfd8746a1 /arch/x86/kernel/cpu/hypervisor.c
parentf72e38e8ec8869ac0ba5a75d7d2f897d98a1454e (diff)
x86/virt: Add enum for hypervisors to replace x86_hyper
The x86_hyper pointer is only used for checking whether a virtual device is supporting the hypervisor the system is running on. Use an enum for that purpose instead and drop the x86_hyper pointer. Signed-off-by: Juergen Gross <jgross@suse.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Xavier Deguillard <xdeguillard@vmware.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: akataria@vmware.com Cc: arnd@arndb.de Cc: boris.ostrovsky@oracle.com Cc: devel@linuxdriverproject.org Cc: dmitry.torokhov@gmail.com Cc: gregkh@linuxfoundation.org Cc: haiyangz@microsoft.com Cc: kvm@vger.kernel.org Cc: kys@microsoft.com Cc: linux-graphics-maintainer@vmware.com Cc: linux-input@vger.kernel.org Cc: moltmann@vmware.com Cc: pbonzini@redhat.com Cc: pv-drivers@vmware.com Cc: rkrcmar@redhat.com Cc: sthemmin@microsoft.com Cc: virtualization@lists.linux-foundation.org Cc: xen-devel@lists.xenproject.org Link: http://lkml.kernel.org/r/20171109132739.23465-3-jgross@suse.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/cpu/hypervisor.c')
-rw-r--r--arch/x86/kernel/cpu/hypervisor.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c
index 22226c1bf092..bea8d3e24f50 100644
--- a/arch/x86/kernel/cpu/hypervisor.c
+++ b/arch/x86/kernel/cpu/hypervisor.c
@@ -26,6 +26,12 @@
26#include <asm/processor.h> 26#include <asm/processor.h>
27#include <asm/hypervisor.h> 27#include <asm/hypervisor.h>
28 28
29extern const struct hypervisor_x86 x86_hyper_vmware;
30extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
31extern const struct hypervisor_x86 x86_hyper_xen_pv;
32extern const struct hypervisor_x86 x86_hyper_xen_hvm;
33extern const struct hypervisor_x86 x86_hyper_kvm;
34
29static const __initconst struct hypervisor_x86 * const hypervisors[] = 35static const __initconst struct hypervisor_x86 * const hypervisors[] =
30{ 36{
31#ifdef CONFIG_XEN_PV 37#ifdef CONFIG_XEN_PV
@@ -41,8 +47,8 @@ static const __initconst struct hypervisor_x86 * const hypervisors[] =
41#endif 47#endif
42}; 48};
43 49
44const struct hypervisor_x86 *x86_hyper; 50enum x86_hypervisor_type x86_hyper_type;
45EXPORT_SYMBOL(x86_hyper); 51EXPORT_SYMBOL(x86_hyper_type);
46 52
47static inline const struct hypervisor_x86 * __init 53static inline const struct hypervisor_x86 * __init
48detect_hypervisor_vendor(void) 54detect_hypervisor_vendor(void)
@@ -87,6 +93,6 @@ void __init init_hypervisor_platform(void)
87 copy_array(&h->init, &x86_init.hyper, sizeof(h->init)); 93 copy_array(&h->init, &x86_init.hyper, sizeof(h->init));
88 copy_array(&h->runtime, &x86_platform.hyper, sizeof(h->runtime)); 94 copy_array(&h->runtime, &x86_platform.hyper, sizeof(h->runtime));
89 95
90 x86_hyper = h; 96 x86_hyper_type = h->type;
91 x86_init.hyper.init_platform(); 97 x86_init.hyper.init_platform();
92} 98}