All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Philippe Brucker <jean-philippe@linaro.org>
To: will@kernel.org
Cc: kvm@vger.kernel.org, suzuki.poulose@arm.com,
	sami.mujawar@arm.com,
	Jean-Philippe Brucker <jean-philippe@linaro.org>
Subject: [PATCH kvmtool 3/4] virtio/pci: Deassert IRQ line on ISR read
Date: Fri, 22 Jul 2022 15:17:31 +0100	[thread overview]
Message-ID: <20220722141731.64039-4-jean-philippe@linaro.org> (raw)
In-Reply-To: <20220722141731.64039-1-jean-philippe@linaro.org>

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>
---
 virtio/pci-modern.c | 5 +----
 1 file changed, 1 insertion(+), 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;
-- 
2.37.1


  parent reply	other threads:[~2022-07-22 14:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-22 14:17 [PATCH kvmtool 0/4] Makefile and virtio fixes Jean-Philippe Brucker
2022-07-22 14:17 ` [PATCH kvmtool 1/4] Makefile: Add missing build dependencies Jean-Philippe Brucker
2022-07-25 10:26   ` Alexandru Elisei
2022-08-09  9:52     ` Jean-Philippe Brucker
2022-07-22 14:17 ` [PATCH kvmtool 2/4] Makefile: Fix ARCH override Jean-Philippe Brucker
2022-07-25 11:06   ` Alexandru Elisei
2022-08-09  9:56     ` Jean-Philippe Brucker
2022-08-09 15:38       ` Alexandru Elisei
2022-07-22 14:17 ` Jean-Philippe Brucker [this message]
2022-07-22 14:17 ` [PATCH kvmtool 4/4] virtio/rng: Zero-initialize the device Jean-Philippe Brucker
2022-08-04 15:02 ` [PATCH kvmtool 0/4] Makefile and virtio fixes Will Deacon
2022-08-09 10:05   ` Jean-Philippe Brucker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220722141731.64039-4-jean-philippe@linaro.org \
    --to=jean-philippe@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=sami.mujawar@arm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.