From: Ingo Molnar <mingo@kernel.org>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Kate Stewart <kstewart@linuxfoundation.org>,
andrea.parri@amarulasolutions.com, linux-efi@vger.kernel.org,
brijesh.singh@amd.com, "J. Kiszka" <jan.kiszka@siemens.com>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Will Deacon <will.deacon@arm.com>,
jarkko.sakkinen@linux.intel.com,
virtualization@lists.linux-foundation.org,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Manoj Gupta <manojgupta@google.com>,
hpa@zytor.com, boris.ostrovsky@oracle.com,
Thiebaud Weksteen <tweek@google.com>,
mawilcox@microsoft.com, x86@kernel.org, akataria@vmware.com,
Greg Hackmann <ghackmann@google.com>,
mingo@redhat.com, Alistair Strachan <astrachan@google.com>,
David Rientjes <rientjes@google.com>,
geert@linux-m68k.org, thomas.lendacky@amd.com,
Arnd Bergmann <arnd@arndb.de>,
Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
Philippe Ombredanne <pombredanne@nexb.com>,
rostedt@goodmis.org
Subject: Re: [PATCH v6 3/3] x86: paravirt: make native_save_fl extern inline
Date: Tue, 26 Jun 2018 09:13:25 +0200 [thread overview]
Message-ID: <20180626071325.GA25751@gmail.com> (raw)
In-Reply-To: <CAKwvOdn5gnB5cK=cy6weKyxAn4SNEdZTT_MtT_D_nHRG5EDZ4g@mail.gmail.com>
* Nick Desaulniers <ndesaulniers@google.com> wrote:
> On Thu, Jun 21, 2018 at 7:24 PM Ingo Molnar <mingo@kernel.org> wrote:
> > * Nick Desaulniers <ndesaulniers@google.com> 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 <native_save_fl>:
> 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 <native_save_fl>:
> 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 <mingo@kernel.org>
What's the planned upstreaming route for these patches/fixes?
Thanks,
Ingo
next prev parent reply other threads:[~2018-06-26 7:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180621162324.36656-1-ndesaulniers@google.com>
[not found] ` <20180621162324.36656-4-ndesaulniers@google.com>
2018-06-22 2:24 ` [PATCH v6 3/3] x86: paravirt: make native_save_fl extern inline Ingo Molnar
[not found] ` <CAKwvOdn5gnB5cK=cy6weKyxAn4SNEdZTT_MtT_D_nHRG5EDZ4g@mail.gmail.com>
2018-06-26 7:13 ` Ingo Molnar [this message]
[not found] ` <CAKwvOdnW9r=pgmodEL0VXCv=PZVt_WMCA+B5x4D5oKRM1y-0Ow@mail.gmail.com>
2018-07-03 7:21 ` Juergen Gross
2018-07-13 10:16 ` David Laight
[not found] ` <CAKwvOdmFVnSos71vAUnayuocBDhxLg76tvGF0y3sj+4+s7TCcw@mail.gmail.com>
2018-07-17 8:44 ` David Laight
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180626071325.GA25751@gmail.com \
--to=mingo@kernel.org \
--cc=akataria@vmware.com \
--cc=andrea.parri@amarulasolutions.com \
--cc=arnd@arndb.de \
--cc=astrachan@google.com \
--cc=boris.ostrovsky@oracle.com \
--cc=brijesh.singh@amd.com \
--cc=geert@linux-m68k.org \
--cc=ghackmann@google.com \
--cc=hpa@zytor.com \
--cc=jan.kiszka@siemens.com \
--cc=jarkko.sakkinen@linux.intel.com \
--cc=jpoimboe@redhat.com \
--cc=kstewart@linuxfoundation.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=manojgupta@google.com \
--cc=mawilcox@microsoft.com \
--cc=mingo@redhat.com \
--cc=ndesaulniers@google.com \
--cc=pombredanne@nexb.com \
--cc=rientjes@google.com \
--cc=rostedt@goodmis.org \
--cc=thomas.lendacky@amd.com \
--cc=tweek@google.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=will.deacon@arm.com \
--cc=x86@kernel.org \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).