From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH] x86: fix boot time APIC mode detection Date: Thu, 23 May 2013 09:49:00 +0100 Message-ID: References: <519DDC5E02000078000D859F@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <519DDC5E02000078000D859F@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , xen-devel Cc: Andrew Cooper List-Id: xen-devel@lists.xenproject.org On 23/05/2013 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 Acked-by: Keir Fraser > --- 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(¤t_cpu_data, X86_FEATURE_X2APIC) > + if ( boot_cpu_has(X86_FEATURE_X2APIC) > && (msr_contents & MSR_IA32_APICBASE_EXTD) ) > return APIC_MODE_X2APIC; > > > >