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] Dom0 Virtual Memory

To: "Eric Benton" <benton71@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: RE: [Xen-devel] Dom0 Virtual Memory
From: "Petersson, Mats" <Mats.Petersson@xxxxxxx>
Date: Mon, 23 Oct 2006 14:29:54 +0200
Delivery-date: Mon, 23 Oct 2006 05:40:47 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <29545330610230342l16f11dd6vaf71975ec9e7d03@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/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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acb2m54Y7WCglIoySG+lLcUC+kt8EAAAE5yA
Thread-topic: [Xen-devel] Dom0 Virtual Memory
I'm not sure if this is answering the right or wrong question, but I think you're missing a bit somewhere.
 
Xen is managing the MACHINE PHYSICAL memory and the GUEST is believing that the GUEST PHYSICAL is "real" physical memory. The next level above, which is the OS's handling of virtual to physical and physical to virtual will just handle this as if GUEST PHYSICAL really was the true picture of the world. There are however some places where the difference is "real" - drivers that use direct memory access (bus mastering) will need to have the bus-address, and until IOMMU is a reality for most people, the bus-address is MACHINE PHYSICAL. So there's special code inside the device-drivers to handle the translation of the GUEST PHYSICAL to MACHNE PHYSICAL when translating the virtual address given by the user-mode application into a PHYSICAL address.
 
The tables used to manage virtual to guest-physical is the page-tables. Obviously, for ease of use, the OS will also implement some sort of virtual to physical and physical to virtual tables to translate between the two as necessary.
 
In HVM (or any other case of "shadow mode"), you can use shadow_gva_to_[gfn,gpa] to get the guest-physical address, and then sh_vcp_gfn_to_mfn() to translate that to a machine frame. mfn_x appears to translate that to a "real address" - although my 2 minutes of grepping didn't find it...
 
--
Mats


From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx [mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Eric Benton
Sent: 23 October 2006 11:42
To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Dom0 Virtual Memory

Hi,

I looked at the sources and figured out all about the P2M, M2P tables and mappings,
Now I'm trying to figure out how dom0 virtual memory is implemented, and I have some questions.

The platform I'm working on is x86 with Intel VT enabled.

1. Is dom0 virtual memory managed differently than the other domains? what about hvms? and domUs?
2. What tables are used to manage the virtual memory?
3. What is the easiest method to do a dom0 virtual address to machine address translation (from Xen itself)?

Thanks for your help in advance!

Cheers,
Eric.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>