aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keirf@google.com>2023-09-12 15:16:23 +0000
committerWill Deacon <will@kernel.org>2023-09-18 11:50:27 +0100
commitd560235f45568a08c6006c2e1bd25399f8e9fea8 (patch)
tree4ff7f84974a94c459027a9efd82aa927541e28ff
parent2921448450005c6734bffc533cc71685aa9e296c (diff)
downloadkvmtool-d560235f45568a08c6006c2e1bd25399f8e9fea8.tar.gz
virtio/pci: Use consistent naming for the PCI ISR bit flags
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@google.com> Link: https://lore.kernel.org/r/20230912151623.2558794-4-keirf@google.com Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r--virtio/pci-legacy.c2
-rw-r--r--virtio/pci.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/virtio/pci-legacy.c b/virtio/pci-legacy.c
index 58047967..02a8f8c1 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 74bc9a4f..8a34cec1 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;