From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlbEM-0002Xc-Vh for qemu-devel@nongnu.org; Fri, 24 Apr 2015 06:53:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YlbEI-0000bZ-Mx for qemu-devel@nongnu.org; Fri, 24 Apr 2015 06:53:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50771) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlbEI-0000bI-F2 for qemu-devel@nongnu.org; Fri, 24 Apr 2015 06:53:06 -0400 Message-ID: <553A208B.7090505@redhat.com> Date: Fri, 24 Apr 2015 12:52:59 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <553A0766.4040007@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] physical memory address in guest (from his point of view) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Catalin Vasile Cc: qemu-devel@nongnu.org On 24/04/2015 12:22, Catalin Vasile wrote: > > > Does a physical memory address in a guest points to the same memory as qemu? > > > For example: if I have a physical pointer 0x34 in the guest, does it > > > point to the same location that qemu points with 0x34 address? > > > > No. QEMU converts guest pointers (which are just uint64_t) to host > > pointers using address_space_map/address_space_unmap. > > That being said. Does a message that passes from guest to a backend > need to pass through qemu everytime? > I'm trying to understand how virtio virtqueues work. Namely I'm trying > to pass as data itself a pointer in which the backend will write, > namely use copy_to_user() if the backend is a kernel module. vhost provides the infrastructure to do the same thing as address_space_map/unmap. Passing pointers inside a data buffer would be very weird for virtio devices. The way you do it typically, is that you pass a one descriptor corresponding to a request or response header, and one or more descriptors for the data buffers. Paolo