From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: [V9 PATCH 6/8] pvh dom0: Add and remove foreign pages Date: Fri, 25 Apr 2014 17:06:07 -0700 Message-ID: <20140425170607.01e2aedd@mantra.us.oracle.com> References: <1397607172-32065-1-git-send-email-mukesh.rathor@oracle.com> <1397607172-32065-7-git-send-email-mukesh.rathor@oracle.com> <534EC5430200007800009ADD@nat28.tlf.novell.com> <20140416183742.50a98472@mantra.us.oracle.com> <534F95E00200007800009D40@nat28.tlf.novell.com> <20140417123653.GA25395@deinos.phlegethon.org> <534FFA32020000780000A077@nat28.tlf.novell.com> <20140423192151.0b05a91b@mantra.us.oracle.com> <20140424094641.GA48969@deinos.phlegethon.org> <20140424190925.62843681@mantra.us.oracle.com> <535A219B020000780000C247@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wdq8O-0002H4-PA for xen-devel@lists.xenproject.org; Sat, 26 Apr 2014 00:06:25 +0000 In-Reply-To: <535A219B020000780000C247@nat28.tlf.novell.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: Jan Beulich Cc: George.Dunlap@eu.citrix.com, Tim Deegan , eddie.dong@intel.com, keir.xen@gmail.com, jun.nakajima@intel.com, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Fri, 25 Apr 2014 07:49:31 +0100 "Jan Beulich" wrote: > >>> On 25.04.14 at 04:09, wrote: > > Ok, how about something like shown further below? (I think > > it would be more simpler to have one atomic_write ops, instead of > > two) > > That's an understandable desire, but ... > > > +/* returns : 0 for success, -errno otherwise */ > > +static int atomic_write_ept_entry(ept_entry_t *entryptr, > > ept_entry_t new) +{ > > + unsigned long oldmfn; > > + struct domain *fdom; > > + bool_t new_foreign = p2m_is_foreign(new.sa_p2mt); > > + bool_t old_foreign = p2m_is_foreign(entryptr->sa_p2mt); > > ... these aren't really valid for intermediate entries (they just end > up getting p2m_ram_rw put into them right now, but that's in no way > explicit, and hence not set in stone). As said before, I can see the > need to use these fields eventually, so this would end up being a > latent problem. Hence minimally I'd want you to explicitly set the > field in ept_set_middle_entry() to make clear that we now depend on > it having a certain value. BTW, one thing that is confusing looking at the code is : ept_memory_type_changed() calls ept_invalidate_emt with PML4 mfn. ept_invalidate_emt walks l4 entries checking for emt and doing atomic_write_ept_entry on l4 entries. However, looking at latest intel SDM figure 28-1, vol 3b, it appears those bits are reserved? EPT MT is only valid for L3, l2 and l1. What am I missing? thanks mukesh