From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BE81B423775 for ; Tue, 28 Jul 2026 10:48:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785235700; cv=none; b=VSW3EqhrxjeWR6YAEB8MGmZpJq9U4lrbSZ459/YwmHb4sP2aXugkQ8bAZdI0kzu/ka39KnrLHxS+SFLvYr4aGBye/koz720NBARyZHiDlCO+Tuo5Ik3G5jIzb57JD+3QYv4hIoySTqUiEvYOCzUAkfTz/xEnGXjI1FyUfxORQck= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785235700; c=relaxed/simple; bh=6iBaKp3YBtRElsf7nnnSUePdGOXXb4/g2p+t0vNldwg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=d7gt7aikUJ0U+0+WAeXZR7UHD/T6nZu3Ulvuytq49L6+kxM9bppqbDCRozkpaMuLzrVe2Om2BkmVbVLZJq+oteGc5hF96SOOQMPGPSwyoG7HcKTEzHaq9PdKCuDv6O8AxxG9OO8QKWXA9p0XffTZt8bwS4GVCSuF27FvkitE21I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=nhQnjKJF; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="nhQnjKJF" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 11E871A9A; Tue, 28 Jul 2026 03:48:14 -0700 (PDT) Received: from [10.2.212.8] (e134344.arm.com [10.2.212.8]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AD59E3F66F; Tue, 28 Jul 2026 03:48:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785235698; bh=6iBaKp3YBtRElsf7nnnSUePdGOXXb4/g2p+t0vNldwg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=nhQnjKJFWZ+XHzdFfVSMYJjld2wyfuQBsB/9IifJ3euDVwRBpbx1AL2W8vun0+PtR MpW+nZX5HkBUS60AvBXR9wO34PU81O7hmq+JdO5Vkk1EIEqu3aazrxF1ZEoQfqEq6B jsmteajHKlv6+M7Ot5WmcWUwxjJ/e+JIDe3Zwmo0= Message-ID: <8618c244-eadc-4226-ae5c-86b719ac5e7d@arm.com> Date: Tue, 28 Jul 2026 11:48:14 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Thunderbird Daily Subject: Re: [PATCH] arm_mpam: Apply T241-MPAM-6 to 63-bit counters To: Shanker Donthineni , James Morse , Catalin Marinas , Will Deacon Cc: Reinette Chatre , Fenghua Yu , Shaopeng Tan , Zeng Heng , linux-kernel@vger.kernel.org References: <20260727191326.2202616-1-sdonthineni@nvidia.com> Content-Language: en-US From: Ben Horgan In-Reply-To: <20260727191326.2202616-1-sdonthineni@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Shanker, On 7/27/26 20: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 As described in that commit message, T241-MPAM-6 does not affect LWD counters. Is there another canonical description of T241-MPAM-6. Otherwise, this just looks like you've discovered a new h/w bug :) > 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. So, the MSC with IIDR MPAM_IIDR_NVIDIA_T241 has different sizes of long bandwidth counters between RIS. This seems a bit unusual. Please could you share which RIS have 44 bit long counters and which have 63 bits. (MPAMF_MBWUMON_IDR.LWD gives this) Thanks, Ben > > 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 > --- > 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)