diff options
Diffstat (limited to 'arch/x86/include/asm/hypervisor.h')
| -rw-r--r-- | arch/x86/include/asm/hypervisor.h | 27 | 
1 files changed, 14 insertions, 13 deletions
diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hypervisor.h index b518c750993..2d4b5e6107c 100644 --- a/arch/x86/include/asm/hypervisor.h +++ b/arch/x86/include/asm/hypervisor.h @@ -20,12 +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); -  /*   * x86 hypervisor information   */ @@ -41,6 +40,9 @@ struct hypervisor_x86 {  	/* Platform setup (run once per boot) */  	void		(*init_platform)(void); + +	/* X2APIC detection (run once per boot) */ +	bool		(*x2apic_available)(void);  };  extern const struct hypervisor_x86 *x86_hyper; @@ -51,13 +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; -static inline bool hypervisor_x2apic_available(void) -{ -	if (kvm_para_available()) -		return true; -	if (xen_x2apic_para_available()) -		return true; -	return false; -} - -#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 */  |