From: Aaron Tomlin <atomlin@atomlin.com>
To: tony.luck@intel.com, bp@alien8.de, tglx@kernel.org,
mingo@redhat.com, dave.hansen@linux.intel.com
Cc: x86@kernel.org, hpa@zytor.com, frederic@kernel.org,
marco.crivellari@suse.com, neelx@suse.com, sean@ashe.io,
chjohnst@gmail.com, mproche@gmail.com, nick.lange@gmail.com,
linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v6 3/4] x86/mce/intel: Clear mce_poll_banks for firmware-first banks on hotplugged CPUs
Date: Fri, 11 Sep 2026 16:12:05 -0400 [thread overview]
Message-ID: <20260911201206.532113-4-atomlin@atomlin.com> (raw)
In-Reply-To: <20260911201206.532113-1-atomlin@atomlin.com>
During early boot, acpi_hest_init() parses APEI HEST CMC structures and
calls mce_disable_bank() for banks designated as Firmware First.
mce_disable_bank() broadcasts via on_each_cpu() to clear the bank from
the per-CPU mce_poll_banks bitmap on all currently online CPUs.
However, CPUs that are brought online late or physically hotplugged
after boot miss this broadcast. Because per-CPU mce_poll_banks is
statically initialised to ~0UL, hotplugged CPUs retain the set bit for
the Firmware First bank.
When such a CPU comes online, cmci_discover() invokes cmci_skip_bank(),
which checks mce_banks_ce_disabled and skips CMCI setup for the bank.
However, cmci_skip_bank() returns early without clearing the bank's bit
from mce_poll_banks.
Consequently, machine_check_poll() on hotplugged CPUs periodically polls
the Firmware First bank, reading and clearing IA32_MCi_STATUS. This
steals hardware error telemetry from the firmware, breaking Firmware
First error handling. In addition, leaving the bit set defeats software
optimisations that check whether mce_poll_banks is empty.
Fix this by clearing the bank's bit from mce_poll_banks in
cmci_skip_bank() when the bank is configured for Firmware First mode.
Fixes: c3d1fb567a63 ("mce: acpi/apei: Honour Firmware First for MCA banks listed in APEI HEST CMC")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Aaron Tomlin <atomlin@atomlin.com>
---
arch/x86/kernel/cpu/mce/intel.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/cpu/mce/intel.c b/arch/x86/kernel/cpu/mce/intel.c
index 4655223ba560..7be5713aa190 100644
--- a/arch/x86/kernel/cpu/mce/intel.c
+++ b/arch/x86/kernel/cpu/mce/intel.c
@@ -181,15 +181,17 @@ static bool cmci_skip_bank(int bank, u64 *val)
return true;
/* Skip banks in firmware first mode */
- if (test_bit(bank, mce_banks_ce_disabled))
+ if (test_bit(bank, mce_banks_ce_disabled)) {
+ clear_bit(bank, this_cpu_ptr(mce_poll_banks));
return true;
+ }
rdmsrq(MSR_IA32_MCx_CTL2(bank), *val);
/* Already owned by someone else? */
if (*val & MCI_CTL2_CMCI_EN) {
clear_bit(bank, owned);
- __clear_bit(bank, this_cpu_ptr(mce_poll_banks));
+ clear_bit(bank, this_cpu_ptr(mce_poll_banks));
return true;
}
--
2.55.0
next prev parent reply other threads:[~2026-09-11 20:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-11 20:12 [PATCH v6 0/4] x86/mce: Fix timer and storm tracking races, and avoid redundant polling Aaron Tomlin
2026-09-11 20:12 ` [PATCH v6 1/4] x86/mce: Do not reinitialise mce_timer structure on CPU restart Aaron Tomlin
2026-09-11 20:12 ` [PATCH v6 2/4] x86/mce/threshold: Fix concurrency races in storm tracking Aaron Tomlin
2026-09-12 2:21 ` Aaron Tomlin
2026-09-11 20:12 ` Aaron Tomlin [this message]
2026-09-11 20:12 ` [PATCH v6 4/4] x86/mce: Avoid arming periodic polling timer when not required Aaron Tomlin
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=20260911201206.532113-4-atomlin@atomlin.com \
--to=atomlin@atomlin.com \
--cc=bp@alien8.de \
--cc=chjohnst@gmail.com \
--cc=dave.hansen@linux.intel.com \
--cc=frederic@kernel.org \
--cc=hpa@zytor.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marco.crivellari@suse.com \
--cc=mingo@redhat.com \
--cc=mproche@gmail.com \
--cc=neelx@suse.com \
--cc=nick.lange@gmail.com \
--cc=sean@ashe.io \
--cc=tglx@kernel.org \
--cc=tony.luck@intel.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
all inboxes | Powered by JetHome®