All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	avi@redhat.com
Subject: Re: [PATCHv3 RFC 0/2] kvm: direct msix injection
Date: Mon, 9 Jul 2012 01:55:25 +0300	[thread overview]
Message-ID: <20120708225525.GA26193@redhat.com> (raw)
In-Reply-To: <1341248900.1207.452.camel@bling.home>

On Mon, Jul 02, 2012 at 11:08:20AM -0600, Alex Williamson wrote:
> On Mon, 2012-06-25 at 11:32 +0200, Jan Kiszka wrote:
> > On 2012-06-11 13:19, Michael S. Tsirkin wrote:
> > > We can deliver certain interrupts, notably MSIX,
> > > from atomic context.
> > > Here's an untested patch to do this (compiled only).
> > > 
> > > Changes from v2:
> > > Don't inject broadcast interrupts directly
> > > Changes from v1:
> > > Tried to address comments from v1, except unifying
> > > with kvm_set_irq: passing flags to it looks too ugly.
> > > Added a comment.
> > > 
> > > Jan, you said you can test this?
> > > 
> > > 
> > > Michael S. Tsirkin (2):
> > >   kvm: implement kvm_set_msi_inatomic
> > >   kvm: deliver msix interrupts from irq handler
> > > 
> > >  include/linux/kvm_host.h |  3 ++
> > >  virt/kvm/assigned-dev.c  | 31 ++++++++++++++++++--
> > >  virt/kvm/irq_comm.c      | 75 ++++++++++++++++++++++++++++++++++++++++++++----
> > >  3 files changed, 102 insertions(+), 7 deletions(-)
> > > 
> > 
> > Finally-tested-by: Jan Kiszka <jan.kiszka@siemens.com>
> 
> Michael, we need either this or the simple oneshot patch to get device
> assignment working again for 3.5.  Are you planning to push this for
> 3.5?  Thanks,
> 
> Alex
> 

Avi wants this reworked using an injection cache. I agree with Jan
though: oneshot looks too ugly. Just so you can make progress, can't we
add a stub handler returning IRQ_WAKE_THREAD unconditionally for now?
I.e. like the below (warning: completely untested).

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

--

diff --git a/virt/kvm/assigned-dev.c b/virt/kvm/assigned-dev.c
index b1e091a..18cc36e 100644
--- a/virt/kvm/assigned-dev.c
+++ b/virt/kvm/assigned-dev.c
@@ -334,6 +334,11 @@ static int assigned_device_enable_host_intx(struct kvm *kvm,
 }
 
 #ifdef __KVM_HAVE_MSI
+static irqreturn_t kvm_assigned_dev_msi(int irq, void *dev_id)
+{
+       return IRQ_WAKE_THREAD;
+}
+
 static int assigned_device_enable_host_msi(struct kvm *kvm,
 					   struct kvm_assigned_dev_kernel *dev)
 {
@@ -346,7 +351,7 @@ static int assigned_device_enable_host_msi(struct kvm *kvm,
 	}
 
 	dev->host_irq = dev->dev->irq;
-	if (request_threaded_irq(dev->host_irq, NULL,
+	if (request_threaded_irq(dev->host_irq, kvm_assigned_dev_msi,
 				 kvm_assigned_dev_thread_msi, 0,
 				 dev->irq_name, dev)) {
 		pci_disable_msi(dev->dev);
@@ -358,6 +363,11 @@ static int assigned_device_enable_host_msi(struct kvm *kvm,
 #endif
 
 #ifdef __KVM_HAVE_MSIX
+static irqreturn_t kvm_assigned_dev_msix(int irq, void *dev_id)
+{
+       return IRQ_WAKE_THREAD;
+}
+
 static int assigned_device_enable_host_msix(struct kvm *kvm,
 					    struct kvm_assigned_dev_kernel *dev)
 {
@@ -374,7 +384,8 @@ static int assigned_device_enable_host_msix(struct kvm *kvm,
 
 	for (i = 0; i < dev->entries_nr; i++) {
 		r = request_threaded_irq(dev->host_msix_entries[i].vector,
-					 NULL, kvm_assigned_dev_thread_msix,
+					 kvm_assigned_dev_msix,
+					 kvm_assigned_dev_thread_msix,
 					 0, dev->irq_name, dev);
 		if (r)
 			goto err;
-- 
MST

  parent reply	other threads:[~2012-07-08 22:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-11 11:19 [PATCHv3 RFC 0/2] kvm: direct msix injection Michael S. Tsirkin
2012-06-11 11:19 ` [PATCHv3 RFC 1/2] kvm: implement kvm_set_msi_inatomic Michael S. Tsirkin
2012-06-13 13:01   ` Gleb Natapov
2012-06-13 15:59     ` Michael S. Tsirkin
2012-06-13 16:01       ` Gleb Natapov
2012-06-13 16:12         ` Michael S. Tsirkin
2012-06-14  7:00           ` Gleb Natapov
2012-06-11 11:19 ` [PATCHv3 RFC 2/2] kvm: deliver msix interrupts from irq handler Michael S. Tsirkin
2012-06-12 23:07 ` [PATCHv3 RFC 0/2] kvm: direct msix injection Marcelo Tosatti
2012-06-13  8:39   ` Michael S. Tsirkin
2012-06-13 14:14   ` Avi Kivity
2012-06-25  9:32 ` Jan Kiszka
2012-07-02 17:08   ` Alex Williamson
2012-07-06  3:01     ` Hao, Xudong
2012-07-08 22:55     ` Michael S. Tsirkin [this message]
2012-07-09 15:32       ` Jan Kiszka
2012-07-09 15:49         ` Alex Williamson

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=20120708225525.GA26193@redhat.com \
    --to=mst@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.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.