[PATCH][kvmtool] virtio/pci: Signal INTx interrupts as level instead of edge

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

 



It appears that the way INTx is emulated is "slightly" out of spec
in kvmtool. We happily inject an edge interrupt, even if the spec
mandates a level.

This doesn't change much for either the guest or userspace (only
KVM will have a bit more work tracking the EOI), but at least
this is correct.

Reported-by: Pierre Gondois <pierre.gondois@xxxxxxx>
Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx>
Cc: Ard Biesheuvel <ardb@xxxxxxxxxx>
Cc: Sami Mujawar <sami.mujawar@xxxxxxx>
Cc: Will Deacon <will@xxxxxxxxxx>
---
 pci.c        | 2 +-
 virtio/pci.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pci.c b/pci.c
index e5930331..a769ae27 100644
--- a/pci.c
+++ b/pci.c
@@ -61,7 +61,7 @@ int pci__assign_irq(struct pci_device_header *pci_hdr)
 	pci_hdr->irq_line	= irq__alloc_line();
 
 	if (!pci_hdr->irq_type)
-		pci_hdr->irq_type = IRQ_TYPE_EDGE_RISING;
+		pci_hdr->irq_type = IRQ_TYPE_LEVEL_HIGH;
 
 	return pci_hdr->irq_line;
 }
diff --git a/virtio/pci.c b/virtio/pci.c
index 41085291..2777d1c8 100644
--- a/virtio/pci.c
+++ b/virtio/pci.c
@@ -413,7 +413,7 @@ int virtio_pci__signal_vq(struct kvm *kvm, struct virtio_device *vdev, u32 vq)
 			kvm__irq_trigger(kvm, vpci->gsis[vq]);
 	} else {
 		vpci->isr = VIRTIO_IRQ_HIGH;
-		kvm__irq_trigger(kvm, vpci->legacy_irq_line);
+		kvm__irq_line(kvm, vpci->legacy_irq_line, VIRTIO_IRQ_HIGH);
 	}
 	return 0;
 }
-- 
2.34.1

_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm



[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux