Thread (1 message) 1 message, 1 author, 2018-06-26

Re: [PATCH v6 3/3] x86: paravirt: make native_save_fl extern inline

From: Ingo Molnar <mingo@kernel.org>
Date: 2018-06-26 07:13:36
Also in: linux-efi, linux-kbuild, lkml

* Nick Desaulniers [off-list ref] wrote:
On Thu, Jun 21, 2018 at 7:24 PM Ingo Molnar [off-list ref] wrote:
quoted
* Nick Desaulniers [off-list ref] wrote:
quoted
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.
quoted
--- 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help