On Fri, 21 Jul 2023 13:18:40 -0700, Sean Christopherson wrote: > If there are no objections, my plan is to take this through the KVM tree > for 6.6. > > Instead of having the reboot code blindly try to disable virtualization > during an emergency, use the existing callback into KVM to disable virt > as "needed". In quotes because KVM still somewhat blindly attempts to > disable virt, e.g. if KVM is loaded but doesn't have active VMs and thus > hasn't enabled hardware. That could theoretically be "fixed", but due to > the callback being invoked from NMI context, I'm not convinced it would > be worth the complexity. E.g. false positives would still be possible, > and KVM would have to play games with the per-CPU hardware_enabled flag > to ensure there are no false negatives. > > [...] Applied to kvm-x86 misc, thanks! [01/19] x86/reboot: VMCLEAR active VMCSes before emergency reboot https://github.com/kvm-x86/linux/commit/b23c83ad2c63 [02/19] x86/reboot: Harden virtualization hooks for emergency reboot https://github.com/kvm-x86/linux/commit/5e408396c60c [03/19] x86/reboot: KVM: Handle VMXOFF in KVM's reboot callback https://github.com/kvm-x86/linux/commit/119b5cb4ffd0 [04/19] x86/reboot: KVM: Disable SVM during reboot via virt/KVM reboot callback https://github.com/kvm-x86/linux/commit/baeb4de7ad12 [05/19] x86/reboot: Assert that IRQs are disabled when turning off virtualization https://github.com/kvm-x86/linux/commit/ad93c1a7c010 [06/19] x86/reboot: Hoist "disable virt" helpers above "emergency reboot" path https://github.com/kvm-x86/linux/commit/edc8deb087d8 [07/19] x86/reboot: Disable virtualization during reboot iff callback is registered https://github.com/kvm-x86/linux/commit/59765db5fc82 [08/19] x86/reboot: Expose VMCS crash hooks if and only if KVM_{INTEL,AMD} is enabled https://github.com/kvm-x86/linux/commit/261cd5ed934e [09/19] x86/virt: KVM: Open code cpu_has_vmx() in KVM VMX https://github.com/kvm-x86/linux/commit/b6a6af0d19ce [10/19] x86/virt: KVM: Move VMXOFF helpers into KVM VMX https://github.com/kvm-x86/linux/commit/22e420e12739 [11/19] KVM: SVM: Make KVM_AMD depend on CPU_SUP_AMD or CPU_SUP_HYGON https://github.com/kvm-x86/linux/commit/554856b69e3d [12/19] x86/virt: Drop unnecessary check on extended CPUID level in cpu_has_svm() https://github.com/kvm-x86/linux/commit/5df8ecfe3632 [13/19] x86/virt: KVM: Open code cpu_has_svm() into kvm_is_svm_supported() https://github.com/kvm-x86/linux/commit/85fd29dd5fe4 [14/19] KVM: SVM: Check that the current CPU supports SVM in kvm_is_svm_supported() https://github.com/kvm-x86/linux/commit/c4db4f20f3bf [15/19] KVM: VMX: Ensure CPU is stable when probing basic VMX support https://github.com/kvm-x86/linux/commit/f9a8866040fc [16/19] x86/virt: KVM: Move "disable SVM" helper into KVM SVM https://github.com/kvm-x86/linux/commit/76ab8161083b [17/19] KVM: x86: Force kvm_rebooting=true during emergency reboot/crash https://github.com/kvm-x86/linux/commit/6ae44e012f4c [18/19] KVM: SVM: Use "standard" stgi() helper when disabling SVM https://github.com/kvm-x86/linux/commit/2e6b9bd49b70 [19/19] KVM: VMX: Skip VMCLEAR logic during emergency reboots if CR4.VMXE=0 https://github.com/kvm-x86/linux/commit/a788fbb763b5 -- https://github.com/kvm-x86/linux/tree/next https://github.com/kvm-x86/linux/tree/fixes