All of lore.kernel.org
 help / color / mirror / Atom feed
From: tgh <tianguanhua@ncic.ac.cn>
To: Mark Williamson <mark.williamson@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com, Daniel Stodden <stodden@cs.tum.edu>
Subject: Re: question about machine-to-physic table and	phy-to-machine table
Date: Tue, 27 Mar 2007 14:14:07 +0800	[thread overview]
Message-ID: <4608B62F.5000805@ncic.ac.cn> (raw)
In-Reply-To: <200703270514.53524.mark.williamson@cl.cam.ac.uk>

Thank you for your detail reply
your explanation is really helpful

and
p2m and m2p are all lazily allocated ,that is when the guestos deal with 
page fault for using ,say writing, a page which is virtual-mapped but 
not allocated machine page ,is it right?



Mark Williamson 写道:
>>  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
>
>   

      reply	other threads:[~2007-03-27  6:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-15 11:27 performance counters Jan Beulich
2007-03-15 11:58 ` Keir Fraser
2007-03-15 13:57   ` Jan Beulich
2007-03-15 14:01     ` Keir Fraser
2007-03-15 14:37       ` Jan Beulich
2007-03-15 15:03         ` Keir Fraser
2007-03-16  8:17           ` Jan Beulich
2007-03-16  8:21             ` Keir Fraser
2007-03-23  1:56 ` question about machine-to-physic table and phy-to-machine table tgh
2007-03-23 11:44   ` Daniel Stodden
2007-03-26  1:39     ` tgh
2007-03-27  4:14   ` Mark Williamson
2007-03-27  6:14     ` tgh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4608B62F.5000805@ncic.ac.cn \
    --to=tianguanhua@ncic.ac.cn \
    --cc=mark.williamson@cl.cam.ac.uk \
    --cc=stodden@cs.tum.edu \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.