Re: [PATCH v2 1/2] x86/x2apic: Disable x2apic on resume if the kernel expects so

From: Sohil Mehta

Date: Sun Mar 08 2026 - 21:00:14 EST


On 3/5/2026 9:46 PM, Shashank Balaji wrote:

> So at least as per the spec, re-enablement of x2apic by the firmware is allowed
> if "x2apic on" is a part of the initial boot configuration.
>

The code changes look fine to me. I am still a bit uncertain about the
"x2apic on" BIOS option. I hope the firmware provides more description
to the user about what it does.

Anyway,

Reviewed-by: Sohil Mehta <sohil.mehta@xxxxxxxxx>


> @@ -2456,6 +2457,15 @@ static void lapic_resume(void *data)
> if (x2apic_mode) {
> __x2apic_enable();
> } else {
> + /*
> + * x2apic may have been re-enabled by the firmware on resuming
> + * from s2ram
> + */

This comment is mostly unnecessary because the pr_warn conveys the same
message.

> + if (x2apic_enabled()) {
> + pr_warn_once("x2apic: re-enabled by firmware during resume. Disabling\n");
> + __x2apic_disable();
> + }
> +