Skip to content

Commit 11cf887

Browse files
yghannamKAGA-KOKO
authored andcommitted
x86/MCE/AMD: Define a function to get SMCA bank type
Scalable MCA systems have various types of banks. The bank's type can determine how we handle errors from it. For example, if a bank represents a UMC (Unified Memory Controller) then we will need to convert its address from a normalized address to a system physical address before handling the error. [ bp: Verify m->bank is within range and use bank pointer. ] Signed-off-by: Yazen Ghannam <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected]
1 parent c8a4364 commit 11cf887

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

arch/x86/kernel/cpu/mcheck/mce_amd.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,20 @@ const char *smca_get_long_name(enum smca_bank_types t)
110110
}
111111
EXPORT_SYMBOL_GPL(smca_get_long_name);
112112

113+
static enum smca_bank_types smca_get_bank_type(struct mce *m)
114+
{
115+
struct smca_bank *b;
116+
117+
if (m->bank >= N_SMCA_BANK_TYPES)
118+
return N_SMCA_BANK_TYPES;
119+
120+
b = &smca_banks[m->bank];
121+
if (!b->hwid)
122+
return N_SMCA_BANK_TYPES;
123+
124+
return b->hwid->bank_type;
125+
}
126+
113127
static struct smca_hwid smca_hwid_mcatypes[] = {
114128
/* { bank_type, hwid_mcatype, xec_bitmap } */
115129

0 commit comments

Comments
 (0)