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

Ben Horgan ben.horgan at arm.com
Tue Jan 6 03:11:19 PST 2026


Hi Jonathan,

On 1/5/26 16:34, Jonathan Cameron wrote:
> On Fri, 19 Dec 2025 18:11:05 +0000
> Ben Horgan <ben.horgan at 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 at huawei.com>
> 
> Jonathan
> 
> 
>>
>> Signed-off-by: Ben Horgan <ben.horgan at arm.com>
Thanks,

Ben




More information about the linux-arm-kernel mailing list