mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] x86/mce: Reset MCA_SYND between bank scans
@ 2026-08-30  4:40 OptoCloud
  2026-09-03 20:28 ` Yazen Ghannam
  0 siblings, 1 reply; 2+ messages in thread
From: OptoCloud @ 2026-08-30  4:40 UTC (permalink / raw)
  To: Tony Luck, Borislav Petkov
  Cc: Thomas Gleixner, Ingo Molnar, Dave Hansen, H. Peter Anvin,
	Yazen Ghannam, x86, linux-edac, linux-kernel

machine_check_poll() and __mc_scan_banks() both reuse a single
struct mce_hw_err while iterating over the MCA banks. The record is
zeroed once before the loop; each iteration then resets only MISC
and ADDR.

On SMCA, mce_read_aux() writes SYND only when MCI_STATUS_SYNDV is
set. Nothing clears it again, so a bank that does not set SYNDV
inherits the SYND value read for the previous bank in the same
scan, and that stale value is printed and handed to the decoders as
if it belonged to the current error.

Reset SYND at the start of each iteration in both loops, alongside
the existing MISC and ADDR resets.

Found by code inspection; not reproduced on hardware.

Fixes: db819d60f672 ("x86/mce: Add support for new MCA_SYND register")
Cc: stable@vger.kernel.org
Signed-off-by: Eirik Bøe <git@optocloud.no>
---
 arch/x86/kernel/cpu/mce/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index ab469605fc89..16183fa4ddc7 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -808,6 +808,7 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
 
 		m->misc = 0;
 		m->addr = 0;
+		m->synd = 0;
 		m->bank = i;
 
 		barrier();
@@ -1347,6 +1348,7 @@ __mc_scan_banks(struct mce_hw_err *err, struct pt_regs *regs,
 
 		m->misc = 0;
 		m->addr = 0;
+		m->synd = 0;
 		m->bank = i;
 
 		m->status = mce_rdmsrq(mca_msr_reg(i, MCA_STATUS));
-- 
2.47.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-03 20:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-30  4:40 [PATCH 1/3] x86/mce: Reset MCA_SYND between bank scans OptoCloud
2026-09-03 20:28 ` Yazen Ghannam

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®