From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 1/3] x86/mmuext: tighten TLB flush address checks Date: Wed, 20 Jan 2016 14:23:47 +0000 Message-ID: <569F9873.2030404@citrix.com> References: <569FA12902000078000C91C7@prv-mh.provo.novell.com> <569FA23E02000078000C91E6@prv-mh.provo.novell.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 1aLtfs-0005Ts-6F for xen-devel@lists.xenproject.org; Wed, 20 Jan 2016 14:23:52 +0000 In-Reply-To: <569FA23E02000078000C91E6@prv-mh.provo.novell.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: Jan Beulich , xen-devel Cc: Keir Fraser List-Id: xen-devel@lists.xenproject.org On 20/01/16 14:05, Jan Beulich wrote: > Addresses passed by PV guests should be subjected to __addr_ok(), > avoiding undue TLB flushes; . > > Signed-off-by: Jan Beulich > > --- a/xen/arch/x86/mm.c > +++ b/xen/arch/x86/mm.c > @@ -3268,8 +3268,9 @@ long do_mmuext_op( > case MMUEXT_INVLPG_LOCAL: > if ( unlikely(d != pg_owner) ) > rc = -EPERM; > - else if ( !paging_mode_enabled(d) || > - paging_invlpg(curr, op.arg1.linear_addr) != 0 ) > + else if ( !paging_mode_enabled(d) > + ? __addr_ok(op.arg1.linear_addr) > + : paging_invlpg(curr, op.arg1.linear_addr) ) paging_mode_enabled() changes depending on whether the guest has logdirty currently enabled. As you have also patched paging_invlpg() to DTRT with __addr_ok(), I think this hunk can be dropped. Everything else, Reviewed-by: Andrew Cooper