]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/mce: Unify AMD THR handler with MCA Polling
authorYazen Ghannam <yazen.ghannam@amd.com>
Tue, 4 Nov 2025 14:55:38 +0000 (14:55 +0000)
committerBorislav Petkov (AMD) <bp@alien8.de>
Wed, 5 Nov 2025 12:41:18 +0000 (13:41 +0100)
commit34da4a5d6814ca4cd0116144e37433bf55cf0189
treece309f1ad80efd3eedbfd149cbdd92a79bc8fb48
parent6146a0f1dfae5d37442a9ddcba012add260bceb0
x86/mce: Unify AMD THR handler with MCA Polling

AMD systems optionally support an MCA thresholding interrupt. The interrupt
should be used as another signal to trigger MCA polling. This is similar to
how the Intel Corrected Machine Check interrupt (CMCI) is handled.

AMD MCA thresholding is managed using the MCA_MISC registers within an MCA
bank. The OS will need to modify the hardware error count field in order to
reset the threshold limit and rearm the interrupt. Management of the MCA_MISC
register should be done as a follow up to the basic MCA polling flow. It
should not be the main focus of the interrupt handler.

Furthermore, future systems will have the ability to send an MCA thresholding
interrupt to the OS even when the OS does not manage the feature, i.e.
MCA_MISC registers are Read-as-Zero/Locked.

Call the common MCA polling function when handling the MCA thresholding
interrupt. This will allow the OS to find any valid errors whether or not the
MCA thresholding feature is OS-managed. Also, this allows the common MCA
polling options and kernel parameters to apply to AMD systems.

Add a callback to the MCA polling function to check and reset any threshold
blocks that have reached their threshold limit.

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/20251104-wip-mca-updates-v8-0-66c8eacf67b9@amd.com
arch/x86/kernel/cpu/mce/amd.c