The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v5 00/10] Introduce MMIO-based CMT access for Enhanced RDT
@ 2026-07-01 13:44 Chen Yu
  2026-07-01 13:45 ` [PATCH v5 01/10] x86/resctrl: Require 64-bit x86 for resctrl support Chen Yu
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Chen Yu @ 2026-07-01 13:44 UTC (permalink / raw)
  To: tony.luck, reinette.chatre
  Cc: x86, linux-kernel, tglx, bp, mingo, dave.hansen, hpa, fenghuay,
	babu.moger, anil.keshavamurthy, chen.yu, Chen Yu

v4: https://lore.kernel.org/lkml/cover.1781332698.git.yu.c.chen@intel.com/
v3: https://lore.kernel.org/lkml/cover.1780710620.git.yu.c.chen@intel.com/
v2: https://lore.kernel.org/lkml/cover.1780587063.git.yu.c.chen@intel.com/
v1: https://lore.kernel.org/lkml/cover.1779872016.git.yu.c.chen@intel.com/

Intel Enhanced Resource Director Technology (ERDT) extends the existing
RDT framework with two major capabilities:

  1. MMIO-based access to monitoring and allocation registers, replacing
     the legacy MSR-based interface.
  2. Region-aware RDT for fine-grained control over different tiers of
     memory (e.g., CXL.mem, DDR).

This is described in the Intel RDT Architecture Specification:
https://cdrdv2-public.intel.com/789566/356688-intel-rdt-arch-spec.pdf

This patch set focuses on the first part: enabling MMIO-based access for
Cache Monitoring Technology (CMT), while CAT/MBM/MBA are still using MSR.
The platform advertises the MMIO register layout through the ACPI ERDT
(Enhanced Resource Director Technology) table, which contains sub-tables
describing per-domain register regions for monitoring and allocation.

With ERDT, L3 cache occupancy counters are read via MMIO rather than
MSR, allowing the reads to be performed from any CPU without requiring
cross-CPU IPIs. This series parses the relevant ACPI sub-tables (RMDD,
CMRC), prepares the resctrl monitor infrastructure for MMIO-based reads,
and adds initial support for reading L3 occupancy via the CMRC interface.

kselftest of CMT and L3_CAT has passed with minor adjustment at
https://lore.kernel.org/lkml/20260523101715.3964456-1-yu.c.chen@intel.com/.

V5 has undergone internal Sashiko review.

Changes from V4 to V5:
There are some major changes since v4:
- (biggest change) Eliminate the xarray for runtime lookups; embed
  struct erdt_domain_info directly in rdt_hw_l3_mon_domain and assign
  during l3_mon_domain_setup().
- Separate CPUID and ACPI enumeration cleanly. Do not use CPUID feature
  flags to gate MMIO-based monitoring. Use ACPI table presence (e.g., CMRC table)
  to determine event enablement.
- Use ACPI RMDD's own "Max RMID" field for MMIO access instead of relying
  on CPUID's max RMID (which applies to MSR).
- Enforce the SNC constraint in code rather than burying it behind a comment
  WARN. Disable mon_capable in rdt_get_l3_mon_config() when ERDT is
  enabled and snc_nodes_per_l3_cache > 1.
- Split non-resctrl changes (topology.c, apic.h) into a separate preparatory
  patch prefixed with x86/topology.
- Move the "depends on X86" to "X86_64" adjustment to a separate patch with explicit
  justification in its changelog.

Misc in V5:
- arch_priv is not used to distinguish whether a monitor is MSR-based or
  ERDT backed, since a unified erdt_cpu_has() is introduced to check whether a
  specific RDT feature is backed by ERDT and its sub-tables. [PATCH 9/10]
- I have removed Thomas's Reviewed-by tag from [PATCH 10/10], as the patch was
  updated to rely on erdt_cpu_has().

Thanks Tony, Reinette, Thomas, Hongyu for your time to look at this patch set.

Changes from V3 to V4:
- Remove the redundant table length check in subtbl_valid() (Thomas Gleixner)
- Reuse subtbl_valid() for all the table iteration (Thomas Gleixner)
- Refine the commit log of [PATCH 5/6] to state that this change is a
  preparation for [PATCH 6/6] rather than fixing an existing issue
  (Thomas Gleixner, Reinette Chatre, Tony Luck)
- Fix if CACD lists all CPUs in the LLC domain (sashiko)
- Deal with a corner case that if there is no valid RMDD tables,
  the erdt_enabled_flag should remain false.(sashiko)
- Add Thomas's Reviewed-by and Hongyu's Tested-by.

Changes from V2 to V3:
- Wrap __resctrl_arch_late_init() to avoid the goto logic. (Thomas Gleixner)
- Make the variables in struct erdt_domain_info tabular format (Thomas Gleixner)
- Remove tail comments (Thomas Gleixner)
- Make the name of erdt_enabled() and variable in it consistent and
  comprehensible. (Thomas Gleixner)
- Use topo_lookup_cpuid() to search the CPU id according to the x2apic id
  (Thomas Gleixner)
- Fix kernel doc comment format (Thomas Gleixner)
- Use brackets for multiple lines "if" case. (Thomas Gleixner)
- Let the parameter for cacd_init() to fully utilize 100 characters.
  (Thomas Gleixner)
- Variables are reordered in reverse fir-tree.(Thomas Gleixner)
- Added a named constant and use it in the rmdd->flags check.
  (Thomas Gleixner)
- Introduce helper functions to make the code readable when iterating
  the RMDD tables. (Thomas Gleixner)
- Make the macros tabular format. (Thomas Gleixner)

Changes from V1 to V2:
- Add #include <linux/cleanup.h> to follow the "include-what-you-use" best
  practice (Tony Luck)
- Fix 3 issues reported by:
  https://sashiko.dev/#/patchset/cover.1779872016.git.yu.c.chen%40intel.com
  Remove the variable of cacd in struct erdt_domain_info as it will
  never be used after initialization.
  Invoke erdt_exit() to avoid resource leak if rdt_alloc_capable and
  rdt_mon_capable are both false.
  Adjust the comments suggested by sashiko.

Anil S Keshavamurthy (1):
  x86/resctrl: Parse ACPI ERDT table and save CACD cpumask for RMDD
    domains

Chen Yu (8):
  x86/resctrl: Require 64-bit x86 for resctrl support
  x86/topology: Export topo_lookup_cpuid() for resctrl use
  x86/resctrl: Attach ACPI ERDT information to L3 mon domain on CPU
    online
  x86/resctrl: Parse ACPI CMRC table
  x86/resctrl: Replace "msr" in monitoring data identifiers
  x86/resctrl: Refactor the monitor read function
  x86/resctrl: Introduce helpers to read L3 occupancy via MMIO
  x86/resctrl: Enable read L3 occupancy via MMIO

Tony Luck (1):
  fs/resctrl: Do not invoke smp_processor_id() in preemptible context

 arch/x86/Kconfig                       |   4 +-
 arch/x86/include/asm/apic.h            |   1 +
 arch/x86/include/asm/resctrl.h         |   6 +
 arch/x86/kernel/cpu/resctrl/Makefile   |   1 +
 arch/x86/kernel/cpu/resctrl/core.c     |  64 +++-
 arch/x86/kernel/cpu/resctrl/erdt.c     | 439 +++++++++++++++++++++++++
 arch/x86/kernel/cpu/resctrl/internal.h |  40 ++-
 arch/x86/kernel/cpu/resctrl/monitor.c  |  82 +++--
 arch/x86/kernel/cpu/topology.c         |   2 +-
 fs/resctrl/monitor.c                   |  48 ++-
 include/linux/resctrl.h                |   1 +
 11 files changed, 643 insertions(+), 45 deletions(-)
 create mode 100644 arch/x86/kernel/cpu/resctrl/erdt.c

-- 
2.45.2


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

end of thread, other threads:[~2026-07-01 13:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01 13:44 [PATCH v5 00/10] Introduce MMIO-based CMT access for Enhanced RDT Chen Yu
2026-07-01 13:45 ` [PATCH v5 01/10] x86/resctrl: Require 64-bit x86 for resctrl support Chen Yu
2026-07-01 13:45 ` [PATCH v5 02/10] x86/topology: Export topo_lookup_cpuid() for resctrl use Chen Yu
2026-07-01 13:45 ` [PATCH v5 03/10] x86/resctrl: Parse ACPI ERDT table and save CACD cpumask for RMDD domains Chen Yu
2026-07-01 13:45 ` [PATCH v5 04/10] x86/resctrl: Attach ACPI ERDT information to L3 mon domain on CPU online Chen Yu
2026-07-01 13:46 ` [PATCH v5 05/10] x86/resctrl: Parse ACPI CMRC table Chen Yu
2026-07-01 13:46 ` [PATCH v5 06/10] x86/resctrl: Replace "msr" in monitoring data identifiers Chen Yu
2026-07-01 13:46 ` [PATCH v5 07/10] x86/resctrl: Refactor the monitor read function Chen Yu
2026-07-01 13:47 ` [PATCH v5 08/10] fs/resctrl: Do not invoke smp_processor_id() in preemptible context Chen Yu
2026-07-01 13:47 ` [PATCH v5 09/10] x86/resctrl: Introduce helpers to read L3 occupancy via MMIO Chen Yu
2026-07-01 13:47 ` [PATCH v5 10/10] x86/resctrl: Enable " Chen Yu

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