]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
x86: fix boot time APIC mode detection
authorJan Beulich <jbeulich@suse.com>
Thu, 23 May 2013 11:08:32 +0000 (13:08 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 23 May 2013 11:08:32 +0000 (13:08 +0200)
current_cpu_data becomes valid only relatively late in the boot
process, so looking there for a particular feature early in the game
would generally give the appearance of the feature being unavailable.

Getting this wrong means that at kexec time the system would get
returned to xAPIC mode, causing disconnect_bsp_APIC() to try to access
the APIC page, which on systems with x2APIC pre-enabled will never get
set up.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/apic.c

index b28f5ed431b9c90f4e9514b84905beb4e100829f..a52a0e881d5b65681adcd565adab812bb59085c5 100644 (file)
@@ -1474,7 +1474,7 @@ enum apic_mode current_local_apic_mode(void)
 
     /* Reading EXTD bit from the MSR is only valid if CPUID
      * says so, else reserved */
-    if ( cpu_has(&current_cpu_data, X86_FEATURE_X2APIC)
+    if ( boot_cpu_has(X86_FEATURE_X2APIC)
          && (msr_contents & MSR_IA32_APICBASE_EXTD) )
         return APIC_MODE_X2APIC;