mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Increase MCA bank count
@ 2026-11-23 23:26 Yazen Ghannam
  2026-11-23 23:26 ` [PATCH v2 1/3] x86/mce/amd: Fix bank lookup in amd_mce_usable_address() Yazen Ghannam
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Yazen Ghannam @ 2026-11-23 23:26 UTC (permalink / raw)
  To: linux-edac; +Cc: linux-kernel, tony.luck, x86

Hi all,

This set increases the max MCA bank count (MAX_NR_BANKS) to the
architectural limit.

Patch 1 is a bug fix that came out of code review.

Patch 2 is a pre-patch to avoid a bug for systems with more than 64 MCA
banks per thread.

Patch 3 is where MAX_NR_BANKS is updated. The commit message includes
some memory stats like the last time we bumped up MAX_NR_BANKS.

Originally, I intended to include additional patches to consolidate and
dynamically allocate many of the per-CPU and per-bank structures. These
still need more work. So I thought to send just this small set to start.

Also, I figure a smaller set would be easier for backporting for those
who want the feature support but don't want the additional rework.

I'm trying to see if the per-CPU rework can help with the "sysfs
hotplug" issues reported by syzbot. I'll send rework as a follow up to
this series.

Testing was done in a KVM guest with a locally patched QEMU that
emulates SMCA banks, at 255, 65, 64 and 1 banks per thread, and on AMD
EPYC server systems. Mainline fails at more than 64 banks. Without
patch 2, banks 64-127 alias to banks 0-63 for thresholding.

An LLM coding assistant was used to help draft and revise the commit
messages, to measure the size changes listed in patch 3, and to write
and run the tests above. All code and text were reviewed by me.

I had the measurement data included in patch 3 similar to how we did the
last time MAX_NR_BANKS got bumped up. Ofc, we can trim this if it's too
much.

Thanks,
Yazen

Changes in v2:
- Rebase on v7.4-rc4.
- Patch 1: Split the bank bound check into its own early return. (Boris)
- Patch 1: Note in the commit message that GHES records are affected
  too, and that an out-of-range bank makes the address not usable.
- Patch 3: Explain the cmci_supported() change in the commit message.
- Patch 3: Add the #MC stack frame and intel-bff.o size changes.
- Drop the Assisted-by trailers. Tool use is described above, following
  1e035297ffda ("docs: remove Assisted-by references").

v1: https://lore.kernel.org/r/20260903142049.4126599-1-yazen.ghannam@amd.com

Yazen Ghannam (3):
  x86/mce/amd: Fix bank lookup in amd_mce_usable_address()
  x86/mce/amd: Convert bank_map to a bitmap
  x86/mce: Increase MAX_NR_BANKS to 255

 arch/x86/include/asm/mce.h      |  2 +-
 arch/x86/kernel/cpu/mce/amd.c   | 11 +++++++----
 arch/x86/kernel/cpu/mce/core.c  |  6 ------
 arch/x86/kernel/cpu/mce/intel.c |  2 +-
 4 files changed, 9 insertions(+), 12 deletions(-)


base-commit: b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f
-- 
2.55.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-11-24  2:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23 23:26 [PATCH v2 0/3] Increase MCA bank count Yazen Ghannam
2026-11-23 23:26 ` [PATCH v2 1/3] x86/mce/amd: Fix bank lookup in amd_mce_usable_address() Yazen Ghannam
2026-11-24  1:39   ` [tip: x86/urgent] " tip-bot2 for Yazen Ghannam
2026-11-24  2:20   ` [PATCH v2 1/3] " Qiuxu (Leo) Zhuo
2026-11-23 23:27 ` [PATCH v2 2/3] x86/mce/amd: Convert bank_map to a bitmap Yazen Ghannam
2026-11-24  2:20   ` Qiuxu (Leo) Zhuo
2026-11-23 23:27 ` [PATCH v2 3/3] x86/mce: Increase MAX_NR_BANKS to 255 Yazen Ghannam
2026-11-24  2:10   ` Qiuxu (Leo) Zhuo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®