Skip to content
Commit e8cb90fb authored by Will Deacon's avatar Will Deacon
Browse files

kvmtool: delegate exit/reboot responsibility to vcpu0



Our exit/reboot code is a bit of a mess:

  - Both kvm__reboot and kvm_cpu_exit send SIGKVMEXIT to running vcpus
  - When vcpu0 exits, the main thread starts executing destructors
    (exitcalls) whilst other vcpus may be running
  - The pause_lock isn't always held when inspecting is_running for
    a vcpu

This patch attempts to fix these issues by restricting the exit/reboot
path to vcpu0 and the main thread. In particular, a KVM_SYSTEM_EVENT
will signal SIGKVMEXIT to vcpu0, which will join with the main thread
and then tear down the other vcpus before invoking any destructor code.

Acked-by: default avatarBalbir Singh <bsingharora@gmail.com>
Tested-by: default avatarJulien Grall <julien.grall@arm.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 5568f3e3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment