[PATCH 1/3] x86/mce: Reset MCA_SYND between bank scans

From: OptoCloud

Date: Sun Aug 30 2026 - 00:40:20 EST


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@xxxxxxxxxxxxxxx
Signed-off-by: Eirik Bøe <git@xxxxxxxxxxxx>
---
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