x86/mce/amd: Remove shared threshold bank plumbing
authorYazen Ghannam <yazen.ghannam@amd.com>
Fri, 6 Dec 2024 16:11:54 +0000 (16:11 +0000)
committerBorislav Petkov (AMD) <bp@alien8.de>
Fri, 3 Jan 2025 18:05:35 +0000 (19:05 +0100)
commitd35fb3121a36170bba951c529847a630440e4174
tree70d10483ca209522bd1d20342fd064eafa4128a9
parent053d18057e6292462f1b3f9460dd0c1e34609f67
x86/mce/amd: Remove shared threshold bank plumbing

Legacy AMD systems include an integrated Northbridge that is represented
by MCA bank 4. This is the only non-core MCA bank in legacy systems. The
Northbridge is physically shared by all the CPUs within an AMD "Node".

However, in practice the "shared" MCA bank can only by managed by a
single CPU within that AMD Node. This is known as the "Node Base Core"
(NBC). For example, only the NBC will be able to read the MCA bank 4
registers; they will be Read-as-Zero for other CPUs. Also, the MCA
Thresholding interrupt will only signal the NBC; the other CPUs will not
receive it. This is enforced by hardware, and it should not be managed by
software.

The current AMD Thresholding code attempts to deal with the "shared" MCA
bank by micromanaging the bank's sysfs kobjects. However, this does not
follow the intended kobject use cases. It is also fragile, and it has
caused bugs in the past.

Modern AMD systems do not need this shared MCA bank support, and it
should not be needed on legacy systems either.

Remove the shared threshold bank code. Also, move the threshold struct
definitions to mce/amd.c, since they are no longer needed in amd_nb.c.

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20241206161210.163701-2-yazen.ghannam@amd.com
arch/x86/Kconfig
arch/x86/include/asm/amd_nb.h
arch/x86/kernel/cpu/mce/amd.c