[PATCH 2/3] virtio/pci: Treat PCI ISR as a set of bit flags

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

 



The PCI ISR is defined in the virtio spec as a set of flags which can
be bitwise ORed together. Therefore we should avoid clearing
previously-set flags.

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

diff --git a/virtio/pci.c b/virtio/pci.c
index 7a206be..74bc9a4 100644
--- a/virtio/pci.c
+++ b/virtio/pci.c
@@ -239,7 +239,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_IRQ_HIGH;
 		kvm__irq_line(kvm, vpci->legacy_irq_line, VIRTIO_IRQ_HIGH);
 	}
 	return 0;
@@ -263,7 +263,7 @@ int virtio_pci__signal_config(struct kvm *kvm, struct virtio_device *vdev)
 		else
 			kvm__irq_trigger(kvm, vpci->config_gsi);
 	} else {
-		vpci->isr = VIRTIO_PCI_ISR_CONFIG;
+		vpci->isr |= VIRTIO_PCI_ISR_CONFIG;
 		kvm__irq_line(kvm, vpci->legacy_irq_line, VIRTIO_IRQ_HIGH);
 	}
 
-- 
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