[PATCH 3/3] virtio/pci: Use consistent naming for the PCI ISR bit flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Avoid using VIRTIO_IRQ_{HIGH,LOW} which belong to a different
namespace.  Instead define VIRTIO_PCI_ISR_QUEUE as a logical extension
of the VIRTIO_PCI_ISR_* namespace. Since this bit flag is missing from
a header imported verbatim from Linux, define it directly in pci.c.

Signed-off-by: Keir Fraser <keirf@xxxxxxxxxx>
---
 virtio/pci-legacy.c | 2 +-
 virtio/pci.c        | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/virtio/pci-legacy.c b/virtio/pci-legacy.c
index 5804796..02a8f8c 100644
--- a/virtio/pci-legacy.c
+++ b/virtio/pci-legacy.c
@@ -61,7 +61,7 @@ static bool virtio_pci__data_in(struct kvm_cpu *vcpu, struct virtio_device *vdev
 	case VIRTIO_PCI_ISR:
 		ioport__write8(data, vpci->isr);
 		kvm__irq_line(kvm, vpci->legacy_irq_line, VIRTIO_IRQ_LOW);
-		vpci->isr = VIRTIO_IRQ_LOW;
+		vpci->isr = 0;
 		break;
 	default:
 		ret = virtio_pci__specific_data_in(kvm, vdev, data, size, offset);
diff --git a/virtio/pci.c b/virtio/pci.c
index 74bc9a4..8a34cec 100644
--- a/virtio/pci.c
+++ b/virtio/pci.c
@@ -14,6 +14,9 @@
 #include <assert.h>
 #include <string.h>
 
+/* The bit of the ISR which indicates a queue change. */
+#define VIRTIO_PCI_ISR_QUEUE	0x1
+
 int virtio_pci__add_msix_route(struct virtio_pci *vpci, u32 vec)
 {
 	int gsi;
@@ -239,7 +242,7 @@ int virtio_pci__signal_vq(struct kvm *kvm, struct virtio_device *vdev, u32 vq)
 		else
 			kvm__irq_trigger(kvm, vpci->gsis[vq]);
 	} else {
-		vpci->isr |= VIRTIO_IRQ_HIGH;
+		vpci->isr |= VIRTIO_PCI_ISR_QUEUE;
 		kvm__irq_line(kvm, vpci->legacy_irq_line, VIRTIO_IRQ_HIGH);
 	}
 	return 0;
-- 
2.42.0.283.g2d96d420d3-goog




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux