aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Brucker <jean-philippe@linaro.org>2022-07-22 15:17:31 +0100
committerWill Deacon <will@kernel.org>2022-08-04 15:51:33 +0100
commitfe2182731b721ecaec97cb7f02b2c334469669ce (patch)
tree97ae4819f697f3152c7b9c8726e321e953581fbf
parentae22ac7a81e5f59b8f93db6127a8797500836f60 (diff)
downloadkvmtool-fe2182731b721ecaec97cb7f02b2c334469669ce.tar.gz
virtio/pci: Deassert IRQ line on ISR read
Since commit 2108c86d0623 ("virtio/pci: Signal INTx interrupts as level instead of edge"), virtio uses level-triggered IRQs. Bring the modern device up to date, by deasserting the IRQ line when the guest reads the interrupt status register. Fixes: 3bf79498e6d5 ("virtio: Add support for modern virtio-pci") Reported-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> Link: https://lore.kernel.org/r/20220722141731.64039-4-jean-philippe@linaro.org Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r--virtio/pci-modern.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/virtio/pci-modern.c b/virtio/pci-modern.c
index 753e95bd..c5b4bc50 100644
--- a/virtio/pci-modern.c
+++ b/virtio/pci-modern.c
@@ -245,10 +245,7 @@ static bool virtio_pci__isr_read(struct virtio_device *vdev,
return false;
ioport__write8(data, vpci->isr);
- /*
- * Interrupts are edge triggered (yes, going against the PCI and virtio
- * specs), so no need to deassert the IRQ line.
- */
+ kvm__irq_line(vpci->kvm, vpci->legacy_irq_line, VIRTIO_IRQ_LOW);
vpci->isr = 0;
return 0;