[PATCH v5 0/5] KVM: nVMX: fix nested APICv emulation for windows guests

Maxim Levitsky posted 5 patches an hour ago
arch/x86/include/asm/kvm_host.h | 21 +++++---
arch/x86/kvm/regs.h             | 10 ++--
arch/x86/kvm/smm.c              |  8 +--
arch/x86/kvm/smm.h              |  2 +-
arch/x86/kvm/vmx/nested.c       | 93 +++++++++++++++++++++++----------
arch/x86/kvm/vmx/vmx.c          | 61 +++++++++++----------
arch/x86/kvm/vmx/vmx.h          |  2 -
arch/x86/kvm/x86.c              | 13 +++--
8 files changed, 127 insertions(+), 83 deletions(-)
[PATCH v5 0/5] KVM: nVMX: fix nested APICv emulation for windows guests
Posted by Maxim Levitsky an hour ago
Fix two problems that were recently discovered that cause nested APICv
to malfunction on windows with hyperv enabled.

The first problem is that unlike KVM, windows doesn't set PIR.ON when
sending posted interrupts. X86 spec actually allows this.

The second problem is that unlilke KVM, which mostly ignores them,
windows depends on accurate delivery of the posted notification
interrupts, and currently it is possible for a posted notification
to get lost it it arrives at the same time as the nested VM exit.

V2: to avoid spurious notification in L1, process the posted
notification in L2, just before VM exit.

V3: rework the patch series following the pseudocode that Paolo suggested
(Thanks!!)

V4: random fixes, including sashiko feedback.
V5: restore defered error handling on PID map failure.

Best regards,
	Maxim Levitsky

Maxim Levitsky (5):
  KVM: nVMX: don't check PID.ON when processing nested posted interrupts
  KVM: x86: split vcpu->arch.hflags into nested_guest_state and smm_mode
  KVM: x86: convert nested_guest_state into an atomic variable
  KVM: x86: nVMX: move nested APICv state to nested_guest_state
  KVM: x86: nVMX: fix races in delivery of nested posted interrupts

 arch/x86/include/asm/kvm_host.h | 21 +++++---
 arch/x86/kvm/regs.h             | 10 ++--
 arch/x86/kvm/smm.c              |  8 +--
 arch/x86/kvm/smm.h              |  2 +-
 arch/x86/kvm/vmx/nested.c       | 93 +++++++++++++++++++++++----------
 arch/x86/kvm/vmx/vmx.c          | 61 +++++++++++----------
 arch/x86/kvm/vmx/vmx.h          |  2 -
 arch/x86/kvm/x86.c              | 13 +++--
 8 files changed, 127 insertions(+), 83 deletions(-)

-- 
2.56.1