]> Git Repo - linux.git/commitdiff
x86/MCE/AMD: Define a function to get SMCA bank type
authorYazen Ghannam <[email protected]>
Mon, 18 Dec 2017 11:37:12 +0000 (12:37 +0100)
committerThomas Gleixner <[email protected]>
Mon, 18 Dec 2017 11:58:28 +0000 (12:58 +0100)
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]
arch/x86/kernel/cpu/mcheck/mce_amd.c

index a38ab1fa53a2cea89a292b03208d578a50b4bc23..661c4738be27cc53ad37485bdd1ab6ef50cc1c08 100644 (file)
@@ -110,6 +110,20 @@ const char *smca_get_long_name(enum smca_bank_types t)
 }
 EXPORT_SYMBOL_GPL(smca_get_long_name);
 
+static enum smca_bank_types smca_get_bank_type(struct mce *m)
+{
+       struct smca_bank *b;
+
+       if (m->bank >= N_SMCA_BANK_TYPES)
+               return N_SMCA_BANK_TYPES;
+
+       b = &smca_banks[m->bank];
+       if (!b->hwid)
+               return N_SMCA_BANK_TYPES;
+
+       return b->hwid->bank_type;
+}
+
 static struct smca_hwid smca_hwid_mcatypes[] = {
        /* { bank_type, hwid_mcatype, xec_bitmap } */
 
This page took 0.060091 seconds and 4 git commands to generate.