From: Keir Fraser Subject: Re: Readonly memory for guest domain Date: Thu, 13 Sep 2007 07:34:10 +0100 Message-ID: References: <804dabb00709121859te561d2cjdfeac95876b9778@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1206097343==" Return-path: In-Reply-To: <804dabb00709121859te561d2cjdfeac95876b9778@mail.gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Peter Teoh Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --===============1206097343== Content-type: multipart/alternative; boundary="B_3272513652_15774288" > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3272513652_15774288 Content-type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable Yeah, it doesn=B9t really work as you describe! K. On 13/9/07 02:59, "Peter Teoh" wrote: >=20 > On 9/12/07, Keir Fraser wrote: >> Xen does not have this general read-only restriction. It does force page >> tables to be read-only, otherwise a guest could grant itself access to >> arbitrary memory that it does not own. >=20 > Thank you for the answer. In the first place, we will not know what is > pagetable or non-pagetable memory. For example, during dom0/domU > initialisation, the guest OS will query the e820 bios mechanism for physi= cal > memory availability, and the guest OS (paravirt or HVM) will then assign > different parts of the physical memory for pagetable construction. Then > after all the pagetable is completely constructed, the CR3 is loaded, whi= ch > started the hardware MMU operation. So therefore, before the CR3 is lo= aded > the entire physical memory is marked as readonly, and after the CR3 is lo= aded, > only those memory not involved in pagetable mapping are unmarked readonly= ? >=20 > Does not seem right, as guest OS can change the CR3 anytime subsequently = as > well. >=20 >=20 --B_3272513652_15774288 Content-type: text/html; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable Re: [Xen-devel] Readonly memory for guest domain Yeah,= it doesn’t really work as you describe!

 K.

On 13/9/07 02:59, "Peter Teoh" <htmldeveloper@gmail.com> wr= ote:


On 9/12/07, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote:
Xen does not have this general read-only restriction. I= t does force page tables to be read-only, otherwise a guest could grant itse= lf access to arbitrary memory that it does not own.

Thank you for the answer.   In the first place, we will not know = what is pagetable or non-pagetable memory.   For example, during d= om0/domU initialisation, the guest OS will query the e820 bios mechanism for= physical memory  availability, and the guest OS (paravirt or HVM) will= then assign different parts of the physical memory for pagetable constructi= on.   Then after all the pagetable is completely constructed, the = CR3 is loaded, which started the hardware MMU operation.    S= o therefore, before the CR3 is loaded the entire physical memory is marked a= s readonly, and after the CR3 is loaded, only those memory not involved in p= agetable mapping are unmarked readonly?

Does not seem right, as guest OS can change the CR3 anytime subsequently as= well.



--B_3272513652_15774288-- --===============1206097343== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1206097343==--