linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] objtool: Fixes
@ 2022-04-08  9:45 Peter Zijlstra
  2022-04-08  9:45 ` [PATCH 1/4] lib/strn*,objtool: Enforce user_access_begin() rules Peter Zijlstra
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Peter Zijlstra @ 2022-04-08  9:45 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel, peterz, rick.p.edgecombe, jpoimboe

Fix various objtool whinges:

  lib/strnlen_user.o: warning: objtool: strnlen_user()+0x33: call to do_strnlen_user() with UACCESS enabled
  lib/strncpy_from_user.o: warning: objtool: strncpy_from_user()+0x33: call to do_strncpy_from_user() with UACCESS enabled

  vmlinux.o: warning: objtool: pvh_start_xen()+0x0: unreachable
  vmlinux.o: warning: objtool: start_secondary()+0x10e: unreachable
  vmlinux.o: warning: objtool: asm_exc_xen_unknown_trap()+0x16: unreachable instruction


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

* [PATCH 1/4] lib/strn*,objtool: Enforce user_access_begin() rules
  2022-04-08  9:45 [PATCH 0/4] objtool: Fixes Peter Zijlstra
@ 2022-04-08  9:45 ` Peter Zijlstra
  2022-04-08 14:09   ` Josh Poimboeuf
  2022-04-19 20:08   ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra
  2022-04-08  9:45 ` [PATCH 2/4] x86,xen,objtool: Add UNWIND hint Peter Zijlstra
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 13+ messages in thread
From: Peter Zijlstra @ 2022-04-08  9:45 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel, peterz, rick.p.edgecombe, jpoimboe, Thomas Gleixner

Apparently GCC can fail to inline a 'static inline' single caller
function:

  lib/strnlen_user.o: warning: objtool: strnlen_user()+0x33: call to do_strnlen_user() with UACCESS enabled
  lib/strncpy_from_user.o: warning: objtool: strncpy_from_user()+0x33: call to do_strncpy_from_user() with UACCESS enabled

Reported-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 lib/strncpy_from_user.c |    2 +-
 lib/strnlen_user.c      |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/lib/strncpy_from_user.c
+++ b/lib/strncpy_from_user.c
@@ -25,7 +25,7 @@
  * hit it), 'max' is the address space maximum (and we return
  * -EFAULT if we hit it).
  */
-static inline long do_strncpy_from_user(char *dst, const char __user *src,
+static __always_inline long do_strncpy_from_user(char *dst, const char __user *src,
 					unsigned long count, unsigned long max)
 {
 	const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS;
--- a/lib/strnlen_user.c
+++ b/lib/strnlen_user.c
@@ -20,7 +20,7 @@
  * if it fits in a aligned 'long'. The caller needs to check
  * the return value against "> max".
  */
-static inline long do_strnlen_user(const char __user *src, unsigned long count, unsigned long max)
+static __always_inline long do_strnlen_user(const char __user *src, unsigned long count, unsigned long max)
 {
 	const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS;
 	unsigned long align, res = 0;



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

* [PATCH 2/4] x86,xen,objtool: Add UNWIND hint
  2022-04-08  9:45 [PATCH 0/4] objtool: Fixes Peter Zijlstra
  2022-04-08  9:45 ` [PATCH 1/4] lib/strn*,objtool: Enforce user_access_begin() rules Peter Zijlstra
@ 2022-04-08  9:45 ` Peter Zijlstra
  2022-04-19 20:08   ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra
  2022-04-08  9:45 ` [PATCH 3/4] x86,objtool: Mark cpu_startup_entry() __noreturn Peter Zijlstra
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Peter Zijlstra @ 2022-04-08  9:45 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel, peterz, rick.p.edgecombe, jpoimboe, Thomas Gleixner

SYM_CODE_START*() doesn't get auto-validated and needs an UNWIND hint
to get checked, add one.

  vmlinux.o: warning: objtool: pvh_start_xen()+0x0: unreachable

Reported-by: Thomas Gleixner <tglx@linutronix.de>
Reported-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 arch/x86/platform/pvh/head.S |    1 +
 1 file changed, 1 insertion(+)

--- a/arch/x86/platform/pvh/head.S
+++ b/arch/x86/platform/pvh/head.S
@@ -50,6 +50,7 @@
 #define PVH_DS_SEL		(PVH_GDT_ENTRY_DS * 8)
 
 SYM_CODE_START_LOCAL(pvh_start_xen)
+	UNWIND_HINT_EMPTY
 	cld
 
 	lgdt (_pa(gdt))



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

* [PATCH 3/4] x86,objtool: Mark cpu_startup_entry() __noreturn
  2022-04-08  9:45 [PATCH 0/4] objtool: Fixes Peter Zijlstra
  2022-04-08  9:45 ` [PATCH 1/4] lib/strn*,objtool: Enforce user_access_begin() rules Peter Zijlstra
  2022-04-08  9:45 ` [PATCH 2/4] x86,xen,objtool: Add UNWIND hint Peter Zijlstra
@ 2022-04-08  9:45 ` Peter Zijlstra
  2022-04-11 20:32   ` Josh Poimboeuf
                     ` (2 more replies)
  2022-04-08  9:45 ` [PATCH 4/4] x86,objtool: Explicitly mark idtentry_body()s tail REACHABLE Peter Zijlstra
  2022-04-08 14:10 ` [PATCH 0/4] objtool: Fixes Josh Poimboeuf
  4 siblings, 3 replies; 13+ messages in thread
From: Peter Zijlstra @ 2022-04-08  9:45 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel, peterz, rick.p.edgecombe, jpoimboe

GCC-8 isn't clever enough to figure out that cpu_start_entry() is a
noreturn while objtool is. This results in code after the call in
start_secondary(). Give GCC a hand so that they all agree on things.

  vmlinux.o: warning: objtool: start_secondary()+0x10e: unreachable

Reported-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 include/linux/cpu.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -167,7 +167,7 @@ static inline int suspend_disable_second
 static inline void suspend_enable_secondary_cpus(void) { }
 #endif /* !CONFIG_PM_SLEEP_SMP */
 
-void cpu_startup_entry(enum cpuhp_state state);
+void __noreturn cpu_startup_entry(enum cpuhp_state state);
 
 void cpu_idle_poll_ctrl(bool enable);
 



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

* [PATCH 4/4] x86,objtool: Explicitly mark idtentry_body()s tail REACHABLE
  2022-04-08  9:45 [PATCH 0/4] objtool: Fixes Peter Zijlstra
                   ` (2 preceding siblings ...)
  2022-04-08  9:45 ` [PATCH 3/4] x86,objtool: Mark cpu_startup_entry() __noreturn Peter Zijlstra
@ 2022-04-08  9:45 ` Peter Zijlstra
  2022-04-19 20:08   ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra
  2022-04-08 14:10 ` [PATCH 0/4] objtool: Fixes Josh Poimboeuf
  4 siblings, 1 reply; 13+ messages in thread
From: Peter Zijlstra @ 2022-04-08  9:45 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel, peterz, rick.p.edgecombe, jpoimboe

Objtool can figure out that some \cfunc()s are noreturn and then
complains about certain instances having unreachable tails:

  vmlinux.o: warning: objtool: asm_exc_xen_unknown_trap()+0x16: unreachable instruction

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 arch/x86/entry/entry_64.S |    3 +++
 1 file changed, 3 insertions(+)

--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -337,6 +337,9 @@ SYM_CODE_END(ret_from_fork)
 
 	call	\cfunc
 
+	/* For some configurations \cfunc ends up being a noreturn. */
+	REACHABLE
+
 	jmp	error_return
 .endm
 



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

* Re: [PATCH 1/4] lib/strn*,objtool: Enforce user_access_begin() rules
  2022-04-08  9:45 ` [PATCH 1/4] lib/strn*,objtool: Enforce user_access_begin() rules Peter Zijlstra
@ 2022-04-08 14:09   ` Josh Poimboeuf
  2022-04-19 20:08   ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra
  1 sibling, 0 replies; 13+ messages in thread
From: Josh Poimboeuf @ 2022-04-08 14:09 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: x86, linux-kernel, rick.p.edgecombe, Thomas Gleixner

On Fri, Apr 08, 2022 at 11:45:53AM +0200, Peter Zijlstra wrote:
> Apparently GCC can fail to inline a 'static inline' single caller
> function:
> 
>   lib/strnlen_user.o: warning: objtool: strnlen_user()+0x33: call to do_strnlen_user() with UACCESS enabled
>   lib/strncpy_from_user.o: warning: objtool: strncpy_from_user()+0x33: call to do_strncpy_from_user() with UACCESS enabled
> 
> Reported-by: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>

Presumably because of

ifdef CONFIG_DEBUG_SECTION_MISMATCH
KBUILD_CFLAGS += -fno-inline-functions-called-once
endif

which I've been wanting to remove since its only true purpose seems to
be creating countless __always_inline patches...

-- 
Josh


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

* Re: [PATCH 0/4] objtool: Fixes
  2022-04-08  9:45 [PATCH 0/4] objtool: Fixes Peter Zijlstra
                   ` (3 preceding siblings ...)
  2022-04-08  9:45 ` [PATCH 4/4] x86,objtool: Explicitly mark idtentry_body()s tail REACHABLE Peter Zijlstra
@ 2022-04-08 14:10 ` Josh Poimboeuf
  4 siblings, 0 replies; 13+ messages in thread
From: Josh Poimboeuf @ 2022-04-08 14:10 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: x86, linux-kernel, rick.p.edgecombe

On Fri, Apr 08, 2022 at 11:45:52AM +0200, Peter Zijlstra wrote:
> Fix various objtool whinges:
> 
>   lib/strnlen_user.o: warning: objtool: strnlen_user()+0x33: call to do_strnlen_user() with UACCESS enabled
>   lib/strncpy_from_user.o: warning: objtool: strncpy_from_user()+0x33: call to do_strncpy_from_user() with UACCESS enabled
> 
>   vmlinux.o: warning: objtool: pvh_start_xen()+0x0: unreachable
>   vmlinux.o: warning: objtool: start_secondary()+0x10e: unreachable
>   vmlinux.o: warning: objtool: asm_exc_xen_unknown_trap()+0x16: unreachable instruction

Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>

-- 
Josh


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

* Re: [PATCH 3/4] x86,objtool: Mark cpu_startup_entry() __noreturn
  2022-04-08  9:45 ` [PATCH 3/4] x86,objtool: Mark cpu_startup_entry() __noreturn Peter Zijlstra
@ 2022-04-11 20:32   ` Josh Poimboeuf
  2022-04-12 15:13   ` Josh Poimboeuf
  2022-04-19 20:08   ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra
  2 siblings, 0 replies; 13+ messages in thread
From: Josh Poimboeuf @ 2022-04-11 20:32 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: x86, linux-kernel, rick.p.edgecombe

On Fri, Apr 08, 2022 at 11:45:55AM +0200, Peter Zijlstra wrote:
> GCC-8 isn't clever enough to figure out that cpu_start_entry() is a
> noreturn while objtool is. This results in code after the call in
> start_secondary(). Give GCC a hand so that they all agree on things.
> 
>   vmlinux.o: warning: objtool: start_secondary()+0x10e: unreachable
> 
> Reported-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
>  include/linux/cpu.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/include/linux/cpu.h
> +++ b/include/linux/cpu.h
> @@ -167,7 +167,7 @@ static inline int suspend_disable_second
>  static inline void suspend_enable_secondary_cpus(void) { }
>  #endif /* !CONFIG_PM_SLEEP_SMP */
>  
> -void cpu_startup_entry(enum cpuhp_state state);
> +void __noreturn cpu_startup_entry(enum cpuhp_state state);
>  
>  void cpu_idle_poll_ctrl(bool enable);

I just ran into this:

  init/main.o: warning: objtool: rest_init() falls through to next function kernel_init()

so we need this as well:

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 565fec451d69..fab2235599a0 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -184,6 +184,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
                "do_group_exit",
                "stop_this_cpu",
                "__invalid_creds",
+               "cpu_startup_entry",
        };

        if (!func)


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

* Re: [PATCH 3/4] x86,objtool: Mark cpu_startup_entry() __noreturn
  2022-04-08  9:45 ` [PATCH 3/4] x86,objtool: Mark cpu_startup_entry() __noreturn Peter Zijlstra
  2022-04-11 20:32   ` Josh Poimboeuf
@ 2022-04-12 15:13   ` Josh Poimboeuf
  2022-04-19 20:08   ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra
  2 siblings, 0 replies; 13+ messages in thread
From: Josh Poimboeuf @ 2022-04-12 15:13 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: x86, linux-kernel, rick.p.edgecombe

On Fri, Apr 08, 2022 at 11:45:55AM +0200, Peter Zijlstra wrote:
> GCC-8 isn't clever enough to figure out that cpu_start_entry() is a
> noreturn while objtool is. This results in code after the call in
> start_secondary(). Give GCC a hand so that they all agree on things.
> 
>   vmlinux.o: warning: objtool: start_secondary()+0x10e: unreachable
> 
> Reported-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
>  include/linux/cpu.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/include/linux/cpu.h
> +++ b/include/linux/cpu.h
> @@ -167,7 +167,7 @@ static inline int suspend_disable_second
>  static inline void suspend_enable_secondary_cpus(void) { }
>  #endif /* !CONFIG_PM_SLEEP_SMP */
>  
> -void cpu_startup_entry(enum cpuhp_state state);
> +void __noreturn cpu_startup_entry(enum cpuhp_state state);
>  
>  void cpu_idle_poll_ctrl(bool enable);

Also needs added to the objtool noreturn list.

-- 
Josh


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

* [tip: x86/urgent] x86,objtool: Explicitly mark idtentry_body()s tail REACHABLE
  2022-04-08  9:45 ` [PATCH 4/4] x86,objtool: Explicitly mark idtentry_body()s tail REACHABLE Peter Zijlstra
@ 2022-04-19 20:08   ` tip-bot2 for Peter Zijlstra
  0 siblings, 0 replies; 13+ messages in thread
From: tip-bot2 for Peter Zijlstra @ 2022-04-19 20:08 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Peter Zijlstra (Intel), Josh Poimboeuf, x86, linux-kernel

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     d66e9d50ea5cd76b2c4875c758efad665283d7ad
Gitweb:        https://git.kernel.org/tip/d66e9d50ea5cd76b2c4875c758efad665283d7ad
Author:        Peter Zijlstra <peterz@infradead.org>
AuthorDate:    Fri, 08 Apr 2022 11:45:56 +02:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Tue, 19 Apr 2022 21:58:48 +02:00

x86,objtool: Explicitly mark idtentry_body()s tail REACHABLE

Objtool can figure out that some \cfunc()s are noreturn and then
complains about certain instances having unreachable tails:

  vmlinux.o: warning: objtool: asm_exc_xen_unknown_trap()+0x16: unreachable instruction

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/20220408094718.441854969@infradead.org
---
 arch/x86/entry/entry_64.S | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index 4faac48..73d9585 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -337,6 +337,9 @@ SYM_CODE_END(ret_from_fork)
 
 	call	\cfunc
 
+	/* For some configurations \cfunc ends up being a noreturn. */
+	REACHABLE
+
 	jmp	error_return
 .endm
 

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

* [tip: x86/urgent] x86,objtool: Mark cpu_startup_entry() __noreturn
  2022-04-08  9:45 ` [PATCH 3/4] x86,objtool: Mark cpu_startup_entry() __noreturn Peter Zijlstra
  2022-04-11 20:32   ` Josh Poimboeuf
  2022-04-12 15:13   ` Josh Poimboeuf
@ 2022-04-19 20:08   ` tip-bot2 for Peter Zijlstra
  2 siblings, 0 replies; 13+ messages in thread
From: tip-bot2 for Peter Zijlstra @ 2022-04-19 20:08 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Rick Edgecombe, Peter Zijlstra (Intel),
	Josh Poimboeuf, x86, linux-kernel

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     d4e5268a08b211b536fed29beb24271ecd85187e
Gitweb:        https://git.kernel.org/tip/d4e5268a08b211b536fed29beb24271ecd85187e
Author:        Peter Zijlstra <peterz@infradead.org>
AuthorDate:    Fri, 08 Apr 2022 11:45:55 +02:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Tue, 19 Apr 2022 21:58:48 +02:00

x86,objtool: Mark cpu_startup_entry() __noreturn

GCC-8 isn't clever enough to figure out that cpu_start_entry() is a
noreturn while objtool is. This results in code after the call in
start_secondary(). Give GCC a hand so that they all agree on things.

  vmlinux.o: warning: objtool: start_secondary()+0x10e: unreachable

Reported-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/20220408094718.383658532@infradead.org
---
 include/linux/cpu.h   | 2 +-
 tools/objtool/check.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 9cf51e4..54dc2f9 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -167,7 +167,7 @@ static inline int suspend_disable_secondary_cpus(void) { return 0; }
 static inline void suspend_enable_secondary_cpus(void) { }
 #endif /* !CONFIG_PM_SLEEP_SMP */
 
-void cpu_startup_entry(enum cpuhp_state state);
+void __noreturn cpu_startup_entry(enum cpuhp_state state);
 
 void cpu_idle_poll_ctrl(bool enable);
 
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index bd0c2c8..e3a675d 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -184,6 +184,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
 		"do_group_exit",
 		"stop_this_cpu",
 		"__invalid_creds",
+               "cpu_startup_entry",
 	};
 
 	if (!func)

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

* [tip: x86/urgent] x86,xen,objtool: Add UNWIND hint
  2022-04-08  9:45 ` [PATCH 2/4] x86,xen,objtool: Add UNWIND hint Peter Zijlstra
@ 2022-04-19 20:08   ` tip-bot2 for Peter Zijlstra
  0 siblings, 0 replies; 13+ messages in thread
From: tip-bot2 for Peter Zijlstra @ 2022-04-19 20:08 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Thomas Gleixner, Rick Edgecombe, Peter Zijlstra (Intel),
	Josh Poimboeuf, x86, linux-kernel

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     2730d3c14a85617c177337f2e2af2108bf82c4ca
Gitweb:        https://git.kernel.org/tip/2730d3c14a85617c177337f2e2af2108bf82c4ca
Author:        Peter Zijlstra <peterz@infradead.org>
AuthorDate:    Fri, 08 Apr 2022 11:45:54 +02:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Tue, 19 Apr 2022 21:58:47 +02:00

x86,xen,objtool: Add UNWIND hint

SYM_CODE_START*() doesn't get auto-validated and needs an UNWIND hint
to get checked, add one.

  vmlinux.o: warning: objtool: pvh_start_xen()+0x0: unreachable

Reported-by: Thomas Gleixner <tglx@linutronix.de>
Reported-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/20220408094718.321246297@infradead.org
---
 arch/x86/platform/pvh/head.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/platform/pvh/head.S b/arch/x86/platform/pvh/head.S
index 72c1e42..7fe564e 100644
--- a/arch/x86/platform/pvh/head.S
+++ b/arch/x86/platform/pvh/head.S
@@ -50,6 +50,7 @@
 #define PVH_DS_SEL		(PVH_GDT_ENTRY_DS * 8)
 
 SYM_CODE_START_LOCAL(pvh_start_xen)
+	UNWIND_HINT_EMPTY
 	cld
 
 	lgdt (_pa(gdt))

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

* [tip: x86/urgent] lib/strn*,objtool: Enforce user_access_begin() rules
  2022-04-08  9:45 ` [PATCH 1/4] lib/strn*,objtool: Enforce user_access_begin() rules Peter Zijlstra
  2022-04-08 14:09   ` Josh Poimboeuf
@ 2022-04-19 20:08   ` tip-bot2 for Peter Zijlstra
  1 sibling, 0 replies; 13+ messages in thread
From: tip-bot2 for Peter Zijlstra @ 2022-04-19 20:08 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Thomas Gleixner, Peter Zijlstra (Intel),
	Josh Poimboeuf, x86, linux-kernel

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     226d44acf6dfe71c9df5804b82364e93cf908b53
Gitweb:        https://git.kernel.org/tip/226d44acf6dfe71c9df5804b82364e93cf908b53
Author:        Peter Zijlstra <peterz@infradead.org>
AuthorDate:    Fri, 08 Apr 2022 11:45:53 +02:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Tue, 19 Apr 2022 21:58:47 +02:00

lib/strn*,objtool: Enforce user_access_begin() rules

Apparently GCC can fail to inline a 'static inline' single caller
function:

  lib/strnlen_user.o: warning: objtool: strnlen_user()+0x33: call to do_strnlen_user() with UACCESS enabled
  lib/strncpy_from_user.o: warning: objtool: strncpy_from_user()+0x33: call to do_strncpy_from_user() with UACCESS enabled

Reported-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/20220408094718.262932488@infradead.org
---
 lib/strncpy_from_user.c | 2 +-
 lib/strnlen_user.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/strncpy_from_user.c b/lib/strncpy_from_user.c
index 08fc72d..6432b8c 100644
--- a/lib/strncpy_from_user.c
+++ b/lib/strncpy_from_user.c
@@ -25,7 +25,7 @@
  * hit it), 'max' is the address space maximum (and we return
  * -EFAULT if we hit it).
  */
-static inline long do_strncpy_from_user(char *dst, const char __user *src,
+static __always_inline long do_strncpy_from_user(char *dst, const char __user *src,
 					unsigned long count, unsigned long max)
 {
 	const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS;
diff --git a/lib/strnlen_user.c b/lib/strnlen_user.c
index bffa0eb..feeb935 100644
--- a/lib/strnlen_user.c
+++ b/lib/strnlen_user.c
@@ -20,7 +20,7 @@
  * if it fits in a aligned 'long'. The caller needs to check
  * the return value against "> max".
  */
-static inline long do_strnlen_user(const char __user *src, unsigned long count, unsigned long max)
+static __always_inline long do_strnlen_user(const char __user *src, unsigned long count, unsigned long max)
 {
 	const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS;
 	unsigned long align, res = 0;

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

end of thread, other threads:[~2022-04-19 20:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08  9:45 [PATCH 0/4] objtool: Fixes Peter Zijlstra
2022-04-08  9:45 ` [PATCH 1/4] lib/strn*,objtool: Enforce user_access_begin() rules Peter Zijlstra
2022-04-08 14:09   ` Josh Poimboeuf
2022-04-19 20:08   ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra
2022-04-08  9:45 ` [PATCH 2/4] x86,xen,objtool: Add UNWIND hint Peter Zijlstra
2022-04-19 20:08   ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra
2022-04-08  9:45 ` [PATCH 3/4] x86,objtool: Mark cpu_startup_entry() __noreturn Peter Zijlstra
2022-04-11 20:32   ` Josh Poimboeuf
2022-04-12 15:13   ` Josh Poimboeuf
2022-04-19 20:08   ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra
2022-04-08  9:45 ` [PATCH 4/4] x86,objtool: Explicitly mark idtentry_body()s tail REACHABLE Peter Zijlstra
2022-04-19 20:08   ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra
2022-04-08 14:10 ` [PATCH 0/4] objtool: Fixes Josh Poimboeuf

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).