All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: fix boot time APIC mode detection
@ 2013-05-23  7:07 Jan Beulich
  2013-05-23  8:49 ` Keir Fraser
  2013-05-23  8:50 ` Andrew Cooper
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2013-05-23  7:07 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Keir Fraser

[-- Attachment #1: Type: text/plain, Size: 899 bytes --]

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>

--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1474,7 +1474,7 @@ enum apic_mode current_local_apic_mode(v
 
     /* 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;
 




[-- Attachment #2: x86-boot-APIC-mode.patch --]
[-- Type: text/plain, Size: 935 bytes --]

x86: fix boot time APIC mode detection

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>

--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1474,7 +1474,7 @@ enum apic_mode current_local_apic_mode(v
 
     /* 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;
 

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: fix boot time APIC mode detection
  2013-05-23  7:07 [PATCH] x86: fix boot time APIC mode detection Jan Beulich
@ 2013-05-23  8:49 ` Keir Fraser
  2013-05-23  8:50 ` Andrew Cooper
  1 sibling, 0 replies; 3+ messages in thread
From: Keir Fraser @ 2013-05-23  8:49 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Andrew Cooper

On 23/05/2013 08:07, "Jan Beulich" <JBeulich@suse.com> wrote:

> 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>

> --- a/xen/arch/x86/apic.c
> +++ b/xen/arch/x86/apic.c
> @@ -1474,7 +1474,7 @@ enum apic_mode current_local_apic_mode(v
>  
>      /* 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;
>  
> 
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: fix boot time APIC mode detection
  2013-05-23  7:07 [PATCH] x86: fix boot time APIC mode detection Jan Beulich
  2013-05-23  8:49 ` Keir Fraser
@ 2013-05-23  8:50 ` Andrew Cooper
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2013-05-23  8:50 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Keir (Xen.org), xen-devel

On 23/05/13 08:07, Jan Beulich wrote:
> 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>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
> --- a/xen/arch/x86/apic.c
> +++ b/xen/arch/x86/apic.c
> @@ -1474,7 +1474,7 @@ enum apic_mode current_local_apic_mode(v
>  
>      /* 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;
>  
>
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-23  8:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-23  7:07 [PATCH] x86: fix boot time APIC mode detection Jan Beulich
2013-05-23  8:49 ` Keir Fraser
2013-05-23  8:50 ` Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.