qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Fedin <p.fedin@samsung.com>
To: 'Cornelia Huck' <cornelia.huck@de.ibm.com>
Cc: 'Paolo Bonzini' <pbonzini@redhat.com>,
	"'Michael S. Tsirkin'" <mst@redhat.com>,
	qemu-devel@nongnu.org,
	'Christian Borntraeger' <borntraeger@de.ibm.com>
Subject: Re: [Qemu-devel] [PATCH] virtio: Implement userspace forwarding for host notifiers
Date: Thu, 19 Nov 2015 19:03:20 +0300	[thread overview]
Message-ID: <01aa01d122e3$d04ddf60$70e99e20$@samsung.com> (raw)
In-Reply-To: <20151119135516.67948855.cornelia.huck@de.ibm.com>

 Hello!

> If I read this correctly, memory regions already keep track of
> ioeventfds and this patch can simply trigger them manually if that had
> not already been done?

 Yes, exactly, and this is the new idea.

> Only that we don't have such a nice tracking structure that memory
> regions already have.
> 
> The intercept handler for diagnose 500 already ends up at the correct
> device (its id is one of the parameters), so I'd need to check for an
> existing notifier on the virtqueue and trigger that instead of calling
> virtio_queue_notify directly?

 Yes, absolutely correct, but only if the notifier has actually been installed. Pure userspace virtio will not do it, AFAIK, if we
don't have KVM_CAP_IOEVENTFD. Take a careful look at virtio-mmio.c, you'll see that host notifiers are actually installed from two
places:
1. virtio_mmio_start_ioeventfd()
2. virtio_mmio_set_host_notifier()

 Userspace implementation of virtio uses (1) path, while vhost uses (2). Note also that (1) does not do anything at all if KVM does
not support ioeventfds. So, (1) case breaks up into two:
 1a. userspace virtio, notifications triggered by handling MMIO writes in userspace
 1b. userspace virtio, notifications triggered by ioeventfds, which are bound to MMIO in kernel
 I don't know why we have (1b) at all, because i'm in doubt there would be any noticeable performance advantage. But, i believe,
there was some reason to implement it.

 Both (1) and (2) end up in the same internal routine, and the only difference is 'bool set_handler', which is set to false for
vhost. This is what i rely on, and this is what you should detect too.

 PCI backend is a little bit more complicated to read, but it works absolutely in the same way.

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia

      reply	other threads:[~2015-11-19 16:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-19  9:50 [Qemu-devel] [PATCH] virtio: Implement userspace forwarding for host notifiers Pavel Fedin
2015-11-19  9:56 ` Christian Borntraeger
2015-11-19 10:18   ` Pavel Fedin
2015-11-19 11:41     ` Cornelia Huck
2015-11-19 12:02       ` Pavel Fedin
2015-11-19 12:05         ` Michael S. Tsirkin
2015-11-19 10:55 ` Michael S. Tsirkin
2015-11-19 11:44   ` Pavel Fedin
2015-11-19 12:01     ` Michael S. Tsirkin
2015-11-19 12:06       ` Paolo Bonzini
2015-11-19 12:10         ` Michael S. Tsirkin
2015-11-19 12:17         ` Pavel Fedin
2015-11-19 12:31           ` Paolo Bonzini
2015-11-19 12:55           ` Cornelia Huck
2015-11-19 16:03             ` Pavel Fedin [this message]

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='01aa01d122e3$d04ddf60$70e99e20$@samsung.com' \
    --to=p.fedin@samsung.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --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).