Re: [PATCH v4 08/10] arm_mpam: add MPAM-Fb MSC firmware access support
Andre Przywara <[email protected]> Tue, 28 Jul 2026 12:24:25 +0200
| Newsgroups | org.kernel.vger.linux-acpi,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
Hi Ritwick, On 7/28/26 12:04, Ritwick Sharma wrote: > On Thu, Jul 23, 2026 at 05:54:52PM +0200, Andre Przywara wrote: > >> - WARN_ON_ONCE((MSMON_MBWU_L + sizeof(u64)) > msc->mapped_hwpage_sz); >> + if (msc->iface == MPAM_IFACE_MMIO) >> + WARN_ON_ONCE((MSMON_MBWU_L + sizeof(u64)) > msc->mapped_hwpage_sz); > > I tested the MPAM-Fb series on an Arm AGI CPU. Many thanks for that, and for reporting on the list! > I think a similar MPAM_IFACE_MMIO check is needed in > mpam_msc_zero_mbwu_l(). Without this check, the mapped_hwpage_sz bounds > check is also performed for an MPAM-Fb MSC, which does not have an MMIO > mapping. I observed the following warning during testing: > > [ 50.638246] WARNING: drivers/resctrl/mpam_devices.c:1266 at mpam_msc_zero_mbwu_l+0x98/0xa8 Ouch, you are right, I missed that one. It seems my very limited testing didn't touch that code path. > There also appears to be an off-by-one issue in the calculation of > mapped_hwpage_sz: > > msc->mapped_hwpage_sz = msc_res->end - msc_res->start; > > The current calculation records a size that is one byte smaller than > the actual resource. I think this should use resource_size() instead: > > msc->mapped_hwpage_sz = resource_size(msc_res); Well spotted, I can make a separate patch for that, unless you beat me to it! Many thanks, Andre > > Thanks, > Ritwick