[PATCH RFC v2 00/10] arm-mpam: Add basic device tree support for resctrl
From: Yin Li
Date: Mon Sep 14 2026 - 05:54:43 EST
Notes for James, Shanker and Rob
--------------------------------
This series builds directly on your not-yet-upstream MPAM snapshot
patches from the mpam/snapshot+extras/v6.18-rc1 branch. The RFC (v1)
went only to linux-kernel and may have been missed; this v2 also goes to
linux-arm-kernel.
Please let us know if you are OK with us picking these up and extending
them (original authorship and Signed-off-by kept, changes annotated with
[Yin Li: ...]), or if you have your own plans to upstream MPAM DT
support, so we can avoid duplicating effort.
Add Arm MPAM resctrl basic device tree support.
Arm Memory System Resource Partitioning and Monitoring (MPAM) with
resctrl requires device tree (DT) support before it can be enabled on
DT-based platforms. This series provides the foundational DT binding and
parsing support for MPAM.
The patches are based on earlier work by James Morse, Shanker
Donthineni and Rob Herring, with fixes and additions on top.
Standalone fixes to existing mainline code (placed first, independent
of the DT work):
- arm_mpam: fix the RIS index range check
- arm_mpam: fix the MSC MMIO window size (off-by-one)
Inherited (authorship preserved, with fixes noted in each patch):
- dt-bindings: MPAM MSC binding [1]
- cacheinfo: expose cache-id generation from a device_node [2]
- arm_mpam: device tree support for MSC probing [3]
- arm_mpam: memory controller MSC support on DT platforms [4]
New on top:
- dt-bindings: schema and example fixes
- arm_mpam: fix foundling MSC creation
- arm_mpam: derive MSC accessibility from per-RIS nodes as a fallback
[1] https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git/commit/?h=mpam/snapshot+extras/v6.18-rc1&id=b38bed339681
[2] https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git/commit/?h=mpam/snapshot+extras/v6.18-rc1&id=2af39084438c
[3] https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git/commit/?h=mpam/snapshot+extras/v6.18-rc1&id=a6ab8b6c77cb
[4] https://git.kernel.org/pub/scm/linux/kernel/git/morse/linux.git/commit/?h=mpam/snapshot+extras/v6.18-rc1&id=c1be40782ace
Note: the MPAM DRIVER entry in MAINTAINERS has no "L:" mailing list, so
get_maintainer.pl does not suggest linux-arm-kernel for these files.
This series is Cc'd to linux-arm-kernel explicitly; adding an "L:" entry
to MAINTAINERS may be worth considering.
DT affinity model
-----------------
An MSC's CPU affinity is derived from its parent device (cache or memory
node). When the parent is a generic container, a per-RIS fallback
resolves affinity from a 'cpus' or 'arm,mpam-device' phandle on each RIS
node.
The Kaanapali DTS patch (marked DNM) is a local verification example
only: production firmware does not expose MSC register access to the OS,
so it is disabled by default and cannot be upstreamed as-is. It is
included as a reference for other platform DT authors.
Signed-off-by: Yin Li <yin.li@xxxxxxxxxxxxxxxx>
---
Changes in v2:
- Fixes to the inherited patches are folded into their respective
patches with [Yin Li: ...] annotations, as requested by Ben and Andre.
- Move the RIS index range-check and MSC MMIO window size fixes to the
front as standalone fixes to existing code, with Fixes: tags.
- MSC MMIO window size: reworked as a genuine off-by-one fix using
resource_size(); the ">" bounds checks include the access width and
are kept as ">" rather than changed to ">=".
- ris_idx: validate the range right after of_property_read_reg() and
keep u8 downstream, instead of widening the call chain to u64.
- cache-id sentinel: keep the ~0U notation (not U32_MAX) and leave
cacheinfo.c unchanged; only replace unsigned long with u32.
- Convert mpam_get_cpumask_from_cache_id() and the cache/component-id
variables from unsigned long to u32.
- Fold the device_node refcount fix (of_node_get()), reviewed by Andre
Przywara in v1, into the DT support and memory-controller MSC patches.
- Drop the "clear mask on error" patch: the caller ignores the affinity
on error, so it was unnecessary.
- The foundling_msc fix and the binding schema/example fixes are kept
separate for now, to be folded once reviewed.
- Link to v1: https://patch.msgid.link/20260811-mpam-resctrl-dt-knp-support-v1-0-ea6397bead59@xxxxxxxxxxxxxxxx
To: James Morse <james.morse@xxxxxxx>
To: Rob Herring <robh@xxxxxxxxxx>
To: Shanker Donthineni <sdonthineni@xxxxxxxxxx>
To: Ben Horgan <ben.horgan@xxxxxxx>
To: Krzysztof Kozlowski <krzk+dt@xxxxxxxxxx>
To: Conor Dooley <conor+dt@xxxxxxxxxx>
To: Catalin Marinas <catalin.marinas@xxxxxxx>
To: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
To: "Rafael J. Wysocki" <rafael@xxxxxxxxxx>
To: Danilo Krummrich <dakr@xxxxxxxxxx>
To: Reinette Chatre <reinette.chatre@xxxxxxxxx>
To: Fenghua Yu <fenghuay@xxxxxxxxxx>
To: Jonathan Cameron <jic23@xxxxxxxxxx>
To: Bjorn Andersson <andersson@xxxxxxxxxx>
To: Konrad Dybcio <konradybcio@xxxxxxxxxx>
To: Gavin Shan <gshan@xxxxxxxxxx>
Cc: Andre Przywara <andre.przywara@xxxxxxx>
Cc: Drew Fustini <fustini@xxxxxxxxxx>
Cc: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
Cc: Shaopeng Tan <tan.shaopeng@xxxxxxxxxxxxxx>
Cc: trilok.soni@xxxxxxxxxxxxxxxx
Cc: aiqun.yu@xxxxxxxxxxxxxxxx
Cc: ganapatrao.kulkarni@xxxxxxxxxxxxxxxx
Cc: Srivathsa L Rao <srivathsa.rao@xxxxxxxxxxxxxxxx>
Cc: Huang Yiwei <huang.yiwei@xxxxxxxxxxxxxxxx>
Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
Cc: linux-arm-msm@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: driver-core@xxxxxxxxxxxxxxx
Cc: devicetree@xxxxxxxxxxxxxxx
---
James Morse (2):
cacheinfo: Expose the code to generate a cache-id from a device_node
arm_mpam: Add device tree support for MSC probing
Rob Herring (1):
dt-bindings: arm: Add MPAM MSC binding
Shanker Donthineni (1):
arm_mpam: Add support for memory controller MSC on DT platforms
Yin Li (6):
arm_mpam: Fix the RIS index range check in mpam_ris_create_locked
arm_mpam: Fix MSC MMIO window size off-by-one with resource_size()
arm_mpam: Fix mpam_dt_create_foundling_msc() to create MSC platform devices
dt-bindings: arm: Fix MPAM MSC binding schema and examples
arm_mpam: Support MSC accessibility derivation from RIS nodes
[DNM] arm64: dts: qcom: kaanapali: Add MPAM MSC nodes for the L2 caches
.../devicetree/bindings/arm/arm,mpam-msc.yaml | 202 +++++++++++
arch/arm64/boot/dts/qcom/kaanapali.dtsi | 50 ++-
drivers/base/cacheinfo.c | 17 +-
drivers/resctrl/mpam_devices.c | 400 +++++++++++++++++++--
drivers/resctrl/mpam_internal.h | 2 +-
include/linux/cacheinfo.h | 3 +
6 files changed, 636 insertions(+), 38 deletions(-)
---
base-commit: a9d7ced84989ec05be09b4b8428759ef60450a0f
change-id: 20260731-mpam-resctrl-dt-knp-support-c15dcc3a4a98
Best regards,
--
Yin Li <yin.li@xxxxxxxxxxxxxxxx>