From: "Michael S. Tsirkin" <mst@redhat.com>
To: Pavel Fedin <p.fedin@samsung.com>
Cc: 'Christian Borntraeger' <borntraeger@de.ibm.com>,
qemu-devel@nongnu.org, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH] virtio: Implement userspace forwarding for host notifiers
Date: Thu, 19 Nov 2015 14:01:50 +0200 [thread overview]
Message-ID: <20151119135725-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <014b01d122bf$ab73dc90$025b95b0$@samsung.com>
On Thu, Nov 19, 2015 at 02:44:37PM +0300, Pavel Fedin wrote:
> Hello!
>
> > OK, that's better, thanks!
>
> Yes, indeed this was simple.
>
> > Why do we need
> > if (kvm_eventfds_enabled()) {
> > memory_region_add_eventfd(&proxy->iomem, VIRTIO_MMIO_QUEUENOTIFY, 4,
> > true, n, notifier);
> > } else if (!set_handler) {
> > virtio_queue_set_host_notifier_forwarding(vq);
> > }
> > everywhere though?
> >
> > Can't memory_region_add_eventfd DTRT depending on kvm etc?
>
> You know... I took a look at this, and yes, i could simply hook up emulation into memory region handlers. And everything that
> expects KVM eventfd binding will magically start working, probably rendering some bypass code obsolete.
> I have only one concern against this. qemu is a large piece of software, consisting of lots of components. I cannot test absolutely
> everything in every configuration. I suggest, old code was written with the assumption that if memory_region_add_eventfd() works, we
> are really using KVM acceleration. If we break this assumption, how much code will mysteriously misbehave instead of throwing
First of all, memory_region_add_eventfd simply exits on failure.
It seems unlikely you will break something which isn't already
broken.
Further:
$ git grep memory_region_add_eventfd
hw/misc/ivshmem.c: memory_region_add_eventfd(&s->ivshmem_mmio,
hw/misc/pci-testdev.c: memory_region_add_eventfd(test->mr,
hw/virtio/virtio-mmio.c: memory_region_add_eventfd(&proxy->iomem, VIRTIO_MMIO_QUEUENOTIFY, 4,
hw/virtio/virtio-pci.c: memory_region_add_eventfd(modern_mr, modern_addr, 0,
hw/virtio/virtio-pci.c: memory_region_add_eventfd(modern_mr, modern_addr, 2,
hw/virtio/virtio-pci.c: memory_region_add_eventfd(modern_notify_mr, 0, 2,
hw/virtio/virtio-pci.c: memory_region_add_eventfd(legacy_mr, legacy_addr, 2,
include/exec/memory.h: * memory_region_add_eventfd: Request an eventfd to be triggered when a word
include/exec/memory.h:void memory_region_add_eventfd(MemoryRegion *mr,
include/exec/memory.h: * memory_region_add_eventfd() call.
memory.c:void memory_region_add_eventfd(MemoryRegion *mr,
Not such a bit deal to audit all call sites, is it?
Cc memory API maintainer for an opinion.
Paolo, do you see anything wrong with making
memory_region_add_eventfd work (slowly) without kvm ioeventfd support?
> "function not supported" error, which is quite easy to trace down and fix?
That's a problem with switching from vhost to virtio too,
apparently you decided it's not a big deal there,
why a change of heart?
> What i would refactor, perhaps, is to add a return code to memory_region_add_eventfd(), so that it can signal failure instead of a
> critical abort, this would allow to get rid of kvm_eventfds_enabled() accompanying checks.
>
> Kind regards,
> Pavel Fedin
> Expert Engineer
> Samsung Electronics Research center Russia
next prev parent reply other threads:[~2015-11-19 12:02 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 [this message]
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
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=20151119135725-mutt-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=p.fedin@samsung.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).