From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v2] x86: avoid flush IPI when possible Date: Wed, 17 Feb 2016 14:48:41 +0000 Message-ID: <56C48849.4000801@citrix.com> References: <56C304A502000078000D2879@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.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aW3PK-0006eJ-Ia for xen-devel@lists.xenproject.org; Wed, 17 Feb 2016 14:48:46 +0000 In-Reply-To: <56C304A502000078000D2879@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 16/02/16 10:14, Jan Beulich wrote: > --- a/xen/arch/x86/smp.c > +++ b/xen/arch/x86/smp.c > @@ -205,26 +205,30 @@ static unsigned int flush_flags; > > void invalidate_interrupt(struct cpu_user_regs *regs) > { > + unsigned int flags = flush_flags; > ack_APIC_irq(); > perfc_incr(ipis); > - if ( !__sync_local_execstate() || > - (flush_flags & (FLUSH_TLB_GLOBAL | FLUSH_CACHE)) ) > - flush_area_local(flush_va, flush_flags); > + if ( __sync_local_execstate() ) > + flags &= ~FLUSH_TLB; If a switch happened, write_ptbase() also flushed global mappings. I believe you can also mask out FLUSH_TLB_GLOBAL here. Otherwise, the rest looks ok. Reviewed-by: Andrew Cooper