Re: [PATCH v2 15/29] arm_mpam: Reset MSC controls from cpu hp callbacks

Ben Horgan
2025-09-12T14:52:09Z

On 9/12/25 12:25, Ben Horgan wrote:
> Hi James,
>
> On 9/10/25 21:42, James Morse wrote:
>> When a CPU comes online, it may bring a newly accessible MSC with
>> it. Only the default partid has its value reset by hardware, and
>> even then the MSC might not have been reset since its config was
>> previously dirtyied. e.g. Kexec.
>>
>> Any in-use partid must have its configuration restored, or reset.
>> In-use partids may be held in caches and evicted later.
>>
>> MSC are also reset when CPUs are taken offline to cover cases where
>> firmware doesn't reset the MSC over reboot using UEFI, or kexec
>> where there is no firmware involvement.
>>
>> If the configuration for a RIS has not been touched since it was
>> brought online, it does not need resetting again.
>>
>> To reset, write the maximum values for all discovered controls.
>>
>> CC: Rohit Mathew <Rohit.Mathew@arm.com>
>> Signed-off-by: James Morse <james.morse@arm.com>
>> ---
>> Changes since RFC:
>> * Last bitmap write will always be non-zero.
>> * Dropped READ_ONCE() - teh value can no longer change.
>> * Write 0 to proporitional stride, remove the bwa_fract variable.
>> * Removed nested srcu lock, the assert should cover it.
>> ---
>> drivers/resctrl/mpam_devices.c | 117 ++++++++++++++++++++++++++++++++
>> drivers/resctrl/mpam_internal.h | 8 +++
>> 2 files changed, 125 insertions(+)
>>
>> +
>> +static void mpam_reset_msc(struct mpam_msc *msc, bool online)
>> +{
>> + struct mpam_msc_ris *ris;
>> +
>> + mpam_assert_srcu_read_lock_held();
>
> Unneeded? Checked in list_for_each_entry_srcu().> +

If you do get rid of this then that leaves one use of the helper,
mpam_assert_srcu_read_lock_held(), and so the helper could go.

> Thanks,
>
> Ben
>
>

Thanks,

Ben