All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] KVM: nested virt SMM fixes
@ 2017-09-13 14:06 Ladi Prosek
  2017-09-13 14:06 ` [PATCH 1/5] KVM: x86: introduce ISA specific SMM entry/exit callbacks Ladi Prosek
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Ladi Prosek @ 2017-09-13 14:06 UTC (permalink / raw)
  To: kvm; +Cc: rkrcmar

Windows Server 2016 with Hyper-V enabled fails to boot on OVMF with SMM
(OVMF_CODE-need-smm.fd). Turns out that the SMM emulation code in KVM
does not handle nested virtualization very well, leading to a whole bunch
of issues.

For example, Hyper-V uses descriptor table exiting (SECONDARY_EXEC_DESC)
so when the SMM handler tries to switch from real mode a VM exit occurs
and is forwarded to a clueless L1.

This series fixes it by switching the vcpu to !guest_mode, i.e. to the L1
state, before entering SMM and then switching back to L2 after the RSM
instruction is emulated.

Patch 1 is common for both Intel and AMD, patch 2 fixes Intel, and
patches 4-5 AMD. Patch 3 adds more state to the SMRAM save area as
prescribed by the Intel SDM. It is however not required to make Windows
work.

Ladi Prosek (5):
      KVM: x86: introduce ISA specific SMM entry/exit callbacks
      KVM: nVMX: fix SMI injection in guest mode
      KVM: nVMX: save nested EPT information in SMRAM state save map
      KVM: nSVM: refactor nested_svm_vmrun
      KVM: nSVM: fix SMI injection in guest mode

 arch/x86/include/asm/kvm_emulate.h |   1 +
 arch/x86/include/asm/kvm_host.h    |   8 ++
 arch/x86/kvm/emulate.c             |   2 +
 arch/x86/kvm/svm.c                 | 180 ++++++++++++++++++++++++-------------
 arch/x86/kvm/vmx.c                 |  82 +++++++++++++++--
 arch/x86/kvm/x86.c                 |   9 +-
 6 files changed, 207 insertions(+), 75 deletions(-)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-09-14  9:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-13 14:06 [PATCH 0/5] KVM: nested virt SMM fixes Ladi Prosek
2017-09-13 14:06 ` [PATCH 1/5] KVM: x86: introduce ISA specific SMM entry/exit callbacks Ladi Prosek
2017-09-13 21:44   ` Paolo Bonzini
2017-09-14  7:14     ` Ladi Prosek
2017-09-14  9:47       ` Paolo Bonzini
2017-09-13 14:06 ` [PATCH 2/5] KVM: nVMX: fix SMI injection in guest mode Ladi Prosek
2017-09-13 14:06 ` [PATCH 3/5] KVM: nVMX: save nested EPT information in SMRAM state save map Ladi Prosek
2017-09-13 14:06 ` [PATCH 4/5] KVM: nSVM: refactor nested_svm_vmrun Ladi Prosek
2017-09-13 14:06 ` [PATCH 5/5] KVM: nSVM: fix SMI injection in guest mode Ladi Prosek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.