Thread (108 messages) 108 messages, 10 authors, 2025-11-07

RE: [PATCH v3 10/29] arm_mpam: Add cpuhp callbacks to probe MSC hardware

From: Shaopeng Tan (Fujitsu) <hidden>
Date: 2025-10-29 07:25:44
Also in: linux-acpi, lkml

Because an MSC can only by accessed from the CPUs in its cpu-affinity set we
need to be running on one of those CPUs to probe the MSC hardware.

Do this work in the cpuhp callback. Probing the hardware will only happen
before MPAM is enabled, walk all the MSCs and probe those we can reach that
haven't already been probed as each CPU's online call is made.

This adds the low-level MSC register accessors.

Once all MSCs reported by the firmware have been probed from a CPU in their
respective cpu-affinity set, the probe-time cpuhp callbacks are replaced.  The
replacement callbacks will ultimately need to handle save/restore of the
runtime MSC state across power transitions, but for now there is nothing to do
in them: so do nothing.

The architecture's context switch code will be enabled by a static-key, this can
be set by mpam_enable(), but must be done from process context, not a cpuhp
callback because both take the cpuhp lock.
Whenever a new MSC has been probed, the mpam_enable() work is scheduled
to test if all the MSCs have been probed. If probing fails, mpam_disable() is
scheduled to unregister the cpuhp callbacks and free memory.

CC: Lecopzer Chen <redacted>
Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Ben Horgan <ben.horgan@arm.com>
Reviewed-by: Fenghua Yu <fenghuay@nvidia.com>
Reviewed-by: Gavin Shan <redacted>
Tested-by: Fenghua Yu <fenghuay@nvidia.com>
Reviewed-by: Shaopeng Tan <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help