• Yazen Ghannam's avatar
    x86/MCE/AMD: Don't cache block addresses on SMCA systems · 95d057f5
    Yazen Ghannam authored
    On legacy systems, the addresses of the MCA_MISC* registers need to be
    recursively discovered based on a Block Pointer field in the registers.
    
    On Scalable MCA systems, the register space is fixed, and particular
    addresses can be derived by regular offsets for bank and register type.
    This fixed address space includes the MCA_MISC* registers.
    
    MCA_MISC0 is always available for each MCA bank. MCA_MISC1 through
    MCA_MISC4 are considered available if MCA_MISC0[BlkPtr]=1.
    
    Cache the value of MCA_MISC0[BlkPtr] for each bank and per CPU. This
    needs to be done only during init. The values should be saved per CPU
    to accommodate heterogeneous SMCA systems.
    
    Redo smca_get_block_address() to directly return the block addresses.
    Signed-off-by: default avatarYazen Ghannam <yazen.ghannam@amd.com>
    Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Tony Luck <tony.luck@intel.com>
    Cc: "x86@kernel.org" <x86@kernel.org>
    Link: https://lkml.kernel.org/r/20190607201752.221446-4-Yazen.Ghannam@amd.com
    95d057f5
amd.c 36.3 KB