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] question about memory mapping and balloon

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] question about memory mapping and balloon
From: Mark Williamson <mark.williamson@xxxxxxxxxxxx>
Date: Tue, 27 Mar 2007 04:45:16 +0100
Cc: tgh <tianguanhua@xxxxxxxxxx>
Delivery-date: Mon, 26 Mar 2007 20:44:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <460882BF.7000804@xxxxxxxxxx>
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: <d2ad857f0703261348x4dd40b30y71d42f212326a3d6@xxxxxxxxxxxxxx> <460882BF.7000804@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.5
>  In the paravirt case, guestos maintain its own mfn which need m2p and
> p2m ,or xen manage these ?

The guest is aware of it's mfns.

The m2p table is a global machine frame -> pseudophysical frame mapping.  
Every guest uses this but is only privileged to update their portions of 
this.  There's no requirement for it to be global but it saves space this 
way.

The p2m is maintained in the guest's private memory.

>  I am confused about how does guestOS maintain its virt-to-physic and
> physic-to-mach mapping ,in the linux ,there is only v2p mapping,
>  how does guestOS maintain its p2m mapping ,

It's given initial information about its memory layout at boot time.  It 
stores the p2m in a table and updates it when pages are transferred (e.g. by 
the balloon driver or by page flipping in the network device).  Xen's global 
M2P table is mapped into the guest and it keeps this in sync by performing 
hypercalls to update it.

>  and when a virt address is 
> put into a mmu, does cpu hardware convert virt-addr into machine address
> or guest's phyiscal address?

To the machine address, since the CPU is not aware that virtualisation is 
occuring. [1]

The guest is responsible for making sure the correct machine addresses are put 
into its page tables (although Xen won't let it put machine addresses into 
the page tables that it shouldn't have access to!).

> another one
> does xen in hvm case support balloon for modifying the vm memory size or
> not?

Not yet, but I believe it's planned.


Note [1]: although the CPU can't currently do the 
virtual->pseudophysical->machine translation, this is a planned feature of 
future AMD and Intel virtualisation-aware processors.  It's sometimes 
referred to as "nested paging".  Other architectures (e.g. zSeries, I 
suspect) may support this type of functionality already.

Cheers,
Mark

>
> I am confused about it
>
> could you help me
> Thanks in advance
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel

-- 
Dave: Just a question. What use is a unicyle with no seat?  And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!

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