]> Gentwo Git Trees - linux/.git/commit
x86/mce/amd: Enable interrupt vectors once per-CPU on SMCA systems
authorYazen Ghannam <yazen.ghannam@amd.com>
Tue, 4 Nov 2025 14:55:40 +0000 (14:55 +0000)
committerBorislav Petkov (AMD) <bp@alien8.de>
Wed, 5 Nov 2025 15:51:27 +0000 (16:51 +0100)
commit134b1eabe6d9df8873bd018c9465994db8bff945
treece86e33a691ac0ea1de4d7d2490c8f8587c3d9d5
parent7cb735d7c0cb4307b2072aae6268b5b2069a8658
x86/mce/amd: Enable interrupt vectors once per-CPU on SMCA systems

Scalable MCA systems have a per-CPU register that gives the APIC LVT offset
for the thresholding and deferred error interrupts.

Currently, this register is read once to set up the deferred error interrupt
and then read again for each thresholding block. Furthermore, the APIC LVT
registers are configured each time, but they only need to be configured once
per-CPU.

Move the APIC LVT setup to the early part of CPU init, so that the registers
are set up once. Also, this ensures that the kernel is ready to service the
interrupts before the individual error sources (each MCA bank) are enabled.

Apply this change only to SMCA systems to avoid breaking any legacy behavior.
The deferred error interrupt is technically advertised by the SUCCOR feature.
However, this was first made available on SMCA systems.  Therefore, only set
up the deferred error interrupt on SMCA systems and simplify the code.

Guidance from hardware designers is that the LVT offsets provided from the
platform should be used. The kernel should not try to enforce specific values.
However, the kernel should check that an LVT offset is not reused for multiple
sources.

Therefore, remove the extra checking and value enforcement from the MCE code.
The "reuse/conflict" case is already handled in setup_APIC_eilvt().

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