Subject: [PATCH v7 00/12] x86/edac/amd64: Add support for GPU nodes

From: Muralidhara M K <[email protected]>

On heterogeneous systems made up of AMD CPUs and GPUs, where the
data fabrics of CPUs and GPUs are connected directly via custom links.
UMC MCA banks on GPUs can be viewed similar to the UMCs banks on the CPUs.
Hence, memory errors on GPU UMCs can be reported via edac framework.

This patchset applies on top of the following series
[v4,00/24] AMD MCA Address Translation Updates
https://patchwork.kernel.org/project/linux-edac/cover/[email protected]/

Each patch was build tested individually. The entire set was
tested for address translation and error counts on GPU
memory.

This patchset does the following
1. edac.rst:
a. Add Documentation support for heterogeneous systems

2. amd_nb.c:
a. Add support for northbridges on Aldebaran GPU nodes
b. export AMD node map details to be used by edac and mce modules

3. mce_amd module:
a. Identify the node ID where the error is and map the node id
to linux enumerated node id.

4. Modifies the amd64_edac module
a. Refactor the code, define new family op routines and use
struct amd64_pvt. Making struct fam_type obsolete.
b. Enumerate UMCs and HBMs on the GPU nodes

5. DF3.5 Address translation support
a. Support Data Fabric 3.5 Address translation
b. Fixed UMC to CS mapping for errors


Muralidhara M K (6):
EDAC/amd64: edac.rst: Add Doc support for heterogeneous systems
x86/amd_nb: Add support for northbridges on Aldebaran
EDAC/amd64: Move struct fam_type variables into amd64_pvt structure
EDAC/amd64: Define dynamic family ops routines
EDAC/amd64: Add AMD heterogeneous family 19h Model 30h-3fh
EDAC/amd64: Add address translation support for DF3.5

Naveen Krishna Chatradhi (3):
EDAC/mce_amd: Extract node id from MCA_IPID
EDAC/amd64: Enumerate Aldebaran GPU nodes by adding family ops
EDAC/amd64: Add Family ops to update GPU csrow and channel info

Yazen Ghannam (3):
EDAC/amd64: Add check for when to add DRAM base and hole
EDAC/amd64: Save the number of block instances
EDAC/amd64: Add fixed UMC to CS mapping

Documentation/driver-api/edac.rst | 9 +
arch/x86/include/asm/amd_nb.h | 9 +
arch/x86/kernel/amd_nb.c | 149 ++-
drivers/edac/amd64_edac.c | 1450 ++++++++++++++++++++---------
drivers/edac/amd64_edac.h | 203 +++-
drivers/edac/mce_amd.c | 23 +-
include/linux/pci_ids.h | 1 +
7 files changed, 1345 insertions(+), 499 deletions(-)

--
2.25.1



Subject: [PATCH v7 12/12] EDAC/amd64: Add fixed UMC to CS mapping

From: Yazen Ghannam <[email protected]>

GPU memory address mapping entries in Aldebaran will enable on which
channel the error occurred.

Aldebaran has 2 dies and are enumerated alternatively
* die0's are enumerated as node 2, 4, 6 and 8
* die1's are enumerated as node 1, 3, 5 and 7

Signed-off-by: Yazen Ghannam <[email protected]>
Signed-off-by: Naveen Krishna Chatradhi <[email protected]>
---
Link:
v3->v7:
* Split and fixed UMC to CS mapping from patch 33 in v3.
https://patchwork.kernel.org/project/linux-edac/patch/[email protected]/

drivers/edac/amd64_edac.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)

diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 6e0d617fd95f..e0f9f3a4fff8 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -1540,6 +1540,36 @@ static u16 get_dst_fabric_id_df35(struct addr_ctx *ctx)
return ctx->reg_limit_addr & 0xFFF;
}

+/* UMC to CS mapping for Aldebaran die[0]s */
+u8 umc_to_cs_mapping_aldebaran_die0[] = { 28, 20, 24, 16, 12, 4, 8, 0,
+ 6, 30, 2, 26, 22, 14, 18, 10,
+ 19, 11, 15, 7, 3, 27, 31, 23,
+ 9, 1, 5, 29, 25, 17, 21, 13};
+
+/* UMC to CS mapping for Aldebaran die[1]s */
+u8 umc_to_cs_mapping_aldebaran_die1[] = { 19, 11, 15, 7, 3, 27, 31, 23,
+ 9, 1, 5, 29, 25, 17, 21, 13,
+ 28, 20, 24, 16, 12, 4, 8, 0,
+ 6, 30, 2, 26, 22, 14, 18, 10};
+
+int get_umc_to_cs_mapping(struct addr_ctx *ctx)
+{
+ if (ctx->inst_id >= sizeof(umc_to_cs_mapping_aldebaran_die0))
+ return -EINVAL;
+
+ /*
+ * Aldebaran has 2 dies and are enumerated alternatively
+ * die0's are enumerated as node 2, 4, 6 and 8
+ * die1's are enumerated as node 1, 3, 5 and 7
+ */
+ if (ctx->nid % 2)
+ ctx->inst_id = umc_to_cs_mapping_aldebaran_die1[ctx->inst_id];
+ else
+ ctx->inst_id = umc_to_cs_mapping_aldebaran_die0[ctx->inst_id];
+
+ return 0;
+}
+
static int get_cs_fabric_id_df35(struct addr_ctx *ctx)
{
u16 nid = ctx->nid;
--
2.25.1