WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Mapping hvm guest pages in Dom0

To: Satya <satyakiran@xxxxxxxxx>
Subject: Re: [Xen-devel] Mapping hvm guest pages in Dom0
From: Dietmar Hahn <dietmar.hahn@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 29 Sep 2008 09:30:46 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 29 Sep 2008 00:31:20 -0700
Domainkey-signature: s=s768; d=fujitsu-siemens.com; c=nofws; q=dns; h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV: Received:Received:From:Reply-To:Organization:To:Subject: Date:User-Agent:Cc:References:In-Reply-To:MIME-Version: Content-Type:Content-Transfer-Encoding: Content-Disposition:Message-Id; b=0VaRV+toO745uXgyk5aPNtceeeGiZqPH2Ffh+ondO+5hjTydaLMmOIGr B6K78p3a+XgESPTRxXVz0F/ESbYbYKt6fwefavqK9i6V7t6hFlFZljQh4 /SHMIe5eS8Sm2X/;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <acbcf3840809261202i693c21fawbe86ec75f8a995ba@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Fujitsu-Siemens-Computers
References: <acbcf3840809261202i693c21fawbe86ec75f8a995ba@xxxxxxxxxxxxxx>
Reply-to: dietmar.hahn@xxxxxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.6 (enterprise 20070904.708012)
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 guest
> "pure HVM".
>
> thanks,
> ./satya

If you have the gmfn's from the HVM domU (I'am not sure where you get this 
from if you want to keep your guest "pure" HVM) and the domU id, you can map 
the domU memory into the dom0 kernel memory with

struct vm_struct area;
area = 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.

-- 
Dietmar Hahn
IP SW OS6                                      Telephone: +49 (0) 89 636 40274
Fujitsu Siemens Computers              Email: dietmar.hahn@xxxxxxxxxxxxxxxxxxx
Otto-Hahn-Ring 6                     Internet:  http://www.fujitsu-siemens.com
D-81739 München          Company details: www.fujitsu-siemens.com/imprint.html

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>