13 messages in com.xensource.lists.xen-develRe: [Xen-devel] question about machin...
FromSent OnAttachments
Jan Beulich15 Mar 2007 04:26 
Keir Fraser15 Mar 2007 04:58 
Jan Beulich15 Mar 2007 06:56 
Keir Fraser15 Mar 2007 07:01 
Jan Beulich15 Mar 2007 07:37 
Keir Fraser15 Mar 2007 08:02 
Jan Beulich16 Mar 2007 01:17 
Keir Fraser16 Mar 2007 01:21 
tgh22 Mar 2007 18:55 
Daniel Stodden23 Mar 2007 04:44 
tgh25 Mar 2007 18:39 
Mark Williamson26 Mar 2007 21:14 
tgh26 Mar 2007 23:13 
Subject:Re: [Xen-devel] question about machine-to-physic table and phy-to-machine table
From:Mark Williamson (mark@cl.cam.ac.uk)
Date:03/26/2007 09:14:30 PM
List:com.xensource.lists.xen-devel

I read the code ,there are machine-to-physic table and physic-to-machine table there are machine address for hardward address ,physic address for guestos's view hardware and virtual address ,is it right?

phy-to-machine table is a mapping for guestos's view hardware to real hardward ,is it right? I am confused about the meaning and function of machine-to-physic address

* Machine addresses represent real RAM in the host. The memory a guest owns will certainly not start at 0 and will not necessarily be contiguous - it might be in a number of chunks with big gaps between.

* (pseudo)physical addresses represent the memory the guest owns. This address space starts at 0 and is contiguous.

* Virtual addresses are used by software running in the guest, and by the guest kernel. They're translated by the host CPU into machine addresses so that it can access the correct RAM.

Guests use physical addresses as an abstraction: most operating system memory management code assumes that the RAM owned by the OS starts at 0 and is contiguous. Because this is not the case for Machine addresses under Xen, most of the guest's code is "tricked" by giving it pseudophysical addresses that look like it expects memory to look.

The P2M and M2P tables record the relationship between pseudophysical page frames (which the core OS code uses) and machine page frames (which the host really uses). The Xen "architecture" code within the guest OS uses these tables to manage the translation between pseudophysical and machine page frames so that the guest's page tables can be handled correctly. For paravirtualised guests, page tables must contain machine addresses - these must be translated from the pseudophysical addresses used by core OS code.

Hope that helps clarify how this all fits together, tgh.

Cheers, Mark