From mboxrd@z Thu Jan 1 00:00:00 1970 From: tgh Subject: Re: question about memory mapping and balloon Date: Tue, 27 Mar 2007 14:46:45 +0800 Message-ID: <4608BDD5.3030401@ncic.ac.cn> References: <460882BF.7000804@ncic.ac.cn> <200703270445.16577.mark.williamson@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <200703270445.16577.mark.williamson@cl.cam.ac.uk> 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 Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Thank you for your reply your explanation is helpful 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 mapping= . =20 > Every guest uses this but is only privileged to update their portions o= f=20 > this. There's no requirement for it to be global but it saves space th= is=20 > 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. I= t=20 > stores the p2m in a table and updates it when pages are transferred (e.= g. by=20 > the balloon driver or by page flipping in the network device). Xen's g= lobal=20 > M2P table is mapped into the guest and it keeps this in sync by perform= ing=20 > 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