virtio/pci: Signal INTx interrupts as level instead of edge
Marc Zyngier
maintainerPATCH 1/1 virtio/pci: Signal INTx interrupts as level instead of edge
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.
--- pci.c | 2 +- virtio/pci.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
pci.c +1 -1
@@ -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; }
virtio/pci.c +1 -1
@@ -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 ; }
Signature · 6 lines
2.34.1 _______________________________________________ kvmarm mailing list [email protected] https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
Quoted 9 lines · Marc Zyngier
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.
Quoted 5 lines
Reported-by Pierre Gondois <[email protected]>Signed-off-by Marc Zyngier <[email protected]>Cc Ard Biesheuvel <[email protected]>Cc Sami Mujawar <[email protected]>Cc Will Deacon <[email protected]>
Quoted 32 lines
--- pci.c | 2 +- virtio/pci.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)pci.c +1
-1@@ -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; }virtio/pci.c +1
-2@@ -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 ; } --
Quoted 2 lines
2.34.1
_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
Quoted 10 lines · Ard Biesheuvel
Quoted 9 lines · Marc Zyngier
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.
Quoted 7 lines
Quoted 5 lines
Reported-by Pierre Gondois <[email protected]>Signed-off-by Marc Zyngier <[email protected]>Cc Ard Biesheuvel <[email protected]>Cc Sami Mujawar <[email protected]>Cc Will Deacon <[email protected]>Acked-by Ard Biesheuvel <[email protected]>
Hi,
Just to confirm, I tried it and it was working well, Regards,
Pierre
Quoted 27 lines
Quoted 27 lines
--- pci.c | 2 +- virtio/pci.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)pci.c +1
-1@@ -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; }virtio/pci.c +0
-0@@ -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 ;
Quoted 8 lines
Quoted 8 lines
virtio/pci.c +1
-2-kvm__irq_trigger (kvm, vpci->legacy_irq_line); +kvm__irq_line (kvm, vpci->legacy_irq_line,VIRTIO_IRQ_HIGH ); }return 0 ; } --2.34.1
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 10 lines · Ard Biesheuvel
Quoted 9 lines · Marc Zyngier
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.
Quoted 7 lines
Quoted 5 lines
Reported-by Pierre Gondois <[email protected]>Signed-off-by Marc Zyngier <[email protected]>Cc Ard Biesheuvel <[email protected]>Cc Sami Mujawar <[email protected]>Cc Will Deacon <[email protected]>Acked-by Ard Biesheuvel <[email protected]>
Hi,
Just to confirm, I tried the patch and everything is working for me, Regards,
Pierre
Quoted 27 lines
Quoted 27 lines
--- pci.c | 2 +- virtio/pci.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)pci.c +1
-1@@ -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; }virtio/pci.c +0
-0@@ -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 ;
Quoted 8 lines
Quoted 8 lines
virtio/pci.c +1
-2-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
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
Will Deacon
AppliedQuoted 9 lines · Marc Zyngier
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.
[...]
Applied to kvmtool (master), thanks!
[1/1] virtio/pci: Signal INTx interrupts as level instead of edge
https://git.kernel.org/will/kvmtool/c/2108c86d0623
Cheers,
Signature · 9 lines
Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev _______________________________________________ kvmarm mailing list [email protected] https://lists.cs.columbia.edu/mailman/listinfo/kvmarm