Page MenuHomeFreeBSD

bhyve/arm64: Fix a race in PSCI CPU_ON
ClosedPublic

Authored by andrew on Aug 6 2025, 4:20 PM.
Tags
None
Referenced Files
F151030400: D51766.diff
Sun, Apr 5, 1:32 PM
F150994010: D51766.id.diff
Sun, Apr 5, 8:51 AM
Unknown Object (File)
Fri, Apr 3, 9:31 PM
Unknown Object (File)
Sun, Mar 22, 2:46 PM
Unknown Object (File)
Thu, Mar 19, 2:42 AM
Unknown Object (File)
Mar 7 2026, 12:53 AM
Unknown Object (File)
Jan 26 2026, 1:17 AM
Unknown Object (File)
Jan 17 2026, 10:06 AM

Details

Summary

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.

Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 66024
Build 62907: arc lint + arc unit