From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2axS-0002iw-Fq for qemu-devel@nongnu.org; Fri, 04 Nov 2016 05:38:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2axP-0006lp-8i for qemu-devel@nongnu.org; Fri, 04 Nov 2016 05:38:46 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:33062) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c2axO-0006ip-Vn for qemu-devel@nongnu.org; Fri, 04 Nov 2016 05:38:43 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uA49cbqW088596 for ; Fri, 4 Nov 2016 05:38:41 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 26gk2fyfbv-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 04 Nov 2016 05:38:41 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 4 Nov 2016 09:38:39 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id C795A1B08074 for ; Fri, 4 Nov 2016 09:40:45 +0000 (GMT) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uA49cZUP12910890 for ; Fri, 4 Nov 2016 09:38:35 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uA49cYUr000301 for ; Fri, 4 Nov 2016 03:38:34 -0600 Date: Fri, 4 Nov 2016 10:38:32 +0100 From: Cornelia Huck In-Reply-To: <147824875535.27553.17613593624845649413.stgit@bahia> References: <147824874772.27553.11117306757523688100.stgit@bahia> <147824875535.27553.17613593624845649413.stgit@bahia> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20161104103832.6cd2da3b.cornelia.huck@de.ibm.com> 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: Greg Kurz Cc: qemu-devel@nongnu.org, Pierre Morel , "Michael S. Tsirkin" 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." ? > > 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