Re: [tip:x86/urgent] x86: Detect use of extended APIC ID for AMD CPUs

Andreas Herrmann
2009-06-08T12:19:16Z

On Sun, Jun 07, 2009 at 11:46:51AM -0700, Yinghai Lu wrote:
> tip-bot for Andreas Herrmann wrote:
> > diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
> > index 42f2f83..9b2c049 100644
> > --- a/arch/x86/include/asm/apic.h
> > +++ b/arch/x86/include/asm/apic.h
> > @@ -410,7 +410,7 @@ static inline unsigned default_get_apic_id(unsigned long x)
> > {
> > unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));
> >
> > - if (APIC_XAPIC(ver))
> > + if (APIC_XAPIC(ver) || boot_cpu_has(X86_FEATURE_EXTD_APICID))
> > return (x >> 24) & 0xFF;
> > else
> > return (x >> 24) & 0x0F;
>
> looks like we should fix APIC_XAPIC() or have one global apic_ver.

I thought to set the new flag for Intel as well and to replace
APIC_XAPIC with checks for that flag. But for some reason this was
ugly as lapic access must be configured before you can check the
APIC_VERSION and so I decided to keep Intel code as is and not to
potentially introduce regresions.

Regards,
Andreas