public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pci-assign: Fix transition MSI->INTx
@ 2011-01-04 21:04 Jan Kiszka
  2011-01-06 13:40 ` Avi Kivity
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jan Kiszka @ 2011-01-04 21:04 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti; +Cc: kvm

From: Jan Kiszka <jan.kiszka@siemens.com>

Make sure to re-register the IRQ of an assigned device as INTx when the
guest disables MSI[X] mode again.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/device-assignment.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/hw/device-assignment.c b/hw/device-assignment.c
index f6410f8..fce7567 100644
--- a/hw/device-assignment.c
+++ b/hw/device-assignment.c
@@ -1192,7 +1192,10 @@ static void assigned_dev_update_msi(PCIDevice *pci_dev, unsigned int ctrl_pos)
         if (kvm_assign_irq(kvm_context, &assigned_irq_data) < 0)
             perror("assigned_dev_enable_msi: assign irq");
 
+        assigned_dev->girq = -1;
         assigned_dev->irq_requested_type = assigned_irq_data.flags;
+    } else {
+        assign_irq(assigned_dev);
     }
 }
 #endif
@@ -1332,7 +1335,10 @@ static void assigned_dev_update_msix(PCIDevice *pci_dev, unsigned int ctrl_pos)
             perror("assigned_dev_enable_msix: assign irq");
             return;
         }
+        assigned_dev->girq = -1;
         assigned_dev->irq_requested_type = assigned_irq_data.flags;
+    } else {
+        assign_irq(assigned_dev);
     }
 }
 #endif
-- 
1.7.1

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

end of thread, other threads:[~2011-01-07 11:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-04 21:04 [PATCH] pci-assign: Fix transition MSI->INTx Jan Kiszka
2011-01-06 13:40 ` Avi Kivity
2011-01-06 13:51   ` Alex Williamson
2011-01-06 14:23 ` Michael S. Tsirkin
2011-01-07  9:59 ` Marcelo Tosatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox