]> Git Repo - linux.git/commit
KVM: Use syscore_ops instead of reboot_notifier to hook restart/shutdown
authorSean Christopherson <[email protected]>
Fri, 12 May 2023 23:31:26 +0000 (16:31 -0700)
committerPaolo Bonzini <[email protected]>
Fri, 19 May 2023 17:56:25 +0000 (13:56 -0400)
commit6735150b69978a9f73e3d1bab719e81a5dfafa83
treeef516b67d3226182447b70dc00ce6b9a27139b94
parent39428f6ea9eace95011681628717062ff7f5eb5f
KVM: Use syscore_ops instead of reboot_notifier to hook restart/shutdown

Use syscore_ops.shutdown to disable hardware virtualization during a
reboot instead of using the dedicated reboot_notifier so that KVM disables
virtualization _after_ system_state has been updated.  This will allow
fixing a race in KVM's handling of a forced reboot where KVM can end up
enabling hardware virtualization between kernel_restart_prepare() and
machine_restart().

Rename KVM's hook to match the syscore op to avoid any possible confusion
from wiring up a "reboot" helper to a "shutdown" hook (neither "shutdown
nor "reboot" is completely accurate as the hook handles both).

Opportunistically rewrite kvm_shutdown()'s comment to make it less VMX
specific, and to explain why kvm_rebooting exists.

Cc: Marc Zyngier <[email protected]>
Cc: Oliver Upton <[email protected]>
Cc: James Morse <[email protected]>
Cc: Suzuki K Poulose <[email protected]>
Cc: Zenghui Yu <[email protected]>
Cc: [email protected]
Cc: Huacai Chen <[email protected]>
Cc: Aleksandar Markovic <[email protected]>
Cc: Anup Patel <[email protected]>
Cc: Atish Patra <[email protected]>
Cc: [email protected]
Signed-off-by: Sean Christopherson <[email protected]>
Acked-by: Marc Zyngier <[email protected]>
Message-Id: <20230512233127[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
virt/kvm/kvm_main.c
This page took 0.053488 seconds and 4 git commands to generate.