From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Molnar Subject: Re: [PATCH v6 3/3] x86: paravirt: make native_save_fl extern inline Date: Tue, 26 Jun 2018 09:13:25 +0200 Message-ID: <20180626071325.GA25751@gmail.com> References: <20180621162324.36656-1-ndesaulniers@google.com> <20180621162324.36656-4-ndesaulniers@google.com> <20180622022402.GA24194@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Nick Desaulniers Cc: Kate Stewart , andrea.parri@amarulasolutions.com, linux-efi@vger.kernel.org, brijesh.singh@amd.com, "J. Kiszka" , Josh Poimboeuf , Will Deacon , jarkko.sakkinen@linux.intel.com, virtualization@lists.linux-foundation.org, Masahiro Yamada , Manoj Gupta , hpa@zytor.com, boris.ostrovsky@oracle.com, Thiebaud Weksteen , mawilcox@microsoft.com, x86@kernel.org, akataria@vmware.com, Greg Hackmann , mingo@redhat.com, Alistair Strachan , David Rientjes , geert@linux-m68k.org, thomas.lendacky@amd.com, Arnd Bergmann , Linux Kbuild mailing list , Philippe Ombredanne , rostedt@goodmis.org List-Id: virtualization@lists.linuxfoundation.org * Nick Desaulniers wrote: > On Thu, Jun 21, 2018 at 7:24 PM Ingo Molnar wrote: > > * Nick Desaulniers wrote: > > > > > native_save_fl() is marked static inline, but by using it as > > > a function pointer in arch/x86/kernel/paravirt.c, it MUST be outlined. > > > > > --- a/arch/x86/include/asm/irqflags.h > > > +++ b/arch/x86/include/asm/irqflags.h > > > @@ -13,7 +13,7 @@ > > > * Interrupt control: > > > */ > > > > > > -static inline unsigned long native_save_fl(void) > > > +extern inline unsigned long native_save_fl(void) > > > { > > > unsigned long flags; > > > > > > > What's the code generation effect of this on say a defconfig kernel vmlinux with > > paravirt enabled? > > Starting with this patch set applied: > $ make CC=gcc-8 -j46 > $ objdump -d vmlinux | grep native_save_fl --context=3 > ffffffff81059140 : > ffffffff81059140: 9c pushfq > ffffffff81059141: 58 pop %rax > ffffffff81059142: c3 retq > $ git checkout HEAD~3 > $ make CC=gcc-8 -j46 > $ objdump -d vmlinux | grep native_save_fl --context=3 > ffffffff81079410 : > ffffffff81079410: 9c pushfq > ffffffff81079411: 58 pop %rax > ffffffff81079412: c3 retq > > Mainly, this is to prevent the compiler from adding a stack protector > to the outlined version, as the stack protector clobbers %rcx, but > paravirt expects %rcx to be preserved. More info can be found: > https://lkml.org/lkml/2018/5/24/1242-- Ok! Acked-by: Ingo Molnar What's the planned upstreaming route for these patches/fixes? Thanks, Ingo