]> www.infradead.org Git - users/mchehab/rasdaemon.git/commit
rasdaemon: Fix SMCA bank type decoding
authorAvadhut Naik <avadhut.naik@amd.com>
Thu, 31 Aug 2023 07:23:48 +0000 (02:23 -0500)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 23 Oct 2023 09:27:18 +0000 (11:27 +0200)
commitb6a64416ab31b66ce92cabcc7fa1f3c5e9db2e87
tree649ba70c73ec1b57586bfcd1f34e71e7cd2bffb4
parentc785d309dcbdeb7ecd219975244f3944a8d047e9
rasdaemon: Fix SMCA bank type decoding

On AMD systems with Scalable MCA (SMCA), the (HWID, MCATYPE) tuple from
the MCA_IPID MSR, bits 43:32 and 63:48 respectively, are used for SMCA
bank type decoding. On occurrence of an SMCA error, the cached tuples are
compared against the tuple read from the MCA_IPID MSR to determine the
SMCA bank type.

Currently however, all high 32 bits of the MCA_IPID register are cached in
the rasdaemon for all SMCA bank types. Bits 47:44 which do not play a part
in bank type decoding are zeroed out. Likewise, when an SMCA error occurs,
all high 32 bits of the MCA_IPID register are read and compared against
the cached values in smca_hwid_mcatypes array.

This can lead to erroneous bank type decoding since the bits 47:44 are
not guaranteed to be zero. They are either reserved or, on some modern
AMD systems viz. Genoa, denote the InstanceIdHi value. The bits therefore,
should not be associated with SMCA bank type decoding.

Import the HWID_MCATYPE macro from the kernel to ensure that only the
relevant fields i.e. (HWID, MCATYPE) tuples are used for SMCA bank type
decoding on occurrence of an SMCA error.

Signed-off-by: Avadhut Naik <avadhut.naik@amd.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
mce-amd-smca.c