Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/hyper-v: include hyperv/ only when CONFIG_HYPERV is set

Code is arch/x86/hyperv/ is only needed when CONFIG_HYPERV is set, the
'basic' support and detection lives in arch/x86/kernel/cpu/mshyperv.c
which is included when CONFIG_HYPERVISOR_GUEST is set.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Vitaly Kuznetsov and committed by
Greg Kroah-Hartman
2e252fbf 15e1674d

+7 -2
+1 -1
arch/x86/Kbuild
··· 8 8 obj-$(CONFIG_XEN) += xen/ 9 9 10 10 # Hyper-V paravirtualization support 11 - obj-$(CONFIG_HYPERVISOR_GUEST) += hyperv/ 11 + obj-$(subst m,y,$(CONFIG_HYPERV)) += hyperv/ 12 12 13 13 # lguest paravirtualization support 14 14 obj-$(CONFIG_LGUEST_GUEST) += lguest/
+6 -1
arch/x86/include/asm/mshyperv.h
··· 173 173 void hyperv_report_panic(struct pt_regs *regs); 174 174 bool hv_is_hypercall_page_setup(void); 175 175 void hyperv_cleanup(void); 176 - #endif 176 + #else /* CONFIG_HYPERV */ 177 + static inline void hyperv_init(void) {} 178 + static inline bool hv_is_hypercall_page_setup(void) { return false; } 179 + static inline hyperv_cleanup(void) {} 180 + #endif /* CONFIG_HYPERV */ 181 + 177 182 #ifdef CONFIG_HYPERV_TSCPAGE 178 183 struct ms_hyperv_tsc_page *hv_get_tsc_page(void); 179 184 static inline u64 hv_read_tsc_page(const struct ms_hyperv_tsc_page *tsc_pg)