From: "bo ma" Subject: Re: RE: EPT walks for guest page table Date: Tue, 25 Nov 2008 16:42:10 +0800 Message-ID: References: <0B53E02A2965CE4F9ADB38B34501A3A167DD2844@orsmsx505.amr.corp.intel.com> <20081124171901.GL25331@york.uk.xensource.com> <0B53E02A2965CE4F9ADB38B34501A3A167DD2934@orsmsx505.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1653587263==" Return-path: In-Reply-To: <0B53E02A2965CE4F9ADB38B34501A3A167DD2934@orsmsx505.amr.corp.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Nakajima, Jun" Cc: "xen-devel@lists.xensource.com" , Tim Deegan List-Id: xen-devel@lists.xenproject.org --===============1653587263== Content-Type: multipart/alternative; boundary="----=_Part_1732_13865183.1227602530885" ------=_Part_1732_13865183.1227602530885 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thank you Tim,Jun,Rajesh I am very confused about that. Rajesh said : EPT do not treat guest page-table walks as writes, mostly because, EPT do not have Accessed (A) and Dirty (D) bits. Tim said :The EPT docs talk about A/D-bit-setting being treated as a read-modify-write operation but don't say what happens if the bit is already set I am sure about it now.If the bit is already set,what happens? Is it also treated as a read-modify-write operation or only read operation? Jun said depending on the implementation.The implementations are not the same under different processors ? 2008/11/25 Nakajima, Jun > On 11/24/2008 9:19:01 AM, Tim Deegan wrote: > > Hi, > > > > At 09:10 -0800 on 24 Nov (1227517847), Nakajima, Jun wrote: > > > Even if the guest wants to read data or execute code, the guest page > > > table may need to be modified for the processor to set the A bit > > > when running with paging enabled. This means NPT or EPT needs to set > > > the W permission for the guest page table pages to avoid VM exits or > > > EPT violation. Depending on the implementation, the A bit may need > > > to be set upfront even if the translation turns to be invalid. > > > > I believe the question is whether, if all the A and D bits were > > already set, an EPT page walk would still fault if it did not have > > write access to the guest pagetable page. > > > > NPT documentation explicitly says that _all_ accesses made by the > > guest-pagetable walker are treated as writes, whether they actually > > write back to the guest pagetable or not. > > > > The EPT docs talk about A/D-bit-setting being treated as a > > read-modify-write operation but don't say what happens if the bit is > > already set. > > That's my point, depends on the implementation. Today I believe we avoid > such unnecessary writes to the guest page tables, but that may change in the > future. > > > > > Cheers, > > > > Tim. > > > > > Thanks, > > > Jun > > > --- > > > Intel Open Source Technology Center > > > From: bo ma [mailto:kyle.ma83@gmail.com] > > > Sent: Monday, November 24, 2008 1:37 AM > > > To: xen-devel@lists.xensource.com > > > Cc: Nakajima, Jun; Xin, Xiaohui > > > Subject: EPT walks for guest page table > > > > > > Hi, > > > > > > I am really confused about NPT walks for guest page table , and > > > eager to know the details about it. It is treated as data writes > > > even if the access itself is a code read in AMD NPT.I just want to > > > know : is it the same in EPT? > > > > > > Could anyone help me? I would like to know that very much Thank you > > > in advance > > > > > > Bo Ma > > > > > _______________________________________________ > > > Xen-devel mailing list > > > Xen-devel@lists.xensource.com > > > http://lists.xensource.com/xen-devel > > > > -- > > Tim Deegan > > Principal Software Engineer, Citrix Systems (R&D) Ltd. > > [Company #02300071, SL9 0DZ, UK.] > . > Jun Nakajima | Intel Open Source Technology Center > ------=_Part_1732_13865183.1227602530885 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Thank you Tim,Jun,Rajesh
 
I am very confused about that.

Rajesh said : EPT do not treat guest page-table walks as writes, mostly because, EPT do not have Accessed (A) and Dirty (D) bits.
Tim said :The EPT docs talk about A/D-bit-setting being treated as a
read-modify-write operation but don't say what happens if the bit is
already set
 
I am sure about it now.If the bit is already set,what happens? Is it also treated as a read-modify-write operation or only read operation?
 
Jun said depending on the implementation.The implementations are not the same under different processors ?
 
2008/11/25 Nakajima, Jun <jun.nakajima@intel.com>
On 11/24/2008 9:19:01 AM, Tim Deegan wrote:
> Hi,
>
> At 09:10 -0800 on 24 Nov (1227517847), Nakajima, Jun wrote:
> > Even if the guest wants to read data or execute code, the guest page
> > table may need to be modified for the processor to set the A bit
> > when running with paging enabled. This means NPT or EPT needs to set
> > the W permission for the guest page table pages to avoid VM exits or
> > EPT violation. Depending on the implementation, the A bit may need
> > to be set upfront even if the translation turns to be invalid.
>
> I believe the question is whether, if all the A and D bits were
> already set, an EPT page walk would still fault if it did not have
> write access to the guest pagetable page.
>
> NPT documentation explicitly says that _all_ accesses made by the
> guest-pagetable walker are treated as writes, whether they actually
> write back to the guest pagetable or not.
>
> The EPT docs talk about A/D-bit-setting being treated as a
> read-modify-write operation but don't say what happens if the bit is
> already set.

That's my point, depends on the implementation. Today I believe we avoid such unnecessary writes to the guest page tables, but that may change in the future.

>
> Cheers,
>
> Tim.
>
> > Thanks,
> > Jun
> > ---
> > Intel Open Source Technology Center
> > From: bo ma [mailto:kyle.ma83@gmail.com]
> > Sent: Monday, November 24, 2008 1:37 AM
> > To: xen-devel@lists.xensource.com
> > Cc: Nakajima, Jun; Xin, Xiaohui
> > Subject: EPT walks for guest page table
> >
> > Hi,
> >
> > I am really confused about  NPT walks for guest page table , and
> > eager to know the details about it. It is  treated as data writes
> > even if the access itself is a code read in AMD NPT.I just want to
> > know : is it the same in EPT?
> >
> > Could anyone help me? I would like to know that very much Thank you
> > in advance
> >
> > Bo Ma
>
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xensource.com
> > http://lists.xensource.com/xen-devel
>
> --
> Tim Deegan <Tim.Deegan@citrix.com>
> Principal Software Engineer, Citrix Systems (R&D) Ltd.
> [Company #02300071, SL9 0DZ, UK.]
            .
Jun Nakajima | Intel Open Source Technology Center

------=_Part_1732_13865183.1227602530885-- --===============1653587263== 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 --===============1653587263==--