All of lore.kernel.org
 help / color / mirror / Atom feed
* [tip:x86/pti 19/20] arch/x86/entry/entry_64.o: warning: objtool: paranoid_entry()+0x11: call without frame pointer save/setup
@ 2018-02-12 11:33 kbuild test robot
  2018-02-12 13:13 ` Josh Poimboeuf
  2018-02-12 17:45 ` [PATCH] x86/entry/64: Fix paranoid_entry() frame pointer warning Josh Poimboeuf
  0 siblings, 2 replies; 4+ messages in thread
From: kbuild test robot @ 2018-02-12 11:33 UTC (permalink / raw)
  To: Dominik Brodowski; +Cc: kbuild-all, linux-kernel, tipbuild, Ingo Molnar

[-- Attachment #1: Type: text/plain, Size: 842 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/pti
head:   5a10e729bc0aa9420a23a70b169eadd229c27bc1
commit: f09d160992d129b6d8fada7543761d40f5b33596 [19/20] x86/entry/64: Get rid of the ALLOC_PT_GPREGS_ON_STACK and SAVE_AND_CLEAR_REGS macros
config: x86_64-randconfig-s0-02121550 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
        git checkout f09d160992d129b6d8fada7543761d40f5b33596
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

>> arch/x86/entry/entry_64.o: warning: objtool: paranoid_entry()+0x11: call without frame pointer save/setup

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25490 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [tip:x86/pti 19/20] arch/x86/entry/entry_64.o: warning: objtool: paranoid_entry()+0x11: call without frame pointer save/setup
  2018-02-12 11:33 [tip:x86/pti 19/20] arch/x86/entry/entry_64.o: warning: objtool: paranoid_entry()+0x11: call without frame pointer save/setup kbuild test robot
@ 2018-02-12 13:13 ` Josh Poimboeuf
  2018-02-12 17:45 ` [PATCH] x86/entry/64: Fix paranoid_entry() frame pointer warning Josh Poimboeuf
  1 sibling, 0 replies; 4+ messages in thread
From: Josh Poimboeuf @ 2018-02-12 13:13 UTC (permalink / raw)
  To: kbuild test robot
  Cc: Dominik Brodowski, kbuild-all, linux-kernel, tipbuild, Ingo Molnar

On Mon, Feb 12, 2018 at 07:33:27PM +0800, kbuild test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/pti
> head:   5a10e729bc0aa9420a23a70b169eadd229c27bc1
> commit: f09d160992d129b6d8fada7543761d40f5b33596 [19/20] x86/entry/64: Get rid of the ALLOC_PT_GPREGS_ON_STACK and SAVE_AND_CLEAR_REGS macros
> config: x86_64-randconfig-s0-02121550 (attached as .config)
> compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
> reproduce:
>         git checkout f09d160992d129b6d8fada7543761d40f5b33596
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 
> 
> All warnings (new ones prefixed by >>):
> 
> >> arch/x86/entry/entry_64.o: warning: objtool: paranoid_entry()+0x11: call without frame pointer save/setup
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Oops, looks like one of my suggested unwind hint changes wasn't so good
for the frame pointer case.  The below should fix it.  I'll submit a
proper patch in a little bit after running it through 0-day.

diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index cfbf43366731..1c54204207d8 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -1128,6 +1128,7 @@ idtentry machine_check		do_mce			has_error_code=0	paranoid=1
  * Return: ebx=0: need swapgs on exit, ebx=1: otherwise
  */
 ENTRY(paranoid_entry)
+	UNWIND_HINT_FUNC
 	cld
 	movl	$1, %ebx
 	movl	$MSR_GS_BASE, %ecx
@@ -1141,7 +1142,7 @@ ENTRY(paranoid_entry)
 	SAVE_AND_SWITCH_TO_KERNEL_CR3 scratch_reg=%rax save_reg=%r14
 
 	ret
-ENDPROC(paranoid_entry)
+END(paranoid_entry)
 
 /*
  * "Paranoid" exit path from exception stack.  This is invoked

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] x86/entry/64: Fix paranoid_entry() frame pointer warning
  2018-02-12 11:33 [tip:x86/pti 19/20] arch/x86/entry/entry_64.o: warning: objtool: paranoid_entry()+0x11: call without frame pointer save/setup kbuild test robot
  2018-02-12 13:13 ` Josh Poimboeuf
@ 2018-02-12 17:45 ` Josh Poimboeuf
  2018-02-13  9:03   ` [tip:x86/pti] " tip-bot for Josh Poimboeuf
  1 sibling, 1 reply; 4+ messages in thread
From: Josh Poimboeuf @ 2018-02-12 17:45 UTC (permalink / raw)
  To: kbuild test robot
  Cc: Dominik Brodowski, kbuild-all, linux-kernel, tipbuild, Ingo Molnar

With the following commit:

  f09d160992d1 ("x86/entry/64: Get rid of the ALLOC_PT_GPREGS_ON_STACK and SAVE_AND_CLEAR_REGS macros")

... one of my suggested improvements triggered a frame pointer warning:

  arch/x86/entry/entry_64.o: warning: objtool: paranoid_entry()+0x11: call without frame pointer save/setup

The warning is correct for the build-time code, but it's actually not
relevant at runtime because of paravirt patching.  The paravirt swapgs
call gets replaced with either a SWAPGS instruction or NOPs at runtime.

Go back to the previous behavior by removing the ELF function annotation
for paranoid_entry() and adding an unwind hint, which effectively
silences the warning.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Fixes: f09d160992d1 ("x86/entry/64: Get rid of the ALLOC_PT_GPREGS_ON_STACK and SAVE_AND_CLEAR_REGS macros")
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
 arch/x86/entry/entry_64.S | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index cfbf43366731..1c54204207d8 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -1128,6 +1128,7 @@ idtentry machine_check		do_mce			has_error_code=0	paranoid=1
  * Return: ebx=0: need swapgs on exit, ebx=1: otherwise
  */
 ENTRY(paranoid_entry)
+	UNWIND_HINT_FUNC
 	cld
 	movl	$1, %ebx
 	movl	$MSR_GS_BASE, %ecx
@@ -1141,7 +1142,7 @@ ENTRY(paranoid_entry)
 	SAVE_AND_SWITCH_TO_KERNEL_CR3 scratch_reg=%rax save_reg=%r14
 
 	ret
-ENDPROC(paranoid_entry)
+END(paranoid_entry)
 
 /*
  * "Paranoid" exit path from exception stack.  This is invoked
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [tip:x86/pti] x86/entry/64: Fix paranoid_entry() frame pointer warning
  2018-02-12 17:45 ` [PATCH] x86/entry/64: Fix paranoid_entry() frame pointer warning Josh Poimboeuf
@ 2018-02-13  9:03   ` tip-bot for Josh Poimboeuf
  0 siblings, 0 replies; 4+ messages in thread
From: tip-bot for Josh Poimboeuf @ 2018-02-13  9:03 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, linux, hpa, fengguang.wu, linux-kernel, mingo, peterz,
	jpoimboe, torvalds

Commit-ID:  b3ccefaed922529e6a67de7b30af5aa38c76ace9
Gitweb:     https://git.kernel.org/tip/b3ccefaed922529e6a67de7b30af5aa38c76ace9
Author:     Josh Poimboeuf <jpoimboe@redhat.com>
AuthorDate: Mon, 12 Feb 2018 11:45:03 -0600
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 13 Feb 2018 09:04:55 +0100

x86/entry/64: Fix paranoid_entry() frame pointer warning

With the following commit:

  f09d160992d1 ("x86/entry/64: Get rid of the ALLOC_PT_GPREGS_ON_STACK and SAVE_AND_CLEAR_REGS macros")

... one of my suggested improvements triggered a frame pointer warning:

  arch/x86/entry/entry_64.o: warning: objtool: paranoid_entry()+0x11: call without frame pointer save/setup

The warning is correct for the build-time code, but it's actually not
relevant at runtime because of paravirt patching.  The paravirt swapgs
call gets replaced with either a SWAPGS instruction or NOPs at runtime.

Go back to the previous behavior by removing the ELF function annotation
for paranoid_entry() and adding an unwind hint, which effectively
silences the warning.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: kbuild-all@01.org
Cc: tipbuild@zytor.com
Fixes: f09d160992d1 ("x86/entry/64: Get rid of the ALLOC_PT_GPREGS_ON_STACK and SAVE_AND_CLEAR_REGS macros")
Link: http://lkml.kernel.org/r/20180212174503.5acbymg5z6p32snu@treble
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/entry/entry_64.S | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index cfbf433..1c5420420 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -1128,6 +1128,7 @@ idtentry machine_check		do_mce			has_error_code=0	paranoid=1
  * Return: ebx=0: need swapgs on exit, ebx=1: otherwise
  */
 ENTRY(paranoid_entry)
+	UNWIND_HINT_FUNC
 	cld
 	movl	$1, %ebx
 	movl	$MSR_GS_BASE, %ecx
@@ -1141,7 +1142,7 @@ ENTRY(paranoid_entry)
 	SAVE_AND_SWITCH_TO_KERNEL_CR3 scratch_reg=%rax save_reg=%r14
 
 	ret
-ENDPROC(paranoid_entry)
+END(paranoid_entry)
 
 /*
  * "Paranoid" exit path from exception stack.  This is invoked

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-13  9:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-12 11:33 [tip:x86/pti 19/20] arch/x86/entry/entry_64.o: warning: objtool: paranoid_entry()+0x11: call without frame pointer save/setup kbuild test robot
2018-02-12 13:13 ` Josh Poimboeuf
2018-02-12 17:45 ` [PATCH] x86/entry/64: Fix paranoid_entry() frame pointer warning Josh Poimboeuf
2018-02-13  9:03   ` [tip:x86/pti] " tip-bot for Josh Poimboeuf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.