From: Jan Kiszka <jan.kiszka@web.de>
To: Thomas Gleixner <tglx@linutronix.de>, Avi Kivity <avi@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>
Cc: linux-kernel@vger.kernel.org, kvm <kvm@vger.kernel.org>,
Tom Lyon <pugs@cisco.com>,
Alex Williamson <alex.williamson@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: [PATCH v2 0/4] KVM & genirq: Enable adaptive IRQ sharing for passed-through devices
Date: Sun, 12 Dec 2010 12:22:40 +0100 [thread overview]
Message-ID: <cover.1292152963.git.jan.kiszka@web.de> (raw)
Second try to allow adaptive interrupt handlers according to the line's
current sharing situation. This one converts the explicit notifier
interface into several extension of existing genirq APIs:
- introduce a interrupt status word that can be read by interrupt
handlers to obtain the current line sharing state
- introduce IRQF_ADAPTIVE: handlers registered with this flag will be
informed about an upcoming line sharing by calling the interrupt
handler itself (instead of a notifier callback)
- introduce IRQF_COND_ONESHOT: IRQF_ONESHOT semantics if the line is
not shared, standard semantics otherwise (removes the need to
re-register handlers to switch between IRQF_SHARED and IRQF_ONESHOT)
The result may look simpler on first glance than v1, but it comes with
more subtle race scenarios IMO. I thought them through, hopefully
catching all, but I would appreciate any skeptical review.
I also tried to replace line-level disabling from the interrupt handler
with signaling genirq to keep the line masked on handler return.
However, I finally dropped this idea as it turns out to be very hard (if
not impossible) to properly synchronize the generic tail (in genirq)
with the driver that may want to re-enable the line at the same time
(depending on the driver's internal state). But if anyone sees a
magically simple way to achieve this, I'm still all ears.
Finally, the last patch in this series makes use of the new interface
for KVM's PCI pass-through subsystem. KVM has to keep the interrupt
source disabled while calling into the guest to handle the event. This
can be done at device or line level. The former is required to share the
interrupt line, the latter is an order of magnitude faster.
Beside pass-through support of KVM, further users of this new interface
could become VFIO (not yet mainline) and uio_pci_generic which have to
resolve the same conflict.
Note: The KVM patch depends on
http://thread.gmane.org/gmane.comp.emulators.kvm.devel/64515
Jan Kiszka (4):
genirq: Introduce driver-readable IRQ status word
genirq: Inform handler about line sharing state
genirq: Add support for IRQF_COND_ONESHOT
KVM: Allow host IRQ sharing for passed-through PCI 2.3 devices
Documentation/kvm/api.txt | 27 ++++
arch/x86/kvm/x86.c | 1 +
include/linux/interrupt.h | 15 ++
include/linux/irq.h | 2 +
include/linux/irqdesc.h | 2 +
include/linux/kvm.h | 6 +
include/linux/kvm_host.h | 10 ++-
kernel/irq/irqdesc.c | 2 +
kernel/irq/manage.c | 74 ++++++++++-
virt/kvm/assigned-dev.c | 336 ++++++++++++++++++++++++++++++++++++++++-----
10 files changed, 437 insertions(+), 38 deletions(-)
next reply other threads:[~2010-12-12 11:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-12 11:22 Jan Kiszka [this message]
2010-12-12 11:22 ` [PATCH v2 1/4] genirq: Introduce driver-readable IRQ status word Jan Kiszka
2010-12-12 17:29 ` Thomas Gleixner
2010-12-12 21:51 ` Jan Kiszka
2010-12-13 8:17 ` Thomas Gleixner
2010-12-12 11:22 ` [PATCH v2 2/4] genirq: Inform handler about line sharing state Jan Kiszka
2010-12-12 16:53 ` Thomas Gleixner
2010-12-12 21:49 ` Jan Kiszka
2010-12-12 11:22 ` [PATCH v2 3/4] genirq: Add support for IRQF_COND_ONESHOT Jan Kiszka
2010-12-12 11:22 ` [PATCH v2 4/4] KVM: Allow host IRQ sharing for passed-through PCI 2.3 devices Jan Kiszka
2010-12-13 10:19 ` Avi Kivity
2010-12-13 10:10 ` [PATCH v2 0/4] KVM & genirq: Enable adaptive IRQ sharing for passed-through devices Michael S. Tsirkin
2010-12-13 22:59 ` Jan Kiszka
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=cover.1292152963.git.jan.kiszka@web.de \
--to=jan.kiszka@web.de \
--cc=alex.williamson@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pugs@cisco.com \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox