]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
arm64: mpam: Add helpers to change a task or cpu's MPAM PARTID/PMG values
authorJames Morse <james.morse@arm.com>
Fri, 13 Mar 2026 14:45:49 +0000 (14:45 +0000)
committerJames Morse <james.morse@arm.com>
Fri, 27 Mar 2026 15:29:09 +0000 (15:29 +0000)
commit2cf9ca3fae38b7894e7f1435cec92f9a679b42f9
tree85af27d149ac5a02141a825994e4bb4e44fcac01
parent37fe0f984d9ca60e8d95fc9a85d37f4300159625
arm64: mpam: Add helpers to change a task or cpu's MPAM PARTID/PMG values

Care must be taken when modifying the PARTID and PMG of a task in any
per-task structure as writing these values may race with the task being
scheduled in, and reading the modified values.

Add helpers to set the task properties, and the CPU default value.  These
use WRITE_ONCE() that pairs with the READ_ONCE() in mpam_get_regval() to
avoid causing torn values.

Tested-by: Gavin Shan <gshan@redhat.com>
Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
Tested-by: Peter Newman <peternewman@google.com>
Tested-by: Zeng Heng <zengheng4@huawei.com>
Tested-by: Punit Agrawal <punit.agrawal@oss.qualcomm.com>
Tested-by: Jesse Chick <jessechick@os.amperecomputing.com>
Cc: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Zeng Heng <zengheng4@huawei.com>
Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Co-developed-by: Ben Horgan <ben.horgan@arm.com>
Signed-off-by: Ben Horgan <ben.horgan@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
arch/arm64/include/asm/mpam.h