From: "Jan Beulich" Subject: Re: [PATCHv1 1/3] x86/ept: remove unnecessary sync after resolving misconfigured entries Date: Thu, 12 Nov 2015 09:30:20 -0700 Message-ID: <5644CCAD02000078000B4606@prv-mh.provo.novell.com> References: <1446831437-5897-1-git-send-email-david.vrabel@citrix.com> <1446831437-5897-2-git-send-email-david.vrabel@citrix.com> <5641EF9D02000078000B35B4@prv-mh.provo.novell.com> <5644BBDE.3000007@cantab.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZwulU-0006b3-N5 for xen-devel@lists.xenproject.org; Thu, 12 Nov 2015 16:30:24 +0000 In-Reply-To: <5644BBDE.3000007@cantab.net> 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: David Vrabel , David Vrabel Cc: Andrew Cooper , Kevin Tian , Jun Nakajima , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org >>> On 12.11.15 at 17:18, wrote: > > On 10/11/2015 12:22, Jan Beulich wrote: >>>>> On 06.11.15 at 18:37, wrote: >>> --- a/xen/arch/x86/mm/p2m-ept.c >>> +++ b/xen/arch/x86/mm/p2m-ept.c >>> @@ -644,7 +644,6 @@ bool_t ept_handle_misconfig(uint64_t gpa) >>> spurious = curr->arch.hvm_vmx.ept_spurious_misconfig; >>> rc = resolve_misconfig(p2m, PFN_DOWN(gpa)); >>> curr->arch.hvm_vmx.ept_spurious_misconfig = 0; >>> - ept_sync_domain(p2m); >>> >>> p2m_unlock(p2m); >>> >>> @@ -692,12 +691,7 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn, >>> /* Carry out any eventually pending earlier changes first. */ >>> ret = resolve_misconfig(p2m, gfn); >>> if ( ret < 0 ) >>> - { >>> - ept_sync_domain(p2m); >> >> Is avoiding this sync really a win? It shouldn't be needed according >> to your analysis, I agree, but if it doesn't do any harm I'd prefer it >> to be kept (and the deletion above to be converted to a similar, >> conditional sync too). After all there also shouldn't be any error >> here, yet if there was one, wanting to be on the safe side calls for >> doing a sync imo. > > Unnecessary calls to ept_domain_sync() are confusing. Again - if there was an error, how do you know it's unnecessary? But anyway - I'll let the VM maintainers decide. Jan