mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] KVM: nVMX: fix nested APICv emulation for windows guests
@ 2026-10-11  0:13 Maxim Levitsky
  2026-10-11  0:13 ` [PATCH v2 1/2] KVM: nVMX: don't check PIR.ON when processing nested posted interrupts Maxim Levitsky
  2026-10-11  0:13 ` [PATCH v2 2/2] KVM: nVMX: avoid losing the posted notification interrupt when exiting L2 Maxim Levitsky
  0 siblings, 2 replies; 3+ messages in thread
From: Maxim Levitsky @ 2026-10-11  0:13 UTC (permalink / raw)
  To: kvm; +Cc: Sean Christopherson, x86, linux-kernel, Paolo Bonzini, Maxim Levitsky

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.

PS: I am not 100% sure if I got the barriers right, plus I am not sure
about what to do if vmx_complete_nested_posted_interrupt can't write
to the nested PIR, in this it calls kvm_handle_memory_failure, and
I don't know 100% its interactions with nested VM exit.

Best regards,
	Maxim Levitsky

Maxim Levitsky (2):
  KVM: nVMX: don't check PIR.ON when processing nested posted interrupts
  KVM: nVMX: avoid losing the posted notification interrupt when exiting
    L2

 arch/x86/kvm/vmx/nested.c | 22 ++++++++++++++++++----
 arch/x86/kvm/vmx/vmx.c    |  5 +++++
 2 files changed, 23 insertions(+), 4 deletions(-)

-- 
2.54.0



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

end of thread, other threads:[~2026-10-11  0:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-11  0:13 [PATCH v2 0/2] KVM: nVMX: fix nested APICv emulation for windows guests Maxim Levitsky
2026-10-11  0:13 ` [PATCH v2 1/2] KVM: nVMX: don't check PIR.ON when processing nested posted interrupts Maxim Levitsky
2026-10-11  0:13 ` [PATCH v2 2/2] KVM: nVMX: avoid losing the posted notification interrupt when exiting L2 Maxim Levitsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®