[PATCH v2 0/3] x86/resctrl: Keep default MBM mode at boot and fix ABMC

From: Babu Moger

Date: Fri Sep 04 2026 - 15:03:30 EST



Hi All,

This series restores default MBM assignment mode at boot, assigns counters
when switching to mbm_event, and fixes ABMC programming for more than 32
counters.

Commit 0f1576e43adc ("x86/resctrl: Configure mbm_event mode if supported")
enabled ABMC at boot. That breaks userspace that assumes default mode,
notably pqos from intel-cmt-cat [1]. pqos creates 16 or more groups (two
counters each) and exhausts a 32-counter pool, so further groups report
zero bandwidth.

mbm_event remains available as an opt-in for snapshot/rotation when there
are more groups than counters. Default mode can monitor more groups on
current AMD platforms, but there is a known issue with default mode when
monitoring more groups. It is documented now.

Patch 1: encode the full ABMC counter range in L3_QOS_ABMC_CFG (cntr_id
was 5 bits), expand bw_src, and use u64 to avoid 32-bit truncation.
The APM [2] at [3] will be updated for the expanded fields.

Patch 2: when switching to mbm_event, assign counters to existing
groups, including the default group, matching mkdir auto-assignment.

Patch 3: leave mbm_assign_mode as default at boot.

Based on tip/master:

461735aa6e8e Merge branch into tip/master: 'x86/bugs'

[1] https://github.com/intel/intel-cmt-cat/issues/311
[2] AMD64 Architecture Programmer's Manual Volume 2: System Programming,
Publication #24593, Revision 3.41, Section 19.3.3.3 "Assignable
Bandwidth Monitoring (ABMC)"
[3] https://bugzilla.kernel.org/show_bug.cgi?id=206537

v2:
- Added patch 2 to address Sashiko's comment regarding the documentation issue.
In fact, it exposed a real issue. When switching to mbm_event mode, existing
monitoring groups should be assigned counters whenever counters are available.
This provides a smooth transition between modes and aligns the behavior with
the existing auto-assignment mechanism.
https://sashiko.dev/#/patchset/8cb66e18e32e4087a9712c1e68ee6da614efe244.1784322818.git.babu.moger%40amd.com

- Combine the two v1 patches and add patch 2 (assign existing groups
on mbm_event switch; Sashiko review).
- Keep boot-default separate from the encoding/truncation fixes.
- Document the default-mode counter-pool limitation.

v1:
https://lore.kernel.org/lkml/980f39d3a0e0d9f73925e362f835aeef070a1bc5.1784322818.git.babu.moger@xxxxxxx/

Thanks
Babu Moger

Babu Moger (3):
x86/resctrl: Fix ABMC counter programming for extended counter ranges
fs/resctrl: Assign counters to existing groups when enabling mbm_event
x86/resctrl: Keep mbm_assign_mode in default mode at boot

Documentation/filesystems/resctrl.rst | 86 ++++++++++++++++----------
arch/x86/kernel/cpu/resctrl/internal.h | 18 +++---
arch/x86/kernel/cpu/resctrl/monitor.c | 1 -
fs/resctrl/monitor.c | 30 ++++++++-
4 files changed, 89 insertions(+), 46 deletions(-)

--
2.43.0