krishnanadh / rpms / rasdaemon

Forked from rpms/rasdaemon a year ago
Clone

Blame SOURCES/cc2ce5c65ed5a42eaa97aa3659854add6d808da5.patch

f5a251
commit cc2ce5c65ed5a42eaa97aa3659854add6d808da5
f5a251
Author: Muralidhara M K <muralidhara.mk@amd.com>
f5a251
Date:   Mon Jan 13 19:12:06 2020 +0530
f5a251
f5a251
    rasdaemon: Add error decoding for new SMCA Load Store bank type
f5a251
    
f5a251
    Future Scalable Machine Check Architecture (SMCA) systems will have a
f5a251
    new Load Store bank type.
f5a251
    
f5a251
    Add the new type's (HWID, McaType) ID and error decoding.
f5a251
    
f5a251
    Signed-off-by: Muralidhara M K <muralidhara.mk@amd.com>
f5a251
    [ Adjust commit message. ]
f5a251
    Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
f5a251
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
f5a251
f5a251
diff --git a/mce-amd-smca.c b/mce-amd-smca.c
f5a251
index 114e786..d0b6cb6 100644
f5a251
--- a/mce-amd-smca.c
f5a251
+++ b/mce-amd-smca.c
f5a251
@@ -38,9 +38,16 @@
f5a251
  * 03: EC[3], 02: EC[2], 01: EC[1], 00: EC[0]
f5a251
  */
f5a251
 
f5a251
+/* MCA_STATUS REGISTER FOR FAMILY 19H
f5a251
+ * The bits 24 ~ 29 contains AddressLsb
f5a251
+ * 29: ADDRLS[5], 28: ADDRLS[4], 27: ADDRLS[3],
f5a251
+ * 26: ADDRLS[2], 25: ADDRLS[1], 24: ADDRLS[0]
f5a251
+ */
f5a251
+
f5a251
 /* These may be used by multiple smca_hwid_mcatypes */
f5a251
 enum smca_bank_types {
f5a251
 	SMCA_LS = 0,    /* Load Store */
f5a251
+	SMCA_LS_V2,	/* Load Store */
f5a251
 	SMCA_IF,        /* Instruction Fetch */
f5a251
 	SMCA_L2_CACHE,  /* L2 Cache */
f5a251
 	SMCA_DE,        /* Decoder Unit */
f5a251
@@ -88,6 +95,32 @@ static const char * const smca_ls_mce_desc[] = {
f5a251
 	"DC tag error type 5",
f5a251
 	"L2 fill data error",
f5a251
 };
f5a251
+static const char * const smca_ls2_mce_desc[] = {
f5a251
+	"An ECC error was detected on a data cache read by a probe or victimization",
f5a251
+	"An ECC error or L2 poison was detected on a data cache read by a load",
f5a251
+	"An ECC error was detected on a data cache read-modify-write by a store",
f5a251
+	"An ECC error or poison bit mismatch was detected on a tag read by a probe or victimization",
f5a251
+	"An ECC error or poison bit mismatch was detected on a tag read by a load",
f5a251
+	"An ECC error or poison bit mismatch was detected on a tag read by a store",
f5a251
+	"An ECC error was detected on an EMEM read by a load",
f5a251
+	"An ECC error was detected on an EMEM read-modify-write by a store",
f5a251
+	"A parity error was detected in an L1 TLB entry by any access",
f5a251
+	"A parity error was detected in an L2 TLB entry by any access",
f5a251
+	"A parity error was detected in a PWC entry by any access",
f5a251
+	"A parity error was detected in an STQ entry by any access",
f5a251
+	"A parity error was detected in an LDQ entry by any access",
f5a251
+	"A parity error was detected in a MAB entry by any access",
f5a251
+	"A parity error was detected in an SCB entry state field by any access",
f5a251
+	"A parity error was detected in an SCB entry address field by any access",
f5a251
+	"A parity error was detected in an SCB entry data field by any access",
f5a251
+	"A parity error was detected in a WCB entry by any access",
f5a251
+	"A poisoned line was detected in an SCB entry by any access",
f5a251
+	"A SystemReadDataError error was reported on read data returned from L2 for a load",
f5a251
+	"A SystemReadDataError error was reported on read data returned from L2 for an SCB store",
f5a251
+	"A SystemReadDataError error was reported on read data returned from L2 for a WCB store",
f5a251
+	"A hardware assertion error was reported",
f5a251
+	"A parity error was detected in an STLF, SCB EMEM entry or SRB store data by any access",
f5a251
+};
f5a251
 /* Instruction Fetch */
f5a251
 static const char * const smca_if_mce_desc[] = {
f5a251
 	"microtag probe port parity error",
f5a251
@@ -289,6 +322,7 @@ struct smca_mce_desc {
f5a251
 
f5a251
 static struct smca_mce_desc smca_mce_descs[] = {
f5a251
 	[SMCA_LS]       = { smca_ls_mce_desc,   ARRAY_SIZE(smca_ls_mce_desc)  },
f5a251
+	[SMCA_LS_V2]	= { smca_ls2_mce_desc,	ARRAY_SIZE(smca_ls2_mce_desc) },
f5a251
 	[SMCA_IF]       = { smca_if_mce_desc,   ARRAY_SIZE(smca_if_mce_desc)  },
f5a251
 	[SMCA_L2_CACHE] = { smca_l2_mce_desc,   ARRAY_SIZE(smca_l2_mce_desc)  },
f5a251
 	[SMCA_DE]       = { smca_de_mce_desc,   ARRAY_SIZE(smca_de_mce_desc)  },
f5a251
@@ -319,6 +353,7 @@ static struct smca_hwid smca_hwid_mcatypes[] = {
f5a251
 
f5a251
 	/* ZN Core (HWID=0xB0) MCA types */
f5a251
 	{ SMCA_LS,       0x000000B0 },
f5a251
+	{ SMCA_LS_V2,    0x001000B0 },
f5a251
 	{ SMCA_IF,       0x000100B0 },
f5a251
 	{ SMCA_L2_CACHE, 0x000200B0 },
f5a251
 	{ SMCA_DE,       0x000300B0 },
f5a251
@@ -362,6 +397,7 @@ struct smca_bank_name {
f5a251
 
f5a251
 static struct smca_bank_name smca_names[] = {
f5a251
 	[SMCA_LS]       = { "Load Store Unit" },
f5a251
+	[SMCA_LS_V2]    = { "Load Store Unit" },
f5a251
 	[SMCA_IF]       = { "Instruction Fetch Unit" },
f5a251
 	[SMCA_L2_CACHE] = { "L2 Cache" },
f5a251
 	[SMCA_DE]       = { "Decode Unit" },