Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753135AbcLFKIp (ORCPT ); Tue, 6 Dec 2016 05:08:45 -0500 Received: from merlin.infradead.org ([205.233.59.134]:36186 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752863AbcLFKIl (ORCPT ); Tue, 6 Dec 2016 05:08:41 -0500 Date: Tue, 6 Dec 2016 10:25:20 +0100 From: Peter Zijlstra To: Jan Beulich Cc: Andy Lutomirski , Borislav Petkov , Andrew Cooper , Brian Gerst , Matthew Whitehead , Henrique de Moraes Holschuh , x86@kernel.org, xen-devel , One Thousand Gnomes , Boris Ostrovsky , Juergen Gross , "linux-kernel@vger.kernel.org" , "H. Peter Anvin" Subject: Re: [Xen-devel] [PATCH v3 4/4] x86/asm: Rewrite sync_core() to use IRET-to-self Message-ID: <20161206092520.GX3092@twins.programming.kicks-ass.net> References: <584688FD02000078001257BB@prv-mh.provo.novell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <584688FD02000078001257BB@prv-mh.provo.novell.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 631 Lines: 18 On Tue, Dec 06, 2016 at 01:46:37AM -0700, Jan Beulich wrote: > > + asm volatile ( > > + "pushfl\n\t" > > + "pushl %%cs\n\t" > > + "pushl $1f\n\t" > > + "iret\n\t" > > + "1:" > > + : "+r" (__sp) : : "cc", "memory"); > > I don't thing EFLAGS (i.e. "cc") gets modified anywhere here. And > the memory clobber would perhaps better be pulled out into an > explicit barrier() invocation (making it more obvious what it's needed > for)? EVerything that implies a memory barrier (and I think serializing instructions do that) also imply a compiler barrier. Not doing the memory clobber gets you inconsistency wrt everything else.