Skip to content

Nonatomic interrupt injection

Avi Kivity kvm 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest5 patches 14 repliesIn review
  2. v46 patches 7 repliesSuperseded
  3. v23 patches 4 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches0 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5KVM: Check for pending events before attempting injectionarch/x86/kvm/i8259.c arch/x86/kvm/lapic.c arch/x86/kvm/svm.c +3 more+58 -1214 replies
2/5KVM: VMX: Split up vmx_complete_interrupts()arch/x86/kvm/vmx.c+27 -120 replies
3/5KVM: VMX: Move real-mode interrupt injection fixup to vmx_complete_interrupts()arch/x86/kvm/vmx.c+6 -30 replies
4/5KVM: VMX: Parameterize vmx_complete_interrupts() for both exit and entryarch/x86/kvm/vmx.c+21 -130 replies
5/5KVM: Non-atomic interrupt injectionarch/x86/include/asm/kvm_host.h arch/x86/kvm/svm.c arch/x86/kvm/vmx.c +1 more+40 -200 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH v5 0/5] Nonatomic interrupt injection

This patchset changes interrupt injection to be done from normal process context instead of interrupts disabled context. This is useful for real mode interrupt injection on Intel without the current hacks (injecting as a software interrupt of a vm86 task), reducing latencies, and later, for allowing nested virtualization code to use kvm_read_guest()/kvm_write_guest() instead of kmap() to access the guest vmcb/vmcs.

Seems to survive a hack that cancels every 16th entry, after injection has already taken place.

With the PIC reset fix posted earlier, this passes autotest on both AMD and Intel, with in-kernel irqchip. I'll run -no-kvm-irqchip tests shortly.

Please review carefully, esp. the first patch. Any missing kvm_make_request() there may result in a hung guest.

v5: add KVM_REQ_EVENT to KVM_INTERRUPT path
change first patch to sample KVM_REQ_EVENT before checking vcpu->requests
for the entry abort path; improves bisectability (noticed by Gleb)

v4: add KVM_REQ_EVENT after lapic restore

v3: close new race between injection and entry
fix Intel real-mode injection cancellation

v2: svm support (easier than expected)
fix silly vmx warning

Avi Kivity (5):
KVM: Check for pending events before attempting injection
KVM: VMX: Split up vmx_complete_interrupts()
KVM: VMX: Move real-mode interrupt injection fixup to
vmx_complete_interrupts()
KVM: VMX: Parameterize vmx_complete_interrupts() for both exit and
entry
KVM: Non-atomic interrupt injection

 arch/x86/include/asm/kvm_host.h |    1 +
 arch/x86/kvm/i8259.c            |    1 +
 arch/x86/kvm/lapic.c            |   13 +++++-
 arch/x86/kvm/svm.c              |   20 ++++++++-
 arch/x86/kvm/vmx.c              |   87 +++++++++++++++++++++++++++++----------
 arch/x86/kvm/x86.c              |   45 ++++++++++++++------
 include/linux/kvm_host.h        |    1 +
 7 files changed, 130 insertions(+), 38 deletions(-)