From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCHv4 1/2] x86/ept: invalidate guest physical mappings on VMENTER Date: Mon, 14 Dec 2015 15:00:33 +0000 Message-ID: <566ED991.9030906@citrix.com> References: <1450103946-14232-1-git-send-email-david.vrabel@citrix.com> <1450103946-14232-2-git-send-email-david.vrabel@citrix.com> <566ED7CB.4090009@citrix.com> 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 1a8UcB-0005uK-Fe for xen-devel@lists.xenproject.org; Mon, 14 Dec 2015 15:00:39 +0000 In-Reply-To: <566ED7CB.4090009@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: Andrew Cooper , xen-devel@lists.xenproject.org Cc: George Dunlap , Kevin Tian , Tim Deegan , Jan Beulich , Jun Nakajima List-Id: xen-devel@lists.xenproject.org On 14/12/15 14:52, Andrew Cooper wrote: > On 14/12/15 14:39, David Vrabel wrote: >> diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c >> index eef0372..6e0cf89 100644 >> --- a/xen/arch/x86/mm/p2m-ept.c >> +++ b/xen/arch/x86/mm/p2m-ept.c [...] >> + on_selected_cpus(d->domain_dirty_cpumask, >> __ept_sync_domain, p2m, 1); > > You can drop __ept_sync_domain() entirely by using > smp_send_event_check_mask() instead, which is a no-op IPI (and slightly > less overhead while holding the IPI lock). We need to wait until the IPI has been handled on the remote PCPUs since we may immediately free a page table page. If a VCPU was still running it may use paging-structure-cache entries referring to that freed page. >> - cpumask_var_t synced_mask; >> + cpumask_var_t invalidate; > > Could you include a small comment here to describe the behaviour? Perhaps: > > /* Whether an INVEPT should be issued on VMENTER? */ Good point. David