From: Tim Deegan Subject: Re: [PATCH 01/10] VMX: Enable EPT A/D bit support Date: Fri, 10 Apr 2015 10:51:50 +0100 Message-ID: <20150410095150.GF12937@deinos.phlegethon.org> References: <1427423754-11841-1-git-send-email-kai.huang@linux.intel.com> <1427423754-11841-2-git-send-email-kai.huang@linux.intel.com> <20150409112125.GE17031@deinos.phlegethon.org> <5527707A.9070906@linux.intel.com> <20150410085401.GA12937@deinos.phlegethon.org> <55279745.9080504@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <55279745.9080504@linux.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Kai Huang Cc: yang.z.zhang@intel.com, andrew.cooper3@citrix.com, kevin.tian@intel.com, jbeulich@suse.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org At 17:26 +0800 on 10 Apr (1428686789), Kai Huang wrote: > > > On 04/10/2015 04:54 PM, Tim Deegan wrote: > > At 14:40 +0800 on 10 Apr (1428676858), Kai Huang wrote: > >>> In fact, thinking about that, we should probably be setting _all_ the > >>> A bits to 1, even in leaf entries, to avoid the overhead of the MMU > >>> having to write them later. > >> I suppose you mean A bits of leaf entries of new shattered 4K pages? Yes > >> we can, but looks it's more reasonable to inherit according to original > >> A bit of super page. > > Yes, inheriting is best, but we should have already set the A bit of the > > superpage to 1 as well, for the same reasons. IOW we should set every A > > bit in the whole system to 1 all the time. > > > > BTW, this is what we do with A/D bits in normal pagetables in Xen too > > -- the default is to set them all the time, so the MMU doesn't have to > > fix them up later. > Sure then we can set all A bit to 1, which can be done by setting A bit > properly in ept_p2m_type_to_flags I think. > > What does normal pagetables mean here? I don't think you mean shadow > page table, as shadow page table needs to sync A/D bits with guest > table, right? I meant xen's own pagetables, that it maps its own text and data with. But IIRC we also set the Accessed bit in all shadow pagetable entries -- fixing up the A/D bits in the guest PTEs happens in the pagefault handler. Tim.