[PATCH v2 22/45] arm_mpam: resctrl: Add CDP emulation

Jonathan Cameron jonathan.cameron at huawei.com
Mon Jan 5 10:07:00 PST 2026


On Fri, 19 Dec 2025 18:11:24 +0000
Ben Horgan <ben.horgan at arm.com> wrote:

> From: James Morse <james.morse at arm.com>
> 
> Intel RDT's CDP feature allows the cache to use a different control value
> depending on whether the accesses was for instruction fetch or a data
> access. MPAM's equivalent feature is the other way up: the CPU assigns a
> different partid label to traffic depending on whether it was instruction
> fetch or a data access, which causes the cache to use a different control
> value based solely on the partid.
> 
> MPAM can emulate CDP, with the side effect that the alternative partid is
> seen by all MSC, it can't be enabled per-MSC.
> 
> Add the resctrl hooks to turn this on or off. Add the helpers that match a
> closid against a task, which need to be aware that the value written to
> hardware is not the same as the one resctrl is using.
> 
> Update the 'arm64_mpam_global_default' variable the arch code uses during
> context switch to know when the per-cpu value should be used instead.
> 
> Awkwardly, the MB controls don't implement CDP. To emulate this, the MPAM
> equivalent needs programming twice by the resctrl glue, as resctrl expects
> the bandwidth controls to be applied independently for both data and
> instruction-fetch.
> 
> CC: Dave Martin <Dave.Martin at arm.com>
> CC: Amit Singh Tomar <amitsinght at marvell.com>
> Signed-off-by: James Morse <james.morse at arm.com>
> Signed-off-by: Ben Horgan <ben.horgan at arm.com>

Minor thing below.
Reviewed-by: Jonathan Cameron <jonathan.cameron at huawei.com>


> diff --git a/include/linux/arm_mpam.h b/include/linux/arm_mpam.h
> index 5a78299ec464..ba0312b55d9f 100644
> --- a/include/linux/arm_mpam.h
> +++ b/include/linux/arm_mpam.h
> @@ -5,6 +5,7 @@
>  #define __LINUX_ARM_MPAM_H
>  
>  #include <linux/acpi.h>
> +#include <linux/resctrl_types.h>

This seems odd as nothing added to the header in this path appears to need it.
Maybe should be down in the c file or in a different patch?

>  #include <linux/types.h>
>  
>  struct mpam_msc;
> @@ -56,6 +57,8 @@ void resctrl_arch_set_cpu_default_closid(int cpu, u32 closid);
>  void resctrl_arch_set_closid_rmid(struct task_struct *tsk, u32 closid, u32 rmid);
>  void resctrl_arch_set_cpu_default_closid_rmid(int cpu, u32 closid, u32 rmid);
>  void resctrl_arch_sched_in(struct task_struct *tsk);
> +bool resctrl_arch_match_closid(struct task_struct *tsk, u32 closid);
> +bool resctrl_arch_match_rmid(struct task_struct *tsk, u32 closid, u32 rmid);
>  
>  /**
>   * mpam_register_requestor() - Register a requestor with the MPAM driver




More information about the linux-arm-kernel mailing list