From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36481) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiQcJ-0004YQ-S7 for qemu-devel@nongnu.org; Tue, 11 Dec 2012 09:15:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiQc9-0004CP-GX for qemu-devel@nongnu.org; Tue, 11 Dec 2012 09:15:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiQc9-0004C8-8y for qemu-devel@nongnu.org; Tue, 11 Dec 2012 09:15:17 -0500 Date: Tue, 11 Dec 2012 16:18:20 +0200 From: "Michael S. Tsirkin" Message-ID: <20121211141820.GB18753@redhat.com> References: <1355144985-12897-1-git-send-email-stefanha@redhat.com> <1355144985-12897-5-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1355144985-12897-5-git-send-email-stefanha@redhat.com> Subject: Re: [Qemu-devel] [PATCH v6 04/12] dataplane: add virtqueue vring code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Anthony Liguori , qemu-devel@nongnu.org, Blue Swirl , khoa@us.ibm.com, Paolo Bonzini , Asias He On Mon, Dec 10, 2012 at 02:09:37PM +0100, Stefan Hajnoczi wrote: > + iov->iov_base = hostmem_lookup(&vring->hostmem, desc.addr, desc.len, > + desc.flags & VRING_DESC_F_WRITE); > + if (!iov->iov_base) { > + error_report("Failed to map indirect descriptor" > + "addr %#" PRIx64 " len %u", > + (uint64_t)desc.addr, desc.len); > + vring->broken = true; > + return -EFAULT; > + } > + iov->iov_len = desc.len; > + iov++; Hmm, this assumes a descriptor can not cross a memory region boundary. Is this really guaranteed? vhost does not make such assumptions. -- MST