Re: [PATCH v2 03/45] arm_mpam: Use non-atomic bitops when modifying feature bitmap

Ben Horgan
2026-01-06T11:11:27Z

Hi Jonathan,

On 1/5/26 16:34, Jonathan Cameron wrote:
> On Fri, 19 Dec 2025 18:11:05 +0000
> Ben Horgan <ben.horgan@arm.com> wrote:
>
>> In the test__props_mismatch() kunit test we rely on the struct mpam_props
>> being packed to ensure memcmp doesn't consider packing. Making it packed
>> reduces the alignment of the features bitmap and so breaks a requirement
>> for the use of atomics. As we don't rely on the set/clear of these bits
>> being atomic, just make them non-atomic.
>
> oh. That's a bit horrible.
>
> Whilst I guess no one is likely to 'upgrade' these it feels odd enough that
> I'd be tempted to leave a breadcrumb of a comment next to them on why
> they must be the non atomic versions.

Sure, I've added the comment:

The non-atomic get/set operations are used because if struct mpam_props
is packed, the alignment requirements for atomics aren't met.

>
> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
>
> Jonathan
>
>
>>
>> Signed-off-by: Ben Horgan <ben.horgan@arm.com>
Thanks,

Ben