lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230704105823.3516889-2-muralimk@amd.com>
Date:   Tue, 4 Jul 2023 10:58:21 +0000
From:   Muralidhara M K <muralimk@....com>
To:     <linux-edac@...r.kernel.org>
CC:     <linux-kernel@...r.kernel.org>, <mchehab@...nel.org>,
        <bp@...en8.de>, Muralidhara M K <muralidhara.mk@....com>,
        Gupta Akshay <akshay.gupta@....com>
Subject: [PATCH 1/3] rasdaemon: Decode bank_type based on InstanceIdHi in MCA_IPID.

From: Muralidhara M K <muralidhara.mk@....com>

On some AMD systems, InstanceIdHi bits b'47:44 of MCA_IPID register
are Reserved, but the same bits are defined on viz. Genoa. So bank type
is erroneously decoded.

Incorrect bank_type which is socket_id value is observed from the
register InstanceIdHi field.
Handle these bit fields appropriately to get correct bank_type.

Signed-off-by: Muralidhara M K <muralidhara.mk@....com>
Tested-by: Gupta Akshay <akshay.gupta@....com>
---
 mce-amd-smca.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/mce-amd-smca.c b/mce-amd-smca.c
index f69b555..4a2e645 100644
--- a/mce-amd-smca.c
+++ b/mce-amd-smca.c
@@ -790,6 +790,10 @@ static void decode_smca_error(struct mce_event *e, struct mce_priv* m)
 	const struct smca_hwid *s_hwid;
 	uint32_t mcatype_hwid = EXTRACT(e->ipid, 32, 63);
 	uint8_t mcatype_instancehi = EXTRACT(e->ipid, 44, 47);
+	/* MCA_IPID[43:32] HardwareID of IP associated with MCA bank */
+	uint16_t ipid_hwid = EXTRACT(e->ipid, 32, 43);
+	/* MCA_IPID[63:48] McaType of the MCA bank within the IP */
+	uint16_t ipid_mcatype = EXTRACT(e->ipid, 48, 63);
 	unsigned int csrow = -1, channel = -1;
 	unsigned int i;
 
@@ -800,6 +804,11 @@ static void decode_smca_error(struct mce_event *e, struct mce_priv* m)
 		if (mcatype_hwid == s_hwid->mcatype_hwid) {
 			bank_type = s_hwid->bank_type;
 			break;
+		} else if ((mcatype_instancehi == e->socketid) &&
+			(ipid_hwid == EXTRACT(s_hwid->mcatype_hwid, 0, 11)) &&
+			(ipid_mcatype == EXTRACT(s_hwid->mcatype_hwid, 16, 31))) {
+			bank_type = s_hwid->bank_type;
+			break;
 		}
 		if (mcatype_instancehi >= NONCPU_NODE_INDEX)
 			bank_type = SMCA_UMC_V2;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ