From: Fenghua Yu <fenghuay@nvidia.com>
To: Shanker Donthineni <sdonthineni@nvidia.com>,
James Morse <james.morse@arm.com>,
Ben Horgan <ben.horgan@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>
Cc: Reinette Chatre <reinette.chatre@intel.com>,
Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>,
Zeng Heng <zengheng4@huawei.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm_mpam: Apply T241-MPAM-6 to 63-bit counters
Date: Mon, 27 Jul 2026 12:26:26 -0700 [thread overview]
Message-ID: <ffbda45a-0432-4c43-956c-ce8a8d08e89a@nvidia.com> (raw)
In-Reply-To: <20260727191326.2202616-1-sdonthineni@nvidia.com>
On 7/27/26 12:13, Shanker Donthineni wrote:
> T241-MPAM-6 causes all MBWU counter formats to count 64-byte
> requests instead of bytes. Commit dc48eb1ff27c excluded the 63-bit
> MSMON_MBWU_LWD format while scaling the shorter counters. Systems
> selecting the preferred 63-bit counter consequently report bandwidth
> values that are 64 times too small.
>
> Apply the scale to both the sampled value and overflow correction for
> the 63-bit format. Unsigned arithmetic retains modulo-u64 behavior
> when the scaled counter range exceeds u64.
>
> Fixes: dc48eb1ff27c ("arm_mpam: Add workaround for T241-MPAM-6")
> Link: https://lore.kernel.org/lkml/20240816131432.993859-1-sdonthineni@nvidia.com/
> Signed-off-by: Shanker Donthineni <sdonthineni@nvidia.com>
Cc: <stable@vger.kernel.org>
Reviewed-by: Fenghua Yu <fenghuay@nvidia.com>
Tested-by: Fenghua Yu <fenghuay@nvidia.com>
Reported-by: Garima Kochhar <gkochhar@nvidia.com>
This is a hardware quirk fix and should be in stable.
Thanks.
-Fenghua
> ---
> drivers/resctrl/mpam_devices.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
> index 2f09f4b78bd3b..b68f5599e8dbe 100644
> --- a/drivers/resctrl/mpam_devices.c
> +++ b/drivers/resctrl/mpam_devices.c
> @@ -1196,8 +1196,7 @@ static u64 mpam_msmon_overflow_val(enum mpam_device_features type,
> {
> u64 overflow_val = __mpam_msmon_overflow_val(type);
>
> - if (mpam_has_quirk(T241_MBW_COUNTER_SCALE_64, msc) &&
> - type != mpam_feat_msmon_mbwu_63counter)
> + if (mpam_has_quirk(T241_MBW_COUNTER_SCALE_64, msc))
> overflow_val *= 64;
>
> return overflow_val;
> @@ -1293,8 +1292,7 @@ static void __ris_msmon_read(void *arg)
> now = FIELD_GET(MSMON___VALUE, now);
> }
>
> - if (mpam_has_quirk(T241_MBW_COUNTER_SCALE_64, msc) &&
> - m->type != mpam_feat_msmon_mbwu_63counter)
> + if (mpam_has_quirk(T241_MBW_COUNTER_SCALE_64, msc))
> now *= 64;
>
> if (nrdy)
next prev parent reply other threads:[~2026-07-27 19:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 19:13 Shanker Donthineni
2026-07-27 19:26 ` Fenghua Yu [this message]
2026-07-28 10:48 ` Ben Horgan
2026-07-28 13:42 ` Shanker Donthineni
2026-07-28 13:51 ` Ben Horgan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ffbda45a-0432-4c43-956c-ce8a8d08e89a@nvidia.com \
--to=fenghuay@nvidia.com \
--cc=ben.horgan@arm.com \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=reinette.chatre@intel.com \
--cc=sdonthineni@nvidia.com \
--cc=tan.shaopeng@jp.fujitsu.com \
--cc=will@kernel.org \
--cc=zengheng4@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®