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
Unknown Object (File)
Wed, Oct 15, 10:45 PM
Unknown Object (File)
Sun, Oct 12, 10:33 AM
Unknown Object (File)
Sun, Oct 12, 1:11 AM
Unknown Object (File)
Sun, Oct 12, 1:11 AM
Unknown Object (File)
Sun, Oct 12, 1:11 AM
Unknown Object (File)
Sat, Oct 11, 3:41 PM
Unknown Object (File)
Wed, Sep 24, 9:14 AM
Unknown Object (File)
Sep 15 2025, 5:23 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