From: "Jan Beulich" Subject: Re: [V9 PATCH 6/8] pvh dom0: Add and remove foreign pages Date: Fri, 25 Apr 2014 07:49:31 +0100 Message-ID: <535A219B020000780000C247@nat28.tlf.novell.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> 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 1WdZwz-00081o-DN for xen-devel@lists.xenproject.org; Fri, 25 Apr 2014 06:49:33 +0000 In-Reply-To: <20140424190925.62843681@mantra.us.oracle.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Mukesh Rathor , Tim Deegan Cc: George.Dunlap@eu.citrix.com, xen-devel@lists.xenproject.org, keir.xen@gmail.com, eddie.dong@intel.com, jun.nakajima@intel.com List-Id: xen-devel@lists.xenproject.org >>> 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. Jan