From: Dietmar Hahn Subject: Re: Mapping hvm guest pages in Dom0 Date: Mon, 29 Sep 2008 09:30:46 +0200 Message-ID: <200809290930.46865.dietmar.hahn@fujitsu-siemens.com> References: Reply-To: dietmar.hahn@fujitsu-siemens.com Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Satya Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Am Freitag, 26. September 2008 schrieb Satya: > hello, > I would like to map (Read/Write) pages owned by a HVM guest from my Dom0 > Linux kernel module. I have access to the "machine frame numbers" of these > pages. > > 1. What is the right interface to do this? kmap needs 'struct page' ptrs > which I doubt exist for pages owned by a HVM guest. Is there a hypercall = to > do this then? > > 2. Do I need to modify the HVM behavior in any way for this? (e.g., load a > driver in the guest that will setup grant tables?). I need to keep my gue= st > "pure HVM". > > thanks, > ./satya If you have the gmfn's from the HVM domU (I'am not sure where you get this= =20 from if you want to keep your guest "pure" HVM) and the domU id, you can ma= p=20 the domU memory into the dom0 kernel memory with struct vm_struct area; area =3D alloc_vm_area(num_pages * PAGE_SIZE); direct_kernel_remap_pfn_range(((unsigned long)) area->addr, gmfn, PAGE_SIZE*num_pages, prots, domU_id); Dietmar. =2D-=20 Dietmar Hahn IP SW OS6 Telephone: +49 (0) 89 636 40= 274 =46ujitsu Siemens Computers Email: dietmar.hahn@fujitsu-siemen= s.com Otto-Hahn-Ring 6 Internet: http://www.fujitsu-siemens.= com D-81739 M=FCnchen Company details: www.fujitsu-siemens.com/imprint= =2Ehtml