The patchset is based on mpam_resctrl_glue_v5_debugfs branch of https://gitlab.arm.com/linux-arm/linux-bh.git repository. The narrow-partid feature in MPAM allows for a more efficient use of PARTIDs by enabling a many-to-one mapping of reqpartids (requested PARTIDs) to intpartids (internal PARTIDs). This mapping reduces the number of unique PARTIDs needed, thus allowing more tasks or processes to be monitored and managed with the available resources. For a mixture of MSCs system, for MSCs that do not support narrow-partid, we use the PARTIDs exceeding the number of closids as reqPARTIDs for expanding the monitoring groups. Therefore, we will expand the information contained in the RMID, so that it includes not only PMG, but also reqPARTIDs information. The new RMID would be like: RMID = reqPARTID * NUM_PMG + PMG Each control group has m (req)PARTIDs, which are used to expand the number of monitoring groups under one control group. Therefore, the number of monitoring groups is no longer limited by the range of MPAM's PMG, which enhances the extensibility of the system's monitoring capabilities. --- Compared with v2: - Add dynamic reqPARTID allocation implementation. - Patch 4 has been merged into the repository, dropped from this series. Compared with v1: - Redefine the RMID information. - Refactor the resctrl_arch_rmid_idx_decode() and resctrl_arch_rmid_idx_encode(). - Simplify closid_rmid2reqpartid() to rmid2reqpartid() and replace it accordingly. Compared with RFC-v4: - Rebase the patch set on the v6.14-rc1 branch. Compared with RFC-v3: - Add limitation of the Narrow-PARTID feature (See Patch 2). - Remove redundant reqpartid2closid() and reqpartid_pmg2rmid(). - Refactor closid_rmid2reqpartid() partially. - Merge the PARTID conversion-related patches into a single patch for bisectability. - Skip adaptation of resctrl_arch_set_rmid() which is going to be removed. Compared with RFC-v2: - Refactor closid/rmid pair translation. - Simplify the logic of synchronize configuration. - Remove reqPARTID source bitmap. Compared with RFC-v1: - Rebase this patch set on latest MPAM driver of the v6.12-rc1 branch. v2: https://lore.kernel.org/all/20250222112448.2438586-1-zengheng4@huawei.com/ v1: https://lore.kernel.org/all/20250217031852.2014939-1-zengheng4@huawei.com/ RFC-v4: https://lore.kernel.org/all/20250104101224.873926-1-zengheng4@huawei.com/ RFC-v3: https://lore.kernel.org/all/20241207092136.2488426-1-zengheng4@huawei.com/ RFC-v2: https://lore.kernel.org/all/20241119135104.595630-1-zengheng4@huawei.com/ RFC-v1: https://lore.kernel.org/all/20241114135037.918470-1-zengheng4@huawei.com/ --- Ben Horgan (1): arm64/sysreg: Add MPAMSM_EL1 register Zeng Heng (9): arm_mpam: Add intPARTID and reqPARTID support for narrow PARTID feature arm_mpam: Disable Narrow-PARTID when MBA lacks support arm_mpam: Refactor rmid to reqPARTID/PMG mapping arm_mpam: Propagate control group config to sub-monitoring groups fs/resctrl: Add rmid_entry state helpers arm_mpam: Implement dynamic reqPARTID allocation for monitoring groups fs/resctrl: Wire up rmid expansion and reclaim functions arm64/mpam: Add mpam_sync_config() for dynamic rmid expansion fs/resctrl: Prevent rmid parsing errors by flushing limbo on umount Documentation/arch/arm64/index.rst | 1 + Documentation/arch/arm64/mpam.rst | 94 + Documentation/arch/arm64/silicon-errata.rst | 9 + arch/arm64/Kconfig | 6 +- arch/arm64/include/asm/el2_setup.h | 3 +- arch/arm64/include/asm/mpam.h | 96 + arch/arm64/include/asm/resctrl.h | 2 + arch/arm64/include/asm/thread_info.h | 3 + arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/cpufeature.c | 21 +- arch/arm64/kernel/mpam.c | 62 + arch/arm64/kernel/process.c | 7 + arch/arm64/kvm/hyp/include/hyp/switch.h | 12 +- arch/arm64/kvm/hyp/nvhe/hyp-main.c | 9 + arch/arm64/kvm/hyp/vhe/sysreg-sr.c | 16 + arch/arm64/kvm/sys_regs.c | 2 + arch/arm64/tools/sysreg | 8 + arch/x86/include/asm/resctrl.h | 7 + drivers/resctrl/Kconfig | 9 +- drivers/resctrl/Makefile | 1 + drivers/resctrl/mpam_devices.c | 340 ++- drivers/resctrl/mpam_internal.h | 112 +- drivers/resctrl/mpam_resctrl.c | 2094 +++++++++++++++++++ drivers/resctrl/test_mpam_resctrl.c | 364 ++++ fs/resctrl/monitor.c | 50 +- fs/resctrl/rdtgroup.c | 24 +- include/linux/arm_mpam.h | 49 + include/linux/resctrl.h | 21 + 28 files changed, 3368 insertions(+), 55 deletions(-) create mode 100644 Documentation/arch/arm64/mpam.rst create mode 100644 arch/arm64/include/asm/mpam.h create mode 100644 arch/arm64/include/asm/resctrl.h create mode 100644 arch/arm64/kernel/mpam.c create mode 100644 drivers/resctrl/mpam_resctrl.c create mode 100644 drivers/resctrl/test_mpam_resctrl.c -- 2.25.1