[PATCH v4 0/6] arm-mpam: Add basic device tree support for resctrl
From: Yin Li
Date: Wed Oct 28 2026 - 07:48:14 EST
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 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]
[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
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. The MSC
register size is 0x2000, as the Kaanapali platform implements MPAM
registers up to offset 0x1FFF (permitted when MPAMCFG_MBW_PBM is not
implemented). It is included as a reference for other platform DT
authors.
Signed-off-by: Yin Li <yin.li@xxxxxxxxxxxxxxxx>
---
Changes since RFC v2:
- Fold the binding schema/example fixes into the binding patch.
- Fold the foundling MSC fix into the DT support patch; remove the
unnecessary parent cache availability check from
mpam_dt_create_foundling_msc() to keep it consistent with
mpam_dt_count_msc().
- Remove the #ifdef CONFIG_OF guard around the cache_of_calculate_id()
prototype in cacheinfo.h.
- Remove the [Yin Li:] annotation from the cacheinfo patch.
- Rebase onto next-20260918.
Changes since RFC v1:
- Fold fixes to inherited patches 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 with Fixes: tags.
- MSC MMIO window size: genuine off-by-one fix; the ">" bounds checks
include the access width and are kept as-is.
- ris_idx: validate range after of_property_read_reg() and keep u8
downstream, instead of widening the call chain to u64.
- cache-id sentinel: keep ~0U notation, leave cacheinfo.c unchanged,
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 RFC v1, into the DT support and memory-controller MSC
patches.
- Drop the "clear mask on error" patch.
Previous versions (RFC):
v3: https://lore.kernel.org/all/20261008-mpam-resctrl-dt-knp-support-v3-0-35196c2b43bf@xxxxxxxxxxxxxxxx/
RFC v2: https://lore.kernel.org/all/20260914-mpam-resctrl-dt-knp-support-v2-0-bf6645bb2f65@xxxxxxxxxxxxxxxx/
RFC v1: https://lore.kernel.org/all/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
---
Changes in v4:
- Reduce binding to minimal set covering only properties in current
use: remove RIS child node support, memory controller support,
arm,mpam-device, cpus and interrupt-names.
- Drop memory controller MSC patch (no concrete platform user).
- Drop RIS accessibility patch (no concrete platform user).
- Update DNM Kaanapali DTS: fix node names, compatible, ranges/reg
format; use 0x2000 register size reflecting platform implementation.
- Rebase onto next-20261014.
- Link to v3: https://patch.msgid.link/20261008-mpam-resctrl-dt-knp-support-v3-0-35196c2b43bf@xxxxxxxxxxxxxxxx
---
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
Yin Li (3):
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()
[DNM] arm64: dts: qcom: kaanapali: Add MPAM MSC nodes for the L2 caches
.../devicetree/bindings/arm/arm,mpam-msc.yaml | 52 +++++
arch/arm64/boot/dts/qcom/kaanapali.dtsi | 52 ++++-
drivers/base/cacheinfo.c | 17 +-
drivers/resctrl/mpam_devices.c | 254 +++++++++++++++++++--
drivers/resctrl/mpam_internal.h | 2 +-
include/linux/cacheinfo.h | 1 +
6 files changed, 341 insertions(+), 37 deletions(-)
---
base-commit: d419d682257d813f6cb7a28e42b35d0edf4ad038
change-id: 20260731-mpam-resctrl-dt-knp-support-c15dcc3a4a98
Best regards,
--
Yin Li <yin.li@xxxxxxxxxxxxxxxx>