From: "Jan Beulich" Subject: Re: [V15 PATCH 1/2] pvh dom0: Add and remove foreign pages Date: Fri, 23 May 2014 08:20:01 +0100 Message-ID: <537F12C1020000780001535C@mail.emea.novell.com> References: <1400801431-31373-1-git-send-email-mukesh.rathor@oracle.com> <1400801431-31373-2-git-send-email-mukesh.rathor@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 1Wnjlq-0003gA-72 for xen-devel@lists.xenproject.org; Fri, 23 May 2014 07:20:04 +0000 In-Reply-To: <1400801431-31373-2-git-send-email-mukesh.rathor@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 Cc: George.Dunlap@eu.citrix.com, tim@xen.org, 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 23.05.14 at 01:30, wrote: > @@ -688,10 +754,12 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn, > ept_p2m_type_to_flags(&new_entry, p2mt, p2ma); > } > > - atomic_write_ept_entry(ept_entry, new_entry); > + rc = atomic_write_ept_entry(ept_entry, new_entry, target); > + if ( rc ) This should have unlikely() ... > + old_entry.epte = 0; > > /* Track the highest gfn for which we have ever had a valid mapping */ > - if ( p2mt != p2m_invalid && > + if ( rc == 0 && p2mt != p2m_invalid && ... and this would then better be "else if()". Both of which could be adjusted while committing. Beyond that all that's left is to have Tim's approval. Jan