From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaMSl-0007Fi-Ac for qemu-devel@nongnu.org; Thu, 09 May 2013 04:44:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UaMSi-00089w-UR for qemu-devel@nongnu.org; Thu, 09 May 2013 04:44:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaMSi-00089p-MZ for qemu-devel@nongnu.org; Thu, 09 May 2013 04:44:28 -0400 Date: Thu, 9 May 2013 11:44:18 +0300 From: "Michael S. Tsirkin" Message-ID: <20130509084418.GB32074@redhat.com> References: <1368060022-16911-1-git-send-email-qemulist@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1368060022-16911-1-git-send-email-qemulist@gmail.com> Subject: Re: [Qemu-devel] [PATCH 1/2] Vring: vring's listener's priority should higher than kvm List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liu Ping Fan Cc: Peter Maydell , Anthony Liguori , Jan Kiszka , qemu-devel@nongnu.org, Stefan Hajnoczi , Paolo Bonzini On Thu, May 09, 2013 at 08:40:21AM +0800, Liu Ping Fan wrote: > From: Liu Ping Fan > > Hosts threads which handle vring should have high MemoryListener priority > than kvm. For currently code, take the following scenario: > kvm_region_add() run earlier before vhost_region_add(), then in guest, > vring's desc[i] can refer to addressX in the new region known by guest. > But vhost does not know this new region yet, and the vring handler will > fail. > > Signed-off-by: Liu Ping Fan Is this seen in testing, or are you describing a theorecitical scenario? Please make this clear in the commit log. > --- > hw/virtio/dataplane/hostmem.c | 2 +- > hw/virtio/vhost.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/virtio/dataplane/hostmem.c b/hw/virtio/dataplane/hostmem.c > index 37292ff..67cbce1 100644 > --- a/hw/virtio/dataplane/hostmem.c > +++ b/hw/virtio/dataplane/hostmem.c > @@ -158,7 +158,7 @@ void hostmem_init(HostMem *hostmem) > .eventfd_del = hostmem_listener_eventfd_dummy, > .coalesced_mmio_add = hostmem_listener_coalesced_mmio_dummy, > .coalesced_mmio_del = hostmem_listener_coalesced_mmio_dummy, > - .priority = 10, > + .priority = 9, > }; > > memory_listener_register(&hostmem->listener, &address_space_memory); > diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c > index fbabf99..91c313b 100644 > --- a/hw/virtio/vhost.c > +++ b/hw/virtio/vhost.c > @@ -856,7 +856,7 @@ int vhost_dev_init(struct vhost_dev *hdev, int devfd, const char *devpath, > .log_global_stop = vhost_log_global_stop, > .eventfd_add = vhost_eventfd_add, > .eventfd_del = vhost_eventfd_del, > - .priority = 10 > + .priority = 9 > }; > hdev->mem = g_malloc0(offsetof(struct vhost_memory, regions)); > hdev->n_mem_sections = 0; > -- > 1.7.4.4