From: Shashank Balaji <shashank.mahadasyam@sony.com>
To: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org,
Jan Kiszka <jan.kiszka@siemens.com>,
Sohil Mehta <sohil.mehta@intel.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Shashank Balaji <shashank.mahadasyam@sony.com>,
Rahul Bukte <rahul.bukte@sony.com>,
Daniel Palmer <daniel.palmer@sony.com>,
Tim Bird <tim.bird@sony.com>,
stable@vger.kernel.org
Subject: [PATCH v2 0/2] x86/x2apic: Fix hangup of defconfig kernel on resume from s2ram
Date: Fri, 06 Mar 2026 14:46:27 +0900 [thread overview]
Message-ID: <20260306-x2apic-fix-v2-0-bee99c12efa3@sony.com> (raw)
Changes in v2:
- Patch 1's commit references the ACPI spec (Sohil Mehta)
- Patch 2's commit references the Intel SDM (Jan's and Andrew's discussion)
- Patch 3 to rename x2apic_available() to x2apic_without_ir_available() dropped
due to a lack of direction
- Link to v1: https://lore.kernel.org/r/20260202-x2apic-fix-v1-0-71c8f488a88b@sony.com
On resume from s2ram, a defconfig kernel gets into a state where the x2apic
hardware state and the kernel's perceived state are different.
On boot, x2apic is enabled by the firmware, and then the kernel disables it
(relevant lines from dmesg):
[ 0.000381] x2apic: enabled by BIOS, switching to x2apic ops
[ 0.009939] APIC: Switched APIC routing to: cluster x2apic
[ 0.095151] x2apic: IRQ remapping doesn't support X2APIC mode
[ 0.095154] x2apic disabled
[ 0.095551] APIC: Switched APIC routing to: physical flat
defconfig has CONFIG_IRQ_REMAP=n, which leads to x2apic being disabled,
because on bare metal, x2apic has an architectural dependence on interrupt
remapping.
While resuming from s2ram, x2apic is enabled again by the firmware, but
the kernel continues using the physical flat apic routing. This causes a
hangup.
Patch 1 fixes this in lapic_resume() by disabling x2apic when the kernel expects
it to be disabled.
Patch 2 enables CONFIG_IRQ_REMAP in defconfig so that defconfig kernels at
least don't disable x2apic because of a lack of IRQ_REMAP support.
Signed-off-by: Rahul Bukte <rahul.bukte@sony.com>
Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
---
---
Shashank Balaji (2):
x86/x2apic: Disable x2apic on resume if the kernel expects so
x86/defconfig: Add CONFIG_IRQ_REMAP
arch/x86/configs/x86_64_defconfig | 1 +
arch/x86/kernel/apic/apic.c | 10 ++++++++++
2 files changed, 11 insertions(+)
---
base-commit: e5dd3611420978eac7031c627604a64b01ec56eb
change-id: 20260201-x2apic-fix-85c8c1b5cb90
Best regards,
--
Shashank Balaji <shashank.mahadasyam@sony.com>
next reply other threads:[~2026-03-06 5:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-06 5:46 Shashank Balaji [this message]
2026-03-06 5:46 ` [PATCH v2 1/2] x86/x2apic: Disable x2apic on resume if the kernel expects so Shashank Balaji
2026-03-08 9:21 ` Thomas Gleixner
2026-03-09 0:59 ` Sohil Mehta
2026-03-10 11:30 ` [tip: x86/urgent] x86/apic: " tip-bot2 for Shashank Balaji
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260306-x2apic-fix-v2-0-bee99c12efa3@sony.com \
--to=shashank.mahadasyam@sony.com \
--cc=andrew.cooper3@citrix.com \
--cc=bp@alien8.de \
--cc=daniel.palmer@sony.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jan.kiszka@siemens.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=rahul.bukte@sony.com \
--cc=sohil.mehta@intel.com \
--cc=stable@vger.kernel.org \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@kernel.org \
--cc=tim.bird@sony.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox