Skip to contentSkip to conversation

kvm: fix irq 0 assignment

PATCH In review Sheng Yang 1 participant 3 messages Mar 3, 2009 KVM

lore
Share & tools
lore

Sheng Yang

author
#0 lore raw

PATCH 1/1 kvm: fix irq 0 assignment

Shouldn't update assigned irq if host irq is 0, which means uninitialized or don't support INTx.

---
 qemu/hw/device-assignment.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
qemu/hw/device-assignment.c +4 -0
index b7cbcec..cfbf39d 100644
@@ -521,6 +521,10 @@ static int assign_irq(AssignedDevInfo *adev)
     AssignedDevice *dev = adev->assigned_dev;
     int irq, r = 0;
 
+    /* irq 0 means uninitialized */
+    if (dev->real_device.irq == 0)
+        return 0;
+
     irq = pci_map_irq(&dev->dev, dev->intpin);
     irq = piix_get_irq(irq);
 
Signature · 1 line
1.5.4.5
author
#1 lore raw
Quoted 2 lines · On Tuesday 03 March 2009 15:54:09 Sheng Yang wrote:

Shouldn't update assigned irq if host irq is 0, which means uninitialized or don't support INTx.

Withdraw this, another problems shows...

Signature · 2 lines
regards
Yang, Sheng
Quoted 20 lines
---
 qemu/hw/device-assignment.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
qemu/hw/device-assignment.c +4 -0
index b7cbcec..cfbf39d 100644
@@ -521,6 +521,10 @@ static int assign_irq(AssignedDevInfo *adev)
     AssignedDevice *dev = adev->assigned_dev;
     int irq, r = 0;
 
+    /* irq 0 means uninitialized */
+    if (dev->real_device.irq == 0)
+        return 0;
+
     irq = pci_map_irq(&dev->dev, dev->intpin);
     irq = piix_get_irq(irq);
author
#2 lore raw
Quoted 5 lines · On Tuesday 03 March 2009 17:32:13 Sheng Yang wrote:
Quoted 2 lines · On Tuesday 03 March 2009 15:54:09 Sheng Yang wrote:

Shouldn't update assigned irq if host irq is 0, which means uninitialized or don't support INTx.

Withdraw this, another problems shows...

This one itself is OK, seems the problem caused by kernel side...

Signature · 2 lines
regards
Yang, Sheng