Re: [PATCH] x86/apic: Mark lapic_cal_handler() __noipa to avoid GCC 16 section mismatch

From: Arnd Bergmann

Date: Fri Jul 24 2026 - 11:45:53 EST


On Fri, Jul 24, 2026, at 17:05, Jan Brzezanski wrote:
> During APIC timer calibration lapic_cal_handler() is temporarily installed
> as global_clock_event->event_handler and called from the timer interrupt
> path. GCC 16's more aggressive interprocedural analysis specializes that
> indirect call into a direct reference from the non-__init interrupt handler
> to the __init lapic_cal_handler(), which modpost rejects:
>
> WARNING: modpost: vmlinux: section mismatch in reference:
> __sysvec_apic_timer_interrupt+0x59 (section: .text) ->
> lapic_cal_handler (section: .init.text)
> ERROR: modpost: Section mismatches detected.
>
> The reference only exists during the __init calibration window, so it is
> harmless at runtime, but the direct .text -> .init.text reference GCC 16
> synthesises is not allowed. Mark lapic_cal_handler() __noipa so the
> compiler keeps it as its own init-section function instead of cloning it
> into the interrupt path, while preserving the correct __init annotation.
>
> This is the same approach used for the equivalent GCC 16 section mismatches
> in commit 4c9ad387aa2d ("iommu, debugobjects: avoid gcc-16.1 section
> mismatch warnings").
>
> Signed-off-by: Jan Brzezanski <jan.brzezanski@xxxxxxxxx>

Looks good to me, lets hope we don't get a lot more of
these.

Acked-by: Arnd Bergmann <arnd@xxxxxxxx>