From: Tim Deegan Subject: Re: [PATCH] EPT: refine epte_present test Date: Thu, 19 Jan 2012 13:11:09 +0000 Message-ID: <20120119131109.GK66164@ocelot.phlegethon.org> References: <20120119110156.GA66164@ocelot.phlegethon.org> <0dbc3a25de46c81f6784cb4745137be6.squirrel@webmail.lagarcavilla.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <0dbc3a25de46c81f6784cb4745137be6.squirrel@webmail.lagarcavilla.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Andres Lagar-Cavilla Cc: andres@gridcentric.ca, xen-devel@lists.xensource.com, adin@gridcentric.ca List-Id: xen-devel@lists.xenproject.org At 04:58 -0800 on 19 Jan (1326949088), Andres Lagar-Cavilla wrote: > > Hi, > > > > I agree with the idea of this patch but: > > > >> +static inline bool_t is_epte_valid(ept_entry_t *e) > >> +{ > >> + ept_entry_t rights = { .epte = 0 }; > >> + > >> + /* Not valid if empty */ > >> + if (e->epte == 0) return 0; > >> + > >> + /* Not valid if mfn not valid */ > >> + if ( !mfn_valid(e->mfn) ) return 0; > >> + > >> + /* Not valid if rights different from those of > >> + * its p2m type and access combination */ > >> + ept_p2m_type_to_flags(&rights, e->sa_p2mt, e->access); > >> + if ( epte_permissions(&rights) != epte_permissions(e) ) > >> + return 0; > > > > This is a rather odd set of tests. Since we construct EPT pagetables > > ourselves, I think that we only need to test for uninitialised entries > > and explicitly invalid entries. > > > > Does this patch work for you? > > It will achieve the stated goal. I am curious as to whether we should > check for p2m_broken. In any case: > Acked-by: Andres Lagar-Cavilla Thanks. I've committed the patch as-is; I think in the current code p2m_ram_broken doesn't need a special case. Cheers, Tim.