Skip to contentSkip to conversation

EDAC/{i10nm,skx,skx_common}: Support UV systems

PATCH Applied Kyle Meyer 3 participants 3 messages Dec 13, 2024

Subsystems (3)
lore
Share & tools
lore

Kyle Meyer

author
#0 lore raw

PATCH v2 1/1 EDAC/{i10nm,skx,skx_common}: Support UV systems

The 3-bit source IDs in PCI configuration space registers, used to map devices to sockets, are limited to 8 unique IDs, and each ID is local to a UPI/QPI domain.

Source IDs cannot be used to map devices to sockets on UV systems because they can exceed 8 sockets and have multiple UPI/QPI domains with identical, repeating source IDs.

Use NUMA information to get package IDs instead of source IDs on UV systems, and use package/source IDs to name IMC information structures.

---

v1 -> v2:
* Instead of checking for duplicate source IDs to determine if a system has multiple UPI/QPI domains, just check if it's a UV system.
* https://lore.kernel.org/all/[email protected]

 drivers/edac/i10nm_base.c | 11 +++------
 drivers/edac/skx_base.c   |  9 +++-----
 drivers/edac/skx_common.c | 47 +++++++++++++++++++++++++++------------
 drivers/edac/skx_common.h |  3 +--
 4 files changed, 40 insertions(+), 30 deletions(-)
drivers/edac/i10nm_base.c +3 -8
index 51556c72a967..16d1110c0692 100644
@@ -1010,7 +1010,7 @@ static struct notifier_block i10nm_mce_dec = {
 
 static int __init i10nm_init(void)
 {
-	u8 mc = 0, src_id = 0, node_id = 0;
+	u8 mc = 0, src_id = 0;
 	const struct x86_cpu_id *id;
 	struct res_config *cfg;
 	const char *owner;
@@ -1070,19 +1070,14 @@ static int __init i10nm_init(void)
 		if (rc < 0)
 			goto fail;
 
-		rc = skx_get_node_id(d, &node_id);
-		if (rc < 0)
-			goto fail;
-
-		edac_dbg(2, "src_id = %d node_id = %d\n", src_id, node_id);
+		edac_dbg(2, "src_id = %d\n", src_id);
 		for (i = 0; i < imc_num; i++) {
 			if (!d->imc[i].mdev)
 				continue;
 
 			d->imc[i].mc  = mc++;
 			d->imc[i].lmc = i;
-			d->imc[i].src_id  = src_id;
-			d->imc[i].node_id = node_id;
+			d->imc[i].src_id = src_id;
 			if (d->imc[i].hbm_mc) {
 				d->imc[i].chan_mmio_sz = cfg->hbm_chan_mmio_sz;
 				d->imc[i].num_channels = cfg->hbm_chan_num;
drivers/edac/skx_base.c +3 -6
index 14cfd394b469..93f7c05faccc 100644
@@ -600,7 +600,7 @@ static int __init skx_init(void)
 	const struct munit *m;
 	const char *owner;
 	int rc = 0, i, off[3] = {0xd0, 0xd4, 0xd8};
-	u8 mc = 0, src_id, node_id;
+	u8 mc = 0, src_id;
 	struct skx_dev *d;
 
 	edac_dbg(2, "\n");
@@ -650,15 +650,12 @@ static int __init skx_init(void)
 		rc = skx_get_src_id(d, 0xf0, &src_id);
 		if (rc < 0)
 			goto fail;
-		rc = skx_get_node_id(d, &node_id);
-		if (rc < 0)
-			goto fail;
-		edac_dbg(2, "src_id=%d node_id=%d\n", src_id, node_id);
+
+		edac_dbg(2, "src_id = %d\n", src_id);
 		for (i = 0; i < SKX_NUM_IMC; i++) {
 			d->imc[i].mc = mc++;
 			d->imc[i].lmc = i;
 			d->imc[i].src_id = src_id;
-			d->imc[i].node_id = node_id;
 			rc = skx_register_mci(&d->imc[i], d->imc[i].chan[0].cdev,
 					      "Skylake Socket", EDAC_MOD_STR,
 					      skx_get_dimm_config, cfg);
drivers/edac/skx_common.c +33 -14

79 lines not on this page · raw message

drivers/edac/skx_common.h +1 -2
index 54bba8a62f72..b0845bdd4516 100644
@@ -103,7 +103,7 @@ struct skx_dev {
 		bool hbm_mc;
 		u8 mc;	/* system wide mc# */
 		u8 lmc;	/* socket relative mc# */
-		u8 src_id, node_id;
+		u8 src_id;
 		struct skx_channel {
 			struct pci_dev	*cdev;
 			struct pci_dev	*edev;
@@ -244,7 +244,6 @@ void skx_set_mem_cfg(bool mem_cfg_2lm);
 void skx_set_res_cfg(struct res_config *cfg);
 
 int skx_get_src_id(struct skx_dev *d, int off, u8 *id);
-int skx_get_node_id(struct skx_dev *d, u8 *id);
 
 int skx_get_all_bus_mappings(struct res_config *cfg, struct list_head **list);
 
Signature · 1 line
2.47.1
Tested-by Reviewed-by on v2 1/1
#1 lore raw
Quoted 13 lines

From: Kyle Meyer <[email protected]>
Sent: Friday, December 13, 2024 9:26 AM
To: Luck, Tony <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; Zhuo, Qiuxu <[email protected]>; [email protected]; linux- [email protected]
Cc: Meyer, Kyle <[email protected]>
Subject: [PATCH v2] EDAC/{i10nm,skx,skx_common}: Support UV systems

The 3-bit source IDs in PCI configuration space registers, used to map devices to sockets, are limited to 8 unique IDs, and each ID is local to a UPI/QPI domain.

Quoted 8 lines

Source IDs cannot be used to map devices to sockets on UV systems because they can exceed 8 sockets and have multiple UPI/QPI domains with identical, repeating source IDs.

Use NUMA information to get package IDs instead of source IDs on UV systems, and use package/source IDs to name IMC information structures.

Thanks for this patch. LGTM.
I tested it on a non-UV system and didn't observe any regressions.

Thanks!
-Qiuxu

maintainer Applied
#2 lore raw
In reply to Kyle Meyer
Quoted 4 lines · Kyle Meyer

The 3-bit source IDs in PCI configuration space registers, used to map devices to sockets, are limited to 8 unique IDs, and each ID is local to a UPI/QPI domain.

Quoted 8 lines

Source IDs cannot be used to map devices to sockets on UV systems because they can exceed 8 sockets and have multiple UPI/QPI domains with identical, repeating source IDs.

Use NUMA information to get package IDs instead of source IDs on UV systems, and use package/source IDs to name IMC information structures.

Applied to RAS tree for v6.14 merge.

Thanks

-Tony