From: Ian Campbell Subject: Re: Is there a way to map pv guest pseudo physical address into dom0? Date: Mon, 27 Jun 2011 10:01:57 +0100 Message-ID: <1309165317.32717.160.camel@zakaz.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Wei Liu Cc: Anthony, Perard , "xen-devel@lists.xensource.com" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Mon, 2011-06-27 at 09:47 +0100, Wei Liu wrote: > Hi, all > > I'm reading the code of QEMU's virtio infrastructure (hw/virtio.c) and > Linux's virtio driver (virtio_blk.c, virtio_net.c). > > Virtio drivers utilize scatter gather infrastructure in the Linux > kernel. It stores the physical addresses in scatter list. In Xen's hvm > case, QEMU can access guest address space with > cpu_physical_memory_map. > > However, in Xen's pv case, this "physical address" will be "pseudo > physical address". In order to retrieve theirs content, backend must > map them into its own address space. I'm wondering if there is such > infrastructure to get this job done. I think you want one of xc_map_* provided by libxc (see xenctrl.h). (But avoid xc_map_foreign_batch which is deprecated). Ian.