Re: [PATCH v2 0/4] x86/apic: Switch to x2apic driver early if x2apic is enabled
From: Thomas Gleixner
Date: Sat Oct 17 2026 - 17:04:24 EST
On Thu, Sep 24 2026 at 10:40, Grzegorz Jaszczyk wrote:
> During early boot, the generic x86 kernel defaults to the MMIO-based
> APIC driver (apic_physflat). When booting (e.g., via kexec into a
> crashdump kernel) with x2APIC already enabled in hardware and without
> ACPI MADT probing (e.g., !CONFIG_ACPI), the APIC driver pointer remains
> set to apic_physflat until late_time_init() runs x86_64_probe_apic().
>
> Because check_x2apic() detects hardware x2APIC mode and sets
> x2apic_mode = 1, the APIC MMIO fixmap is not mapped. If a pending
> interrupt fires in the window between local_irq_enable() and
> late_time_init(), native_apic_mem_eoi() attempts to write to the
> unmapped APIC EOI MMIO address, resulting in an early boot page fault
> (#PF).
>
> This series restructures early APIC initialization and installs
> apic_x2apic_phys (or apic_noop if the APIC is disabled or built without
> CONFIG_X86_X2APIC) as the default APIC driver in apic_early_init(),
> ensuring safe MSR-based or no-op APIC accesses while still allowing
> later APIC probing (e.g., upgrading to apic_x2apic_cluster) to proceed
> normally.
Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxx>