qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	kvm@vger.kernel.org, Jan Kiszka <jan.kiszka@siemens.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	qemu-devel@nongnu.org, Asias He <asias@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/3] virtio-pci: don't poll masked vectors
Date: Wed, 19 Dec 2012 13:35:31 +0100	[thread overview]
Message-ID: <20121219123531.GD6498@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <a66ea256e5e977f94039e392e67039fa09c1c368.1355833220.git.mst@redhat.com>

On Tue, Dec 18, 2012 at 02:39:19PM +0200, Michael S. Tsirkin wrote:
> -static int virtio_pci_set_guest_notifier(DeviceState *d, int n, bool assign)
> +static void kvm_virtio_pci_vector_poll(PCIDevice *dev,
> +                                       unsigned int vector_start,
> +                                       unsigned int vector_end)
> +{
> +    VirtIOPCIProxy *proxy = container_of(dev, VirtIOPCIProxy, pci_dev);
> +    VirtIODevice *vdev = proxy->vdev;
> +    int queue_no;
> +    unsigned int vector;
> +    EventNotifier *notifier;
> +    VirtQueue *vq;
> +
> +    for (queue_no = 0; queue_no < VIRTIO_PCI_QUEUE_MAX; queue_no++) {
> +        if (!virtio_queue_get_num(vdev, queue_no)) {
> +            break;
> +        }
> +        vector = virtio_queue_vector(vdev, queue_no);
> +        if (vector < vector_start || vector >= vector_end ||
> +            !msix_is_masked(dev, vector)) {
> +            continue;
> +        }
> +        vq = virtio_get_queue(vdev, queue_no);
> +        notifier = virtio_queue_get_guest_notifier(vq);
> +        if (event_notifier_test_and_clear(notifier)) {
> +            msix_set_pending(dev, vector);
> +        }

Small difference to virtio_queue_guest_notifier_read() here: we do not
set vq->vdev->isr |= 0x01.  I guess no guest drivers use isr with MSIX
but should we still set it or even just call
virtio_queue_guest_notifier_read() instead of duplicating that event
notifier read here?

Stefan

  parent reply	other threads:[~2012-12-19 12:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-18 12:39 [Qemu-devel] [PATCH 0/3] virtio: don't poll masked vectors with irqfd Michael S. Tsirkin
2012-12-18 12:39 ` [Qemu-devel] [PATCH 3/3] virtio-pci: don't poll masked vectors Michael S. Tsirkin
2012-12-19  8:59   ` Asias He
2012-12-19 11:29     ` Michael S. Tsirkin
2012-12-19 12:35   ` Stefan Hajnoczi [this message]
2012-12-18 12:39 ` [Qemu-devel] [PATCH 2/3] msix: expose access to masked/pending state Michael S. Tsirkin
2012-12-18 12:39 ` [Qemu-devel] [PATCH 1/3] msi: add API to get notified about pending bit poll Michael S. Tsirkin
2012-12-18 12:41 ` [Qemu-devel] [PATCH 0/3] virtio: don't poll masked vectors with irqfd Michael S. Tsirkin
2012-12-19  8:53 ` Asias He
2012-12-19 11:29   ` Michael S. Tsirkin

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=20121219123531.GD6498@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=asias@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).