All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suresh Warrier <warrier@linux.vnet.ibm.com>
To: kvm@vger.kernel.org, linuxppc-dev@ozlabs.org
Cc: warrier@linux.vnet.ibm.com, paulus@samba.org, agraf@suse.de,
	mpe@ellerman.id.au
Subject: [PATCH 00/14] PCI Passthrough Interrupt Optimizations
Date: Fri, 26 Feb 2016 12:40:18 -0600	[thread overview]
Message-ID: <1456512032-31286-1-git-send-email-warrier@linux.vnet.ibm.com> (raw)

This patch set adds support for handling interrupts for PCI adapters
entirely in the guest under the right conditions. When an interrupt
is received by KVM in real mode, if the interrupt is from a PCI
passthrough adapter owned by the guest, KVM will update the virtual
ICP for the VCPU that is the target of the interrupt entirely in
real mode and generate the virtual interrupt. If the VCPU is not
running in the guest, it will wake up the VCPU.  It will also update
the affinity of the interrupt to directly target the CPU (core)
where this VCPU is being scheduled as an optimization. 

KVM needs the mapping between hardware interrupt numbers in the host
to the virtual hardware interrupt (GSI) that needs to get injected
into the guest. This patch set takes advantage of the IRQ bypass
manager feature to create this mapping. For now, we allocate and
manage a separate mapping structure per VM.

Although a mapping is created for every passthrough IRQ requested
in the guest, we also maintain a cache of mappings that is used to
speed up search. For now, KVM real mode code only looks in the cache for
a mapping. If no mapping is found, we fall back on the usual interrupt
routing mechanism - switch back to host and run the VFIO interrupt
handler.

This is based on 4.5-rc1 plus the patch set in
http://www.spinics.net/lists/kvm-ppc/msg11131.html since it has
dependencies on vmalloc_to_phys() being public.

Suresh Warrier (14):
  powerpc: Add simple cache inhibited MMIO accessors
  KVM: PPC: Book3S HV: Convert kvmppc_read_intr to a C function
  KVM: PPC: select IRQ_BYPASS_MANAGER
  KVM: PPC: Book3S HV: Introduce kvmppc_passthru_irqmap
  KVM: PPC: Book3S HV: Enable IRQ bypass
  KVM: PPC: Book3S HV: Caching for passthrough IRQ map
  KVM: PPC: Book3S HV: Handle passthrough interrupts in guest
  KVM: PPC: Book3S HV: Complete passthrough interrupt in host
  KVM: PPC: Book3S HV: Enable KVM real mode handling of passthrough IRQs
  KVM: PPC: Book3S HV: Dump irqmap in debugfs
  KVM: PPC: Book3S HV: Tunable to disable KVM IRQ bypass
  KVM: PPC: Book3S HV: Update irq stats for IRQs handled in real mode
  KVM: PPC: Book3S HV: Change affinity for passthrough IRQ
  KVM: PPC: Book3S HV: Counters for passthrough IRQ stats

 arch/powerpc/include/asm/io.h             |  28 +++
 arch/powerpc/include/asm/kvm_asm.h        |  10 +
 arch/powerpc/include/asm/kvm_book3s.h     |   1 +
 arch/powerpc/include/asm/kvm_host.h       |  25 +++
 arch/powerpc/include/asm/kvm_ppc.h        |  28 +++
 arch/powerpc/include/asm/pnv-pci.h        |   1 +
 arch/powerpc/kvm/Kconfig                  |   2 +
 arch/powerpc/kvm/book3s.c                 |  45 +++++
 arch/powerpc/kvm/book3s_hv.c              | 318 +++++++++++++++++++++++++++++-
 arch/powerpc/kvm/book3s_hv_builtin.c      | 157 +++++++++++++++
 arch/powerpc/kvm/book3s_hv_rm_xics.c      | 181 +++++++++++++++++
 arch/powerpc/kvm/book3s_hv_rmhandlers.S   | 226 ++++++++++++---------
 arch/powerpc/kvm/book3s_xics.c            |  68 ++++++-
 arch/powerpc/kvm/book3s_xics.h            |   3 +
 arch/powerpc/platforms/powernv/pci-ioda.c |  14 +-
 15 files changed, 1013 insertions(+), 94 deletions(-)

-- 
1.8.3.4


             reply	other threads:[~2016-02-26 18:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26 18:40 Suresh Warrier [this message]
2016-02-26 18:40 ` [PATCH 01/14] powerpc: Add simple cache inhibited MMIO accessors Suresh Warrier
2016-02-26 18:40 ` [PATCH 02/14] KVM: PPC: Book3S HV: Convert kvmppc_read_intr to a C function Suresh Warrier
2016-02-26 18:40 ` [PATCH 03/14] KVM: PPC: select IRQ_BYPASS_MANAGER Suresh Warrier
2016-02-26 18:40 ` [PATCH 04/14] KVM: PPC: Book3S HV: Introduce kvmppc_passthru_irqmap Suresh Warrier
2016-02-26 18:40 ` [PATCH 05/14] KVM: PPC: Book3S HV: Enable IRQ bypass Suresh Warrier
2016-02-26 18:40 ` [PATCH 06/14] KVM: PPC: Book3S HV: Caching for passthrough IRQ map Suresh Warrier
2016-02-26 18:40 ` [PATCH 07/14] KVM: PPC: Book3S HV: Handle passthrough interrupts in guest Suresh Warrier
2016-02-26 18:40 ` [PATCH 08/14] KVM: PPC: Book3S HV: Complete passthrough interrupt in host Suresh Warrier
2016-02-26 18:40 ` [PATCH 09/14] KVM: PPC: Book3S HV: Enable KVM real mode handling of passthrough IRQs Suresh Warrier
2016-02-26 18:40 ` [PATCH 10/14] KVM: PPC: Book3S HV: Dump irqmap in debugfs Suresh Warrier
2016-02-26 18:40 ` [PATCH 11/14] KVM: PPC: Book3S HV: Tunable to disable KVM IRQ bypass Suresh Warrier
2016-02-26 18:40 ` [PATCH 12/14] KVM: PPC: Book3S HV: Update irq stats for IRQs handled in real mode Suresh Warrier
2016-02-26 18:40 ` [PATCH 13/14] KVM: PPC: Book3S HV: Change affinity for passthrough IRQ Suresh Warrier
2016-02-26 18:40 ` [PATCH 14/14] KVM: PPC: Book3S HV: Counters for passthrough IRQ stats Suresh Warrier
2016-02-26 18:49 ` [PATCH 00/14] KVM: PPC: Book3S HV: PCI Passthrough Interrupt Optimizations Suresh E. Warrier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1456512032-31286-1-git-send-email-warrier@linux.vnet.ibm.com \
    --to=warrier@linux.vnet.ibm.com \
    --cc=agraf@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.