From: Keir Fraser Subject: Re: Readonly memory for guest domain Date: Wed, 12 Sep 2007 08:28:47 +0100 Message-ID: References: <00ca01c7f4db$69d991f0$9a010a0a@eeyore> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1650889059==" Return-path: In-Reply-To: <00ca01c7f4db$69d991f0$9a010a0a@eeyore> 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 , 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. --===============1650889059== Content-type: multipart/alternative; boundary="B_3272430529_15456777" > 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_3272430529_15456777 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit 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. -- Keir On 12/9/07 02:22, "Peter Teoh" wrote: > Current Xen design is that the guest domain have readonly access to the memory > mapped for them. Documentation say it is not safe for them to be writable. > Why? > > Is it so as to trigger a trap exception whenever writing is made to it? This > is the optimal answer :-). > > And since it is not "safe" what checks are done in Xen hypervisor against > these "dangers", ie, enumerate the potential dangers? I cannot think of any, > as a newbie in Xen. My logic is that if the pages have been assigned as > owned by a domain, just let it do whatever it wants to, and so therefore > should not trigger any privilege trap condition (or VM exit condition, in the > HVM case). > > In the traditional Linux model, once a memory is mapped for user process, > non-root user included, it can be mapped as writable. So why is this > discrepancy in the case of Xen? > > By taking away this readonly restriction, I think Xen hypervisor will have a > lot of performance to gain. > > Please share your thoughts? Apologies for the questions from a newbie. > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel --B_3272430529_15456777 Content-type: text/html; charset="US-ASCII" Content-transfer-encoding: quoted-printable Re: [Xen-devel] Readonly memory for guest domain Xen d= oes not have this general read-only restriction. It does force page tables t= o be read-only, otherwise a guest could grant itself access to arbitrary mem= ory that it does not own.

 -- Keir


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

Current Xen design is that the guest domain have readon= ly access to the memory mapped for them.   Documentation say it is= not safe for them to be writable.   Why?
 
Is it so as to trigger a trap exception whenever writing is made to it? &nb= sp; This is the optimal answer :-).
 
And since it is not "safe" what checks are done in Xen hypervisor= against these "dangers", ie, enumerate the potential dangers? &nb= sp; I cannot think of any, as a newbie in Xen.   My logic is = that if the pages have been assigned as owned by a domain, just let it do wh= atever it wants to, and so therefore should not trigger any privilege trap c= ondition (or VM exit condition, in the HVM case).
 
In the traditional Linux model, once a memory is mapped for user process, n= on-root  user included, it can be mapped as writable.   So wh= y is this discrepancy in the case of Xen?
 
By taking away this readonly restriction, I think Xen hypervisor will have = a lot of performance to gain.   
 
Please share your thoughts?   Apologies for the questions from a = newbie.


____________________= ___________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/x= en-devel

--B_3272430529_15456777-- --===============1650889059== 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 --===============1650889059==--