From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2bB0-0004MM-9y for qemu-devel@nongnu.org; Fri, 04 Nov 2016 05:52:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2bAv-0005Mc-Ru for qemu-devel@nongnu.org; Fri, 04 Nov 2016 05:52:46 -0400 Received: from 20.mo5.mail-out.ovh.net ([91.121.55.239]:60543) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c2bAv-0005LD-Lp for qemu-devel@nongnu.org; Fri, 04 Nov 2016 05:52:41 -0400 Received: from player774.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo5.mail-out.ovh.net (Postfix) with ESMTP id C4DA942487 for ; Fri, 4 Nov 2016 10:52:39 +0100 (CET) Date: Fri, 4 Nov 2016 10:52:35 +0100 From: Greg Kurz Message-ID: <20161104105235.5911260d@bahia> In-Reply-To: <20161104103832.6cd2da3b.cornelia.huck@de.ibm.com> References: <147824874772.27553.11117306757523688100.stgit@bahia> <147824875535.27553.17613593624845649413.stgit@bahia> <20161104103832.6cd2da3b.cornelia.huck@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/3] vhost: adapt vhost_verify_ring_mappings() to virtio 1 ring layout List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck Cc: qemu-devel@nongnu.org, Pierre Morel , "Michael S. Tsirkin" On Fri, 4 Nov 2016 10:38:32 +0100 Cornelia Huck wrote: > On Fri, 04 Nov 2016 09:39:15 +0100 > Greg Kurz wrote: > > > With virtio 1, the vring layout is split in 3 separate regions of > > contiguous memory for the descriptor table, the available ring and the > > used ring, as opposed with legacy virtio which uses a single region. > > > > In case of memory re-mapping, the code ensures it doesn't affect the > > vring mapping. This is done in vhost_verify_ring_mappings() which assumes > > the device is legacy. > > > > This patch changes vhost_verify_ring_mappings() to check the mappings of > > each part of the vring separately. > > Add "This will work for legacy mappings as well." ? > Sure! > > > > Signed-off-by: Greg Kurz > > --- > > hw/virtio/vhost.c | 79 ++++++++++++++++++++++++++++++++++----------- > > include/hw/virtio/vhost.h | 4 ++ > > 2 files changed, 64 insertions(+), 19 deletions(-) > > Reviewed-by: Cornelia Huck >