From mboxrd@z Thu Jan 1 00:00:00 1970 From: tgh Subject: Re: question about memory mapping and balloon Date: Wed, 28 Mar 2007 08:46:07 +0800 Message-ID: <4609BACF.9000009@ncic.ac.cn> References: <460882BF.7000804@ncic.ac.cn> <200703270445.16577.mark.williamson@cl.cam.ac.uk> <4608BDD5.3030401@ncic.ac.cn> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <4608BDD5.3030401@ncic.ac.cn> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Mark Williamson , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Thank you for your reply Mark Williamson =E5=86=99=E9=81=93: >> In the paravirt case, guestos maintain its own mfn which need m2p and >> p2m ,or xen manage these ? >> =20 > > The guest is aware of it's mfns. > > The m2p table is a global machine frame -> pseudophysical frame=20 > mapping. Every guest uses this but is only privileged to update their=20 > portions of this. There's no requirement for it to be global but it=20 > saves space this way. > > The p2m is maintained in the guest's private memory. > =20 I do not understand clearly why does xen maintain m2p table and why=20 should the related portion of m2p be exported to the guestOS,and what=20 does guestOS do by using m2p > =20 >> 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 , >> =20 > > It's given initial information about its memory layout at boot time. =20 > It stores the p2m in a table and updates it when pages are transferred=20 > (e.g. by the balloon driver or by page flipping in the network=20 > device). Xen's global M2P table is mapped into the guest and it keeps=20 > this in sync by performing hypercalls to update it. > =20 when a VM boot with memsize=3D512M ,its p2m maybe only 64M or something=20 ,and when guest application request the memory,its virtual memory is=20 mapped ,and when the application write some data into that memory,there=20 is a page fault araised,and at that time guestOS update p2m and m2p and=20 its page table(say virtual-to-machine address) ,is it right? or how do=20 xen and guestOS deal with it? could you help me Thanks in advance > > =20