From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzNyq-0004Az-Vv for qemu-devel@nongnu.org; Thu, 19 Nov 2015 07:06:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzNyn-00040i-Qf for qemu-devel@nongnu.org; Thu, 19 Nov 2015 07:06:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzNyn-00040R-KR for qemu-devel@nongnu.org; Thu, 19 Nov 2015 07:06:21 -0500 References: <011b01d122af$c60f7ce0$522e76a0$@samsung.com> <20151119125348-mutt-send-email-mst@redhat.com> <014b01d122bf$ab73dc90$025b95b0$@samsung.com> <20151119135725-mutt-send-email-mst@redhat.com> From: Paolo Bonzini Message-ID: <564DBB39.3010207@redhat.com> Date: Thu, 19 Nov 2015 13:06:17 +0100 MIME-Version: 1.0 In-Reply-To: <20151119135725-mutt-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] virtio: Implement userspace forwarding for host notifiers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , Pavel Fedin Cc: 'Christian Borntraeger' , qemu-devel@nongnu.org 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 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? > 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 accesses, but I guess that's okay because it's probably not measurable. http://lists.nongnu.org/archive/html/qemu-devel/2015-07/msg04710.html Paolo Paolo