• Yazen Ghannam's avatar
    x86/MCE/AMD, EDAC/mce_amd: Support non-uniform MCA bank type enumeration · 91f75eb4
    Yazen Ghannam authored
    AMD systems currently lay out MCA bank types such that the type of bank
    number "i" is either the same across all CPUs or is Reserved/Read-as-Zero.
    
    For example:
    
      Bank # | CPUx | CPUy
        0      LS     LS
        1      RAZ    UMC
        2      CS     CS
        3      SMU    RAZ
    
    Future AMD systems will lay out MCA bank types such that the type of
    bank number "i" may be different across CPUs.
    
    For example:
    
      Bank # | CPUx | CPUy
        0      LS     LS
        1      RAZ    UMC
        2      CS     NBIO
        3      SMU    RAZ
    
    Change the structures that cache MCA bank types to be per-CPU and update
    smca_get_bank_type() to handle this change.
    
    Move some SMCA-specific structures to amd.c from mce.h, since they no
    longer need to be global.
    
    Break out the "count" for bank types from struct smca_hwid, since this
    should provide a per-CPU count rather than a system-wide count.
    
    Apply the "const" qualifier to the struct smca_hwid_mcatypes array. The
    values in this array should not change at runtime.
    Signed-off-by: default avatarYazen Ghannam <yazen.ghannam@amd.com>
    Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
    Link: https://lore.kernel.org/r/20211216162905.4132657-3-yazen.ghannam@amd.com
    91f75eb4
amdgpu_ras.c 70.1 KB