Thread (120 messages) 120 messages, 6 authors, 2026-01-13

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

From: Ben Horgan <ben.horgan@arm.com>
Date: 2026-01-06 11:11:27
Also in: kvmarm, lkml

Hi Jonathan,

On 1/5/26 16:34, Jonathan Cameron wrote:
On Fri, 19 Dec 2025 18:11:05 +0000
Ben Horgan [off-list ref] wrote:
quoted
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

quoted
Signed-off-by: Ben Horgan <ben.horgan@arm.com>
Thanks,

Ben

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help