Skip to content

Rework irq injection infrastructure

Avi Kivity kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7KVM: Generalize exception injection mechanismdrivers/kvm/svm.c drivers/kvm/vmx.c drivers/kvm/x86.c +1 more+86 -10 replies
2/7KVM: Replace page fault injection by the generalized exception queuedrivers/kvm/mmu.c drivers/kvm/svm.c drivers/kvm/vmx.c +2 more+19 -710 replies
3/7KVM: Replace #GP injection by the generalized exception queuedrivers/kvm/svm.c drivers/kvm/vmx.c drivers/kvm/x86.c +2 more+30 -590 replies
4/7KVM: Use generalized exception queue for injecting #UDdrivers/kvm/svm.c drivers/kvm/vmx.c+3 -200 replies
5/7KVM: Add explicit acks to interrupt controller modeldrivers/kvm/i8259.c drivers/kvm/irq.c drivers/kvm/irq.h +4 more+64 -660 replies
6/7KVM: Move tpr threshold calculation into common codedrivers/kvm/irq.c drivers/kvm/irq.h drivers/kvm/kvm_main.c +3 more+31 -250 replies
7/7KVM: Ack interrupts only after they have successfully been injecteddrivers/kvm/svm.c drivers/kvm/vmx.c drivers/kvm/x86.c +1 more+103 -2370 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/7] Rework irq injection infrastructure

The current irq and exception injection infrastructure is quite complex and has been the source of a number of bugs in the past. This patchset simplifies irq and exception injection:

- Much more work is carried out in common code rather than vmx/svm specific code. Information is kept in C variables rather than hardware registers

- Exception and interrupts are separated into two independent queues. This will allow later optimization on AMD where the hardware supports two queues, and also simplifies the Intel case as now we don't need to check the hardware whether an exception is pending when injecting and interrupt.

- Interrupts are now only acked after they have been successfully injected, rather than when the injection is attempted. This significantly simplifies the case where we fail to inject an interrupt due to a shadow page fault.

The patchset is also necessary for integrating the tpr optimization branch and for injecting interrupts in big real mode.

 drivers/kvm/i8259.c       |   44 ++++++----
 drivers/kvm/irq.c         |   40 ++-------
 drivers/kvm/irq.h         |   17 +++-
 drivers/kvm/kvm_main.c    |    4 +-
 drivers/kvm/lapic.c       |   33 +++++--
 drivers/kvm/mmu.c         |    2 +-
 drivers/kvm/svm.c         |  175 ++++++++------------------------------
 drivers/kvm/vmx.c         |  207 ++++++++-------------------------------------
 drivers/kvm/x86.c         |  164 ++++++++++++++++++++++++++----------
 drivers/kvm/x86.h         |   35 ++++++--
 drivers/kvm/x86_emulate.c |    4 +-
 11 files changed, 291 insertions(+), 434 deletions(-)

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4