Re: [PATCH] x86/apic: Use the physical address for the local APIC resource

From: Chao Gao

Date: Fri Nov 20 2026 - 03:38:12 EST


On Sat, Nov 07, 2026 at 12:08:07AM +0200, Ahmed Abdelfattah wrote:
>Since v6.6 the "Local APIC" entry is missing from /proc/iomem whenever
>the kernel maps the xAPIC itself.

What is the impact on end users if this isn't fixed? Please make it clear
in the changelog, even if it is minor.

No one else has noticed this since v6.6, so it looks to me that nothing
depends on this "Local APIC" entry.

>
>lapic_insert_resource() used to take the address from apic_phys. When
>apic_phys went away it was switched to apic_mmio_base, but that holds
>the fixmap virtual address, not the physical one:
>
> APIC: Mapped APIC to ffffffffff5fc000 ( fee00000)
>
>insert_resource() rejects that range because it lies outside
>iomem_resource, and as the return value is not checked, the failure
>goes unnoticed.
>
>Use mp_lapic_addr, which is the address apic_set_fixmap() maps. Keep
>the apic_mmio_base check, so the resource is still only added when the
>APIC was actually mapped.
>
>Fixes: 78c32000848c ("x86/apic: Get rid of apic_phys")
>Signed-off-by: Ahmed Abdelfattah <me@xxxxxxxxxxxxxxxxxxxx>

Using the virtual address is clearly a mistake, so this fix looks good to
me. But the Fixes tag is wrong, as "apic_phys" already held the same
virtual address before that commit.