]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
arm_mpam: Disable preemption when making accesses to fake MSC in kunit test
authorBen Horgan <ben.horgan@arm.com>
Fri, 6 Mar 2026 18:27:17 +0000 (18:27 +0000)
committerWill Deacon <will@kernel.org>
Fri, 13 Mar 2026 14:17:30 +0000 (14:17 +0000)
commitc1376f1ff3f016a4b84e8030ed69df82e018d231
tree3efa0adf44b12ddf12f5aaf490f9328b3de96568
parent4ad79c874e53ebb7fe3b8ae7ac6c858a2121f415
arm_mpam: Disable preemption when making accesses to fake MSC in kunit test

Accesses to MSC must be made from a cpu that is affine to that MSC and the
driver checks this in __mpam_write_reg() using smp_processor_id(). A fake
in-memory MSC is used for testing. When using that, it doesn't matter which
cpu we access it from but calling smp_processor_id() from a preemptible
context gives warnings when running with CONFIG_DEBUG_PREEMPT.

Add a test helper that wraps mpam_reset_msc_bitmap() with preemption
disabled to ensure all (fake) MSC accesses are made with preemption
disabled.

Signed-off-by: Ben Horgan <ben.horgan@arm.com>
Reviewed-by: James Morse <james.morse@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
drivers/resctrl/test_mpam_devices.c