[PATCH 30/33] arm_mpam: Use long MBWU counters if supported
Gavin Shan
gshan at redhat.com
Sun Nov 9 15:17:07 PST 2025
On 11/7/25 10:34 PM, Ben Horgan wrote:
> From: Rohit Mathew <rohit.mathew at arm.com>
>
> Now that the larger counter sizes are probed, make use of them.
>
> Callers of mpam_msmon_read() may not know (or care!) about the different
> counter sizes. Allow them to specify mpam_feat_msmon_mbwu and have the
> driver pick the counter to use.
>
> Only 32bit accesses to the MSC are required to be supported by the
> spec, but these registers are 64bits. The lower half may overflow
> into the higher half between two 32bit reads. To avoid this, use
> a helper that reads the top half multiple times to check for overflow.
>
> Signed-off-by: Rohit Mathew <rohit.mathew at arm.com>
> [morse: merged multiple patches from Rohit, added explicit counter selection ]
> Signed-off-by: James Morse <james.morse at arm.com>
> Reviewed-by: Ben Horgan <ben.horgan at arm.com>
> Reviewed-by: Jonathan Cameron <jonathan.cameron at huawei.com>
> Reviewed-by: Fenghua Yu <fenghuay at nvidia.com>
> Tested-by: Fenghua Yu <fenghuay at nvidia.com>
> Cc: Peter Newman <peternewman at google.com>
> Tested-by: Shaopeng Tan <tan.shaopeng at jp.fujitsu.com>
> Signed-off-by: Ben Horgan <ben.horgan at arm.com>
> ---
> Changes since v3:
> Peter:
> Fix type checking, use mpam_feat_msmon_mbwu_<n>counter
> Reset/configuration order of long counters
> ---
> drivers/resctrl/mpam_devices.c | 145 ++++++++++++++++++++++++++++-----
> 1 file changed, 126 insertions(+), 19 deletions(-)
>
Reviewed-by: Gavin Shan <gshan at redhat.com>
More information about the linux-arm-kernel
mailing list