]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
x86/mce/amd: Remove smca_banks_map
authorYazen Ghannam <yazen.ghannam@amd.com>
Mon, 25 Aug 2025 17:33:00 +0000 (17:33 +0000)
committerBorislav Petkov (AMD) <bp@alien8.de>
Fri, 5 Sep 2025 10:41:48 +0000 (12:41 +0200)
commitb249288abde5190bb113ea5acef8af4ceac4957c
tree53ed58991d72b975892925011901251ba63ee1b3
parent4d2161b9e8ba64076f520ec2f00eefb00722c15e
x86/mce/amd: Remove smca_banks_map

The MCx_MISC0[BlkPtr] field was used on legacy systems to hold a register
offset for the next MCx_MISC* register. In this way, an implementation-specific
number of registers can be discovered at runtime.

The MCAX/SMCA register space simplifies this by always including the
MCx_MISC[1-4] registers. The MCx_MISC0[BlkPtr] field is used to indicate
(true/false) whether any MCx_MISC[1-4] registers are present.

Currently, MCx_MISC0[BlkPtr] is checked early and cached to be used during
sysfs init later. This is unnecessary as the MCx_MISC0 register is read again
later anyway.

Remove the smca_banks_map variable as it is effectively redundant, and use
a direct register/bit check instead.

  [ bp: Zap smca_get_block_address() too. ]

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Tested-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/20250825-wip-mca-updates-v5-3-865768a2eef8@amd.com
arch/x86/kernel/cpu/mce/amd.c