[Devel] [PATCH vz9 0/9] x86/reboot/KVM: Avoid crashing L2 VMs on start after L1 VM reset

Konstantin Khorenko khorenko at virtuozzo.com
Wed Nov 1 16:38:47 MSK 2023


Without this patchset applied to the L1 VM kernel
L2 VMs may crash on boot in case L1 VM is reset using following command:
  # echo b > /proc/sysrq-trigger

Following message appeared in the L2 VM log:
  KVM: entry failed, hardware error 0x80000021

https://pmc.acronis.work/browse/VSTOR-76102

Note: all patches except "(x86/reboot: VMCLEAR active VMCSes before
emergency reboot") are present in the latest CentOS 9 Stream kernel
5.14.0-381.el9, so they are to be dropped during future rebases vz9
kernel onto new RHEL9 kernels for sure.

The issue had been reported to RedHat as well:
https://issues.redhat.com/browse/RHEL-14437


Maxim Levitsky (8):
  ms/x86/crash: Disable virt in core NMI crash handler to avoid double
    shootdown
  ms/x86/virt: Force GIF=1 prior to disabling SVM (for reboot flows)
  ms/x86/reboot: Disable virtualization in an emergency if SVM is
    supported
  ms/x86/reboot: Disable SVM, not just VMX, when stopping CPUs
  ms/KVM: VMX: Reset eVMCS controls in VP assist page during hardware
    disabling
  ms/KVM: VMX: Don't bother disabling eVMCS static key on module exit
  ms/KVM: x86: Move guts of kvm_arch_init() to standalone helper
  ms/KVM: VMX: Do _all_ initialization before exposing /dev/kvm to
    userspace

Sean Christopherson (1):
  ms/x86/reboot: VMCLEAR active VMCSes before emergency reboot

 arch/x86/include/asm/kexec.h    |   2 -
 arch/x86/include/asm/kvm_host.h |   3 +
 arch/x86/include/asm/reboot.h   |   4 ++
 arch/x86/include/asm/virtext.h  |  16 ++++-
 arch/x86/kernel/crash.c         |  48 +-------------
 arch/x86/kernel/reboot.c        | 110 +++++++++++++++++++++++++-------
 arch/x86/kernel/smp.c           |   6 +-
 arch/x86/kvm/svm/svm.c          |  23 ++++++-
 arch/x86/kvm/vmx/vmx.c          | 101 +++++++++++++++++------------
 arch/x86/kvm/x86.c              |  15 ++++-
 10 files changed, 206 insertions(+), 122 deletions(-)

-- 
2.39.3



More information about the Devel mailing list