diff options
author | Keir Fraser <keirf@google.com> | 2023-09-12 15:16:22 +0000 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2023-09-18 11:50:27 +0100 |
commit | 2921448450005c6734bffc533cc71685aa9e296c (patch) | |
tree | 4971119e403de3362c8ed04e8ba0462558a80ed7 | |
parent | 353fa0d89e295ecf6717586533b81d5229cb2f4b (diff) | |
download | kvmtool-2921448450005c6734bffc533cc71685aa9e296c.tar.gz |
virtio/pci: Treat PCI ISR as a set of bit flags
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@google.com>
Link: https://lore.kernel.org/r/20230912151623.2558794-3-keirf@google.com
Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r-- | virtio/pci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/virtio/pci.c b/virtio/pci.c index 7a206be0..74bc9a4f 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); } |