summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/hypervisor.h
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2013-03-04 21:20:21 +0100
committerH. Peter Anvin <hpa@linux.intel.com>2013-03-04 13:14:25 -0800
commit6276a074c6519946c527f03e2ab69770a62652d9 (patch)
tree29527fb4e5a6c4f3089d82643616465d85697530 /arch/x86/include/asm/hypervisor.h
parent2c59cad6941cb55990fa6e19d84ae027c46991ee (diff)
downloadlinux-0-day-6276a074c6519946c527f03e2ab69770a62652d9.tar.gz
linux-0-day-6276a074c6519946c527f03e2ab69770a62652d9.tar.xz
x86: Make Linux guest support optional
Put all config options needed to run Linux as a guest behind a CONFIG_HYPERVISOR_GUEST menu so that they don't get built-in by default but be selectable by the user. Also, make all units which depend on x86_hyper, depend on this new symbol so that compilation doesn't fail when CONFIG_HYPERVISOR_GUEST is disabled but those units assume its presence. Sort options in the new HYPERVISOR_GUEST menu, adapt config text and drop redundant select. Signed-off-by: Borislav Petkov <bp@suse.de> Link: http://lkml.kernel.org/r/1362428421-9244-3-git-send-email-bp@alien8.de Cc: Dmitry Torokhov <dtor@vmware.com> Cc: K. Y. Srinivasan <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/include/asm/hypervisor.h')
-rw-r--r--arch/x86/include/asm/hypervisor.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hypervisor.h
index 86095ed141356..2d4b5e6107cd7 100644
--- a/arch/x86/include/asm/hypervisor.h
+++ b/arch/x86/include/asm/hypervisor.h
@@ -20,13 +20,11 @@
#ifndef _ASM_X86_HYPERVISOR_H
#define _ASM_X86_HYPERVISOR_H
+#ifdef CONFIG_HYPERVISOR_GUEST
+
#include <asm/kvm_para.h>
#include <asm/xen/hypervisor.h>
-extern void init_hypervisor(struct cpuinfo_x86 *c);
-extern void init_hypervisor_platform(void);
-extern bool hypervisor_x2apic_available(void);
-
/*
* x86 hypervisor information
*/
@@ -55,4 +53,12 @@ extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
extern const struct hypervisor_x86 x86_hyper_xen_hvm;
extern const struct hypervisor_x86 x86_hyper_kvm;
-#endif
+extern void init_hypervisor(struct cpuinfo_x86 *c);
+extern void init_hypervisor_platform(void);
+extern bool hypervisor_x2apic_available(void);
+#else
+static inline void init_hypervisor(struct cpuinfo_x86 *c) { }
+static inline void init_hypervisor_platform(void) { }
+static inline bool hypervisor_x2apic_available(void) { return false; }
+#endif /* CONFIG_HYPERVISOR_GUEST */
+#endif /* _ASM_X86_HYPERVISOR_H */