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
F159951789: D51766.id159953.diff
Fri, Jun 19, 9:21 PM
Unknown Object (File)
May 18 2026, 7:51 PM
Unknown Object (File)
May 15 2026, 3:01 PM
Unknown Object (File)
May 14 2026, 2:59 PM
Unknown Object (File)
May 14 2026, 2:24 PM
Unknown Object (File)
May 14 2026, 9:57 AM
Unknown Object (File)
May 13 2026, 6:23 AM
Unknown Object (File)
May 8 2026, 4:07 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 Not Applicable
Unit
Tests Not Applicable