From: Peter Zijlstra <peterz@infradead.org>
To: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Poimboe, Josh" <jpoimboe@redhat.com>,
"x86@kernel.org" <x86@kernel.org>
Subject: Re: IBT related objtool warnings
Date: Thu, 7 Apr 2022 18:07:15 +0200 [thread overview]
Message-ID: <20220407160715.GB2762@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <20220407155106.GL2731@worktop.programming.kicks-ass.net>
On Thu, Apr 07, 2022 at 05:51:06PM +0200, Peter Zijlstra wrote:
> On Wed, Apr 06, 2022 at 10:43:33PM +0000, Edgecombe, Rick P wrote:
> > Hi,
> >
> > After commit:
> > ed53a0d97192 x86/alternative: Use .ibt_endbr_seal to seal indirect calls
> >
> > I am getting objtool "unreachable instruction" warnings.
> >
> > On one system with gcc 8.4.0:
> > vmlinux.o: warning: objtool: start_secondary()+0x10e: unreachable
> > instruction
> >
> > On another with gcc 11.2.1:
> > vmlinux.o: warning: objtool: pvh_start_xen()+0x0: unreachable
> > instruction
> >
> > Let me know if any tests on my end would help.
>
> This seems to make it go on gcc-11.2 tip/x86/urgent..
>
> ---
>
> arch/x86/entry/entry_64.S | 3 +++
> arch/x86/platform/pvh/head.S | 1 +
> 2 files changed, 4 insertions(+)
>
> diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
> index 4faac48ebec5..73d958522b6a 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
>
> diff --git a/arch/x86/platform/pvh/head.S b/arch/x86/platform/pvh/head.S
> index 72c1e42d121d..7fe564eaf228 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))
And this for gcc-8.4
---
include/linux/cpu.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 9cf51e41e697..54dc2f9a2d56 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);
next prev parent reply other threads:[~2022-04-07 16:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-06 22:43 IBT related objtool warnings Edgecombe, Rick P
2022-04-07 6:49 ` Peter Zijlstra
2022-04-07 15:20 ` Edgecombe, Rick P
2022-04-07 15:51 ` Peter Zijlstra
2022-04-07 16:07 ` Peter Zijlstra [this message]
2022-04-07 16:11 ` Edgecombe, Rick P
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=20220407160715.GB2762@worktop.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rick.p.edgecombe@intel.com \
--cc=x86@kernel.org \
/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