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

[Xen-devel] Re: Mapping foreign frames from dom0

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: Mapping foreign frames from dom0
From: Julian Stecklina <der_julian@xxxxxx>
Date: Wed, 21 Feb 2007 15:39:16 +0100
Delivery-date: Wed, 21 Feb 2007 06:39:03 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <45D5E8E8.7070209@xxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <er1mu3$vrs$1@xxxxxxxxxxxxx> <45D5E8E8.7070209@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.9 (X11/20061206)
Grzegorz Milos wrote:
Hello,

I am hacking on a Mini-OS that is able to run as domain 0 and is able to start a guest (another Mini-OS for now). I was able to get a memory allocated to the guest and am now trying to build its pagetable and after that copy the kernel to the right places. The problem is:

Given a machine frame number from a memory frame of the guest, how do I conceptionally map this into dom0's address space? I followed the code path from xc_map_foreign_range to some obscure pagetable updates in the Linux kernel, but am still unable to make heads or tails of it.

Any help is appreciated.


Foreign mappings are very similar to standard mappings (assuming that the mapping domain is privileged). HYPERVISOR_mmu_update with domid set to the foreign domain will deal with page table update.

Note that you need to find some virtual address for the mapping. This is what demand_map_area is for, have a look at map_frames() in arch/x86/mm.c for more info.

Ah, i was under the false impression that I had to modify the MACHPHYS table, but doing a normal page table update with the foreigndom set, works. Thanks.

Regards,
Julian


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

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