From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: [PATCHv1 1/3] x86/ept: remove unnecessary sync after resolving misconfigured entries Date: Fri, 6 Nov 2015 17:37:15 +0000 Message-ID: <1446831437-5897-2-git-send-email-david.vrabel@citrix.com> References: <1446831437-5897-1-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZukxB-0002Kj-NX for xen-devel@lists.xenproject.org; Fri, 06 Nov 2015 17:37:33 +0000 In-Reply-To: <1446831437-5897-1-git-send-email-david.vrabel@citrix.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: xen-devel@lists.xenproject.org Cc: Andrew Cooper , Kevin Tian , Jan Beulich , David Vrabel , Jun Nakajima List-Id: xen-devel@lists.xenproject.org When using EPT, type changes are done with the following steps: 1. Set entry as invalid (misconfigured) by settings a reserved memory type. 2. Flush all EPT and combined translations (ept_sync_domain()). 3. Fixup misconfigured entries as required (on EPT_MISCONFIG vmexits or when explicitly setting an entry. Since resolve_misconfig() only updates entries that were misconfigured, there is no need to invalidate any translations since the hardware does not cache misconfigured translations (vol 3, section 28.3.2). Remove the unnecessary (and very expensive) ept_sync_domain() calls). Signed-off-by: David Vrabel --- xen/arch/x86/mm/p2m-ept.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c index 86440fc..a41d7d2 100644 --- 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); return ret; - } - if ( ret > 0 ) - needs_sync = sync_on; ASSERT((target == 2 && hap_has_1gb) || (target == 1 && hap_has_2mb) || -- 2.1.4