Skip to content

Commit

Permalink
x86/MCE/AMD: Define a function to get SMCA bank type
Browse files Browse the repository at this point in the history
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 <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20171207203955.118171-1-Yazen.Ghannam@amd.com
  • Loading branch information
Yazen Ghannam authored and Thomas Gleixner committed Dec 18, 2017
1 parent c8a4364 commit 11cf887
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions arch/x86/kernel/cpu/mcheck/mce_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 } */

Expand Down

0 comments on commit 11cf887

Please sign in to comment.