Skip to contentSkip to conversation

Return a proper bool value to hypervisor_x2apic_available

PATCH New Zhenzhong Duan 1 participant 1 message Jul 30, 2013 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Return a proper bool value to hypervisor_x2apic_available

When bootup on a bare metal env, hypervisor_x2apic_available should return ture so that "max_physical_apicid > 255" check in enable_IR_x2apic is useful.

---
 arch/x86/include/asm/hypervisor.h |    2 +-
 arch/x86/kernel/cpu/hypervisor.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/hypervisor.h +1 -1
index 2d4b5e6..d4c09b3 100644
@@ -59,6 +59,6 @@ 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; }
+static inline bool hypervisor_x2apic_available(void) { return true; }
 #endif /* CONFIG_HYPERVISOR_GUEST */
 #endif /* _ASM_X86_HYPERVISOR_H */
arch/x86/kernel/cpu/hypervisor.c +1 -1
index 8727921..ee303cd 100644
@@ -82,7 +82,7 @@ void __init init_hypervisor_platform(void)
 
 bool __init hypervisor_x2apic_available(void)
 {
-	return x86_hyper                   &&
+	return !x86_hyper                  ||
 	       x86_hyper->x2apic_available &&
 	       x86_hyper->x2apic_available();
 }
Signature · 1 line
1.7.3