From: tgh Subject: Re: Page tables in Xen Date: Wed, 05 Dec 2007 20:12:06 +0800 Message-ID: <47569596.5020905@sina.com.cn> References: <1196315351.13722.14.camel@thinkpad.localdomain> <47535CA7.9090000@sina.com.cn> <200712030210.26758.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: <200712030210.26758.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: weiming , xen-devel@lists.xensource.com, Haifeng He , Daniel Stodden List-Id: xen-devel@lists.xenproject.org hi in the PV mode,VM guestOS pagetable is virtual-to-machine address=20 mapping,is it right?,and when a VM is migrated, the shadow page table=20 mode will be enabled ,is it right? then, the PVguestOS pagetalbe will=20 become the virtual-to-psuedophysical address mapping, or not? then ,at=20 that time ,the shadow pagetalbe is virtual-to-machine one ,is it right? I am still confused ,especially about the PVguestOS pagetalbe when=20 shadow pagetable enabled for migration? is it a virtual-to-machine=20 address mapping, or a virtual-to-psuedophysical address one ? Thanks in advance Mark Williamson =E5=86=99=E9=81=93: >> I am confused about shadow page table in the paravirtual mode in xen= , >> does guestOS have all of its own processes'page tables,and xen keep= s >> the very exactly all of the guestOS's processes page tables for a copy= ? >> or say ,it is xen who keeps the only copy of the guestOS's processes >> page tables ,and guestOS accesses to its processes's page tables >> through some hypercall? or ,what about it ? >> If the guestOS has all of its processes's page talbes, while xen >> maintain the copy of all those page tables ,is it an inefficient usage >> of memory ,or what is the trick behind ? >> =20 > > > The process owns all of the pagetables for its processes; Xen does not = (in=20 > normal operation) maintain a shadow pagetable for PV domains. > > In PV mode, Xen simply prevents a guest from loading a pagetable for us= e=20 > unless the guest has relinquished all rights to write to that memory. = i.e. a=20 > guest can only register a pagetable with Xen if there's no way that the= guest=20 > can modify that pagetable directly. This guarantees safety. > > When the guest needs to update the pagetable, it can either write direc= tly to=20 > it (which will cause a trap due to lack of permission, then Xen will ch= eck=20 > whether the update should be allowed) or it can call directly to Xen (w= hich=20 > then does safety checks and does the update if it's OK). > > Cheers, > Mark > > =20 >> Thanks in advance >> >> Daniel Stodden =E5=86=99=E9=81=93: >> =20 >>> On Thu, 2007-11-29 at 11:00 +0530, pradeep singh rautela wrote: >>> =20 >>>> On Nov 29, 2007 1:42 AM, Haifeng He wrote: >>>> =20 >>>>> Thanks for answering my question. I am talking about PV mode. What >>>>> about shadow page table? Does it mean, Xen will keep (real) copies = of >>>>> page tables? >>>>> =20 >>>> Shadown page tables are employed in HVM guests not PV guests. >>>> =20 >>> regarding shadowed PV domains, there's still >>> XENFEAT_auto_translated_physmap. but it's rather exotic and therefore >>> rarely used. >>> >>> regarding the original question: yes, this means xen keeps the real p= age >>> tables, while guests map pseudo-physical (i.e. linear) memory in what >>> they (may) believe to be the real ones. >>> >>> regards, >>> daniel >>> =20 >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xensource.com >> http://lists.xensource.com/xen-devel >> =20 > > > > =20