HomeFreeBSD

bhyve/arm64: Fix a race in PSCI CPU_ON

Description

bhyve/arm64: Fix a race in PSCI CPU_ON

When multiple CPUs try to start the same CPU only one should return
success, the other CPUs should see either ON_PENDING or ALREADY_ON.
There was a race between checking if the CPU is on and marking it as
on in the running_cpumask CPU set.

Fix the race by using CPU_TEST_SET_ATOMIC to both check and set the
state in running_cpumask.

Reviewed by: markj
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D51766

Details

Provenance
andrewAuthored on Aug 7 2025, 9:31 AM
Reviewer
markj
Differential Revision
D51766: bhyve/arm64: Fix a race in PSCI CPU_ON
Parents
rG9274eb16e5da: cpuset: Add CPU_TEST_{SET,CLR}_ATOMIC
Branches
Unknown
Tags
Unknown