Re: [PATCH] x86/apic: Switch to x2apic driver early if x2apic is enabled

From: Grzegorz Jaszczyk

Date: Fri Sep 11 2026 - 11:26:20 EST


On Fri, Sep 11, 2026 at 2:51 PM Thomas Gleixner <tglx@xxxxxxxxxx> wrote:
>
> On Thu, Sep 10 2026 at 09:04, Grzegorz Jaszczyk wrote:
> > To prevent this, check if x2apic is enabled in hardware during early APIC
> > call setup in apic_setup_apic_calls() and switch the default APIC driver
> > from apic_physflat to apic_x2apic_phys immediately. This ensures that any
> > early EOI writes use safe MSR-based accesses. The driver can still be
> > upgraded later during the normal APIC probe phase.
>
> That's really the wrong place. Initializing those calls has absolutely
> nothing to do with the driver probing.
>
> There is quite some historical ballast in this whole APIC driver
> probing, which I never came around to clean up.
>
> I'll have a look how this can be done sanely without replicating half of
> the existing code just to paper over the real issue.
>

Ok, understood. Thank you. Let me know when you have something to look
at or test.

Thanks,
Grzegorz