Linux EDAC development
 help / color / mirror / Atom feed
* [PATCH] EDAC/amd64: Fix incorrect Node ID mapping on CPU-only Zen4+ systems
@ 2026-06-08  7:26 Phineas Su
  2026-06-09 16:07 ` Yazen Ghannam
  0 siblings, 1 reply; 7+ messages in thread
From: Phineas Su @ 2026-06-08  7:26 UTC (permalink / raw)
  To: yazen.ghannam, bp, tony.luck
  Cc: muralidhara.mk, linux-edac, linux-kernel, Phineas Su

On CPU-only systems using AMD Zen4 (Genoa) and newer processors, memory
ECC errors can be reported with an incorrect Node ID (incremented by 1).
This happens because these CPUs use SMCA_UMC_V2 banks, which triggers
the GPU node ID fixup logic in fixup_node_id().

Since it is a CPU-only system, gpu_node_map is not initialized and
gpu_node_map.base_node_id is 0. The check (nid < gpu_node_map.base_node_id)
evaluates to (nid < 0), which is always false for the unsigned u8 nid.
The function then incorrectly applies the fixup (nid - 0 + 1), resulting
in the Node ID being incremented.

Fix this by ensuring that gpu_node_map has been initialized (i.e.,
node_count is non-zero) before applying any GPU-specific fixups.

Fixes: 4251566ebc1c ("EDAC/amd64: Cache and use GPU node map")
Signed-off-by: Phineas Su <pohaosu@google.com>
---
 drivers/edac/amd64_edac.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index c6aa69dbd9fb..1e688123a50c 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -1047,6 +1047,10 @@ static int fixup_node_id(int node_id, struct mce *m)
 	if (smca_get_bank_type(m->extcpu, m->bank) != SMCA_UMC_V2)
 		return node_id;
 
+	/* If no GPU nodes are present, no fixup is needed. */
+	if (!gpu_node_map.node_count)
+		return node_id;
+
 	/* Nodes below the GPU base node are CPU nodes and don't need a fixup. */
 	if (nid < gpu_node_map.base_node_id)
 		return node_id;
-- 
2.54.0.1032.g2f8565e1d1-goog


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

end of thread, other threads:[~2026-06-23 15:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-08  7:26 [PATCH] EDAC/amd64: Fix incorrect Node ID mapping on CPU-only Zen4+ systems Phineas Su
2026-06-09 16:07 ` Yazen Ghannam
2026-06-14 14:15   ` Phineas Su
2026-06-14 15:06     ` [PATCH v2] EDAC/amd64: Only translate Node ID if GPU nodes are present Phineas Su
2026-06-22 17:07       ` Yazen Ghannam
2026-06-23  0:49         ` Borislav Petkov
2026-06-23 15:49           ` Yazen Ghannam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox