[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cefaff01-5e74-44b1-96aa-bb0c490f1ce3@arm.com>
Date: Wed, 10 Sep 2025 10:11:55 +0100
From: Ben Horgan <ben.horgan@....com>
To: James Morse <james.morse@....com>, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-acpi@...r.kernel.org,
devicetree@...r.kernel.org
Cc: shameerali.kolothum.thodi@...wei.com,
D Scott Phillips OS <scott@...amperecomputing.com>,
carl@...amperecomputing.com, lcherian@...vell.com,
bobo.shaobowang@...wei.com, tan.shaopeng@...itsu.com,
baolin.wang@...ux.alibaba.com, Jamie Iles <quic_jiles@...cinc.com>,
Xin Hao <xhao@...ux.alibaba.com>, peternewman@...gle.com,
dfustini@...libre.com, amitsinght@...vell.com,
David Hildenbrand <david@...hat.com>, Rex Nie <rex.nie@...uarmicro.com>,
Dave Martin <dave.martin@....com>, Koba Ko <kobak@...dia.com>,
Shanker Donthineni <sdonthineni@...dia.com>, fenghuay@...dia.com,
baisheng.gao@...soc.com, Jonathan Cameron <jonathan.cameron@...wei.com>,
Rob Herring <robh@...nel.org>, Rohit Mathew <rohit.mathew@....com>,
Rafael Wysocki <rafael@...nel.org>, Len Brown <lenb@...nel.org>,
Lorenzo Pieralisi <lpieralisi@...nel.org>, Hanjun Guo
<guohanjun@...wei.com>, Sudeep Holla <sudeep.holla@....com>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Danilo Krummrich <dakr@...nel.org>
Subject: Re: [PATCH 17/33] arm_mpam: Probe the hardware features resctrl
supports
Hi James,
On 9/9/25 17:57, James Morse wrote:
> Hi Ben,
>
> On 28/08/2025 14:44, Ben Horgan wrote:
>> On 8/22/25 16:29, James Morse wrote:
>>> Expand the probing support with the control and monitor types
>>> we can use with resctrl.
>
>>> diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
>>> index 012e09e80300..290a04f8654f 100644
>>> --- a/drivers/resctrl/mpam_devices.c
>>> +++ b/drivers/resctrl/mpam_devices.c
>>> @@ -102,7 +102,7 @@ static LLIST_HEAD(mpam_garbage);
>>>
>>> static u32 __mpam_read_reg(struct mpam_msc *msc, u16 reg)
>>> {
>>> - WARN_ON_ONCE(reg > msc->mapped_hwpage_sz);
>>> + WARN_ON_ONCE(reg + sizeof(u32) > msc->mapped_hwpage_sz);
>
>> Update in the patch that introduced this line.
>
> Yeah - this got ripped out.
> Now that the size is in the ACPI table, I should never need to debug it being wrong!
> (and the resulting translation fault will be enough to say something is wrong)
>
>
>>> diff --git a/drivers/resctrl/mpam_internal.h b/drivers/resctrl/mpam_internal.h
>>> index c6f087f9fa7d..9f6cd4a68cce 100644
>>> --- a/drivers/resctrl/mpam_internal.h
>>> +++ b/drivers/resctrl/mpam_internal.h
>>> @@ -136,6 +136,56 @@ static inline void mpam_mon_sel_lock_held(struct mpam_msc *msc)
>
>>> +/* Bits for mpam_features_t */
>>> +enum mpam_device_features {
>>> + mpam_feat_ccap_part = 0,
>>> + mpam_feat_cpor_part,
>>> + mpam_feat_mbw_part,
>>> + mpam_feat_mbw_min,
>>> + mpam_feat_mbw_max,
>>> + mpam_feat_mbw_prop,
>>> + mpam_feat_msmon,
>>> + mpam_feat_msmon_csu,
>>> + mpam_feat_msmon_csu_capture,
>>> + mpam_feat_msmon_csu_hw_nrdy,
>>> + mpam_feat_msmon_mbwu,
>>> + mpam_feat_msmon_mbwu_capture,
>>> + mpam_feat_msmon_mbwu_rwbw,
>>> + mpam_feat_msmon_mbwu_hw_nrdy,
>>> + mpam_feat_msmon_capt,
>>> + MPAM_FEATURE_LAST,
>
>> This isn't all the features or just the features supported by resctrl.
>> Just add them all in this patch?
>
> I'm having trouble parsing this ...
>
> I needed somewhere to split the features up, as there are rather a lot. Those that resctrl
> supports seemed like the logical spot.
I don't think resctrl doesn't support ccap, mpam_feat_ccap_part.
Possibly the point is that this is split into more detailed features
later but that's not clear from this patch or commit message.
>
>
>>> +};
>>> +static_assert(BITS_PER_TYPE(mpam_features_t) >= MPAM_FEATURE_LAST);
>>> +#define MPAM_ALL_FEATURES ((1 << MPAM_FEATURE_LAST) - 1)
>
>> Unused?
>
> Fixed, thanks!
>
>
> Thanks,
>
> James
Thanks,
Ben
Powered by blists - more mailing lists