Re: [Qemu-devel] [PATCH] virtio: Implement userspace forwarding for host notifiers

2015-11-19 Thread Pavel Fedin
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 alrea

Re: [Qemu-devel] [PATCH] virtio: Implement userspace forwarding for host notifiers

2015-11-19 Thread Cornelia Huck
On Thu, 19 Nov 2015 15:17:57 +0300 Pavel Fedin wrote: > Hello! > > > > Paolo, do you see anything wrong with making > > > memory_region_add_eventfd work (slowly) without kvm ioeventfd support? > > > > > > > Sure, it's even been on the todo list for a while. Stefan Hajnoczi had > > a patch, th

Re: [Qemu-devel] [PATCH] virtio: Implement userspace forwarding for host notifiers

2015-11-19 Thread Paolo Bonzini
On 19/11/2015 13:17, Pavel Fedin wrote: > Ok, good. So, this has already been tested. Ok, i think i can further extend > this patch by: > 1. Add a flag to disable memory_region_dispatch_write_ioeventfds(), to be set > by KVM code for example. So that with KVM we have even > smaller performance

Re: [Qemu-devel] [PATCH] virtio: Implement userspace forwarding for host notifiers

2015-11-19 Thread Pavel Fedin
Hello! > > Paolo, do you see anything wrong with making > > memory_region_add_eventfd work (slowly) without kvm ioeventfd support? > > > > Sure, it's even been on the todo list for a while. Stefan Hajnoczi had > a patch, the only ugly thing was that it slowed down a little all > non-ioeventfd a

Re: [Qemu-devel] [PATCH] virtio: Implement userspace forwarding for host notifiers

2015-11-19 Thread Michael S. Tsirkin
On Thu, Nov 19, 2015 at 01:06:17PM +0100, Paolo Bonzini wrote: > > > On 19/11/2015 13:01, Michael S. Tsirkin wrote: > >> > 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

Re: [Qemu-devel] [PATCH] virtio: Implement userspace forwarding for host notifiers

2015-11-19 Thread Paolo Bonzini
On 19/11/2015 13:01, Michael S. Tsirkin wrote: >> > 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 obsolet

Re: [Qemu-devel] [PATCH] virtio: Implement userspace forwarding for host notifiers

2015-11-19 Thread Michael S. Tsirkin
On Thu, Nov 19, 2015 at 03:02:12PM +0300, Pavel Fedin wrote: > Hello! > > > > I think if you have motivation, you could implement userspace forwarding > > > for ccw yourself, > > since you know the thing and know how to > > > do it. For MMIO it was indeed very simple. > > > > I'll take a peek a

Re: [Qemu-devel] [PATCH] virtio: Implement userspace forwarding for host notifiers

2015-11-19 Thread Pavel Fedin
Hello! > > I think if you have motivation, you could implement userspace forwarding > > for ccw yourself, > since you know the thing and know how to > > do it. For MMIO it was indeed very simple. > > I'll take a peek at your patch. This is actually a note for Michael. ccw support is one more

Re: [Qemu-devel] [PATCH] virtio: Implement userspace forwarding for host notifiers

2015-11-19 Thread Michael S. Tsirkin
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, > >

Re: [Qemu-devel] [PATCH] virtio: Implement userspace forwarding for host notifiers

2015-11-19 Thread Pavel Fedin
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_ha

Re: [Qemu-devel] [PATCH] virtio: Implement userspace forwarding for host notifiers

2015-11-19 Thread Cornelia Huck
On Thu, 19 Nov 2015 13:18:13 +0300 Pavel Fedin wrote: > Hello! > > > Looks like this would be ok for virtio-ccw (as it does not call > > virtio_queue_set_host_notifier_forwarding) > > Yes, this is the reason why i intentionally did not insert extra logic into > virtio_queue_set_host_notifier

Re: [Qemu-devel] [PATCH] virtio: Implement userspace forwarding for host notifiers

2015-11-19 Thread Michael S. Tsirkin
On Thu, Nov 19, 2015 at 12:50:49PM +0300, Pavel Fedin wrote: > If you happen to have a kernel with ioeventfd support enabled, but > missing support for them in KVM, and you attempt to enable vhost by > setting vhost=on, qemu aborts with error: > > kvm_mem_ioeventfd_add: error adding ioeventfd: Fun

Re: [Qemu-devel] [PATCH] virtio: Implement userspace forwarding for host notifiers

2015-11-19 Thread Pavel Fedin
Hello! > Looks like this would be ok for virtio-ccw (as it does not call > virtio_queue_set_host_notifier_forwarding) Yes, this is the reason why i intentionally did not insert extra logic into virtio_queue_set_host_notifier_fd_handler(), but made it into separate function. I don't know whethe

Re: [Qemu-devel] [PATCH] virtio: Implement userspace forwarding for host notifiers

2015-11-19 Thread Christian Borntraeger
Looks like this would be ok for virtio-ccw (as it does not call virtio_queue_set_host_notifier_forwarding) Question is might something like this for virtio-ccw useful as well? We cannot use memory_region, though, we would need to handle that in our diagnose code. Conny, FYI. On 11/19/2015 10

[Qemu-devel] [PATCH] virtio: Implement userspace forwarding for host notifiers

2015-11-19 Thread Pavel Fedin
If you happen to have a kernel with ioeventfd support enabled, but missing support for them in KVM, and you attempt to enable vhost by setting vhost=on, qemu aborts with error: kvm_mem_ioeventfd_add: error adding ioeventfd: Function not implemented This patch adds a mechanism which allows to emul