mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yazen Ghannam <yazen.ghannam@amd.com>
To: <linux-edac@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <tony.luck@intel.com>, <x86@kernel.org>
Subject: [PATCH v2 0/3] Increase MCA bank count
Date: Mon, 23 Nov 2026 17:26:58 -0600	[thread overview]
Message-ID: <20261123232701.1923094-1-yazen.ghannam@amd.com> (raw)

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


             reply	other threads:[~2026-11-23 23:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 23:26 Yazen Ghannam [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261123232701.1923094-1-yazen.ghannam@amd.com \
    --to=yazen.ghannam@amd.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®