From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCHv4 1/2] x86/ept: invalidate guest physical mappings on VMENTER Date: Mon, 14 Dec 2015 15:39:57 +0000 Message-ID: <566EE2CD.4040000@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> <566ED991.9030906@citrix.com> <566EDB9F.3070400@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 1a8VEJ-00089D-E1 for xen-devel@lists.xenproject.org; Mon, 14 Dec 2015 15:40:03 +0000 In-Reply-To: <566EDB9F.3070400@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 , David Vrabel , 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 15:09, Andrew Cooper wrote: > On 14/12/15 15:00, David Vrabel wrote: >> 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. > > Ah yes. Better not do that. > > As some future cleanup it would be nice to be able to do this without > specifying a function, but that is a minor detail and not relevant to > this patch. This is exactly the conclusion I came to when reviewing v3 of this series. Actually calling __ept_sync_domain() is unnecessary, but at that point you might as well. -George