All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvm: Fix device assignment threaded irq handler
@ 2012-07-09 16:53 Alex Williamson
  2012-07-11  9:56 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Williamson @ 2012-07-09 16:53 UTC (permalink / raw)
  To: avi, mtosatti, mst; +Cc: kvm, linux-kernel, jan.kiszka

The kernel no longer allows us to pass NULL for the hard handler
without also specifying IRQF_ONESHOT.  IRQF_ONESHOT imposes latency
in the exit path that we don't need for MSI interrupts.  Long term
we'd like to inject these interrupts from the hard handler when
possible.  In the short term, we can create dummy hard handlers
that return us to the previous behavior.  Credit to Michael for
original patch.

Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=43328

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---

Patch against kvm/master for v3.5

 virt/kvm/assigned-dev.c |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/virt/kvm/assigned-dev.c b/virt/kvm/assigned-dev.c
index b1e091a..23a41a9 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;


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kvm: Fix device assignment threaded irq handler
  2012-07-09 16:53 [PATCH] kvm: Fix device assignment threaded irq handler Alex Williamson
@ 2012-07-11  9:56 ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2012-07-11  9:56 UTC (permalink / raw)
  To: Alex Williamson; +Cc: mtosatti, mst, kvm, linux-kernel, jan.kiszka

On 07/09/2012 07:53 PM, Alex Williamson wrote:
> The kernel no longer allows us to pass NULL for the hard handler
> without also specifying IRQF_ONESHOT.  IRQF_ONESHOT imposes latency
> in the exit path that we don't need for MSI interrupts.  Long term
> we'd like to inject these interrupts from the hard handler when
> possible.  In the short term, we can create dummy hard handlers
> that return us to the previous behavior.  Credit to Michael for
> original patch.
> 
> Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=43328
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> ---
> 
> Patch against kvm/master for v3.5
> 


Thanks, queued for 3.5.


-- 
error compiling committee.c: too many arguments to function



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-11  9:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-09 16:53 [PATCH] kvm: Fix device assignment threaded irq handler Alex Williamson
2012-07-11  9:56 ` Avi Kivity

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.