From: Masami Hiramatsu <mhiramat@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>,
mhiramat@kernel.org, rostedt@goodmis.org, ast@kernel.org,
hjl.tools@gmail.com, rick.p.edgecombe@intel.com, rppt@kernel.org,
linux-toolchains@vger.kernel.org, Andrew.Cooper3@citrix.com,
ndesaulniers@google.com
Subject: Re: linux-next: build warnings after merge of the tip tree
Date: Tue, 22 Mar 2022 14:31:36 +0900 [thread overview]
Message-ID: <20220322143136.0e78366c3521b54b7b9385b8@kernel.org> (raw)
In-Reply-To: <YjisdqdofbDIYj2U@hirez.programming.kicks-ass.net>
On Mon, 21 Mar 2022 17:48:54 +0100
Peter Zijlstra <peterz@infradead.org> wrote:
> On Mon, Mar 21, 2022 at 02:04:05PM +0100, Peter Zijlstra wrote:
> > On Mon, Mar 21, 2022 at 01:55:49PM +0100, Peter Zijlstra wrote:
> > > On Mon, Mar 21, 2022 at 02:03:27PM +1100, Stephen Rothwell wrote:
> > > > Hi all,
> > > >
> > > > After merging the tip tree, today's linux-next build (x864 allmodconfig)
> > > > produced these new warnings:
> > > >
> > > > vmlinux.o: warning: objtool: arch_rethook_prepare()+0x55: relocation to !ENDBR: arch_rethook_trampoline+0x0
> > > > vmlinux.o: warning: objtool: arch_rethook_trampoline_callback()+0x3e: relocation to !ENDBR: arch_rethook_trampoline+0x0
> > > > vmlinux.o: warning: objtool: unwind_next_frame()+0x93e: relocation to !ENDBR: arch_rethook_trampoline+0x0
> > > > vmlinux.o: warning: objtool: unwind_next_frame()+0x5f2: relocation to !ENDBR: arch_rethook_trampoline+0x0
> > > > vmlinux.o: warning: objtool: unwind_next_frame()+0x4a7: relocation to !ENDBR: arch_rethook_trampoline+0x0
> > > > vmlinux.o: warning: objtool: __rethook_find_ret_addr()+0x81: relocation to !ENDBR: arch_rethook_trampoline+0x0
> > > > vmlinux.o: warning: objtool: __rethook_find_ret_addr()+0x90: relocation to !ENDBR: arch_rethook_trampoline+0x0
> > > > vmlinux.o: warning: objtool: rethook_trampoline_handler()+0x8c: relocation to !ENDBR: arch_rethook_trampoline+0x0
> > > > vmlinux.o: warning: objtool: rethook_trampoline_handler()+0x9b: relocation to !ENDBR: arch_rethook_trampoline+0x0
> > >
> > > Hurmph, lemme go figure out where that code comes from, I've not seen
> > > those.
> >
> > Ahh, something tracing. I'll go do some patches on top of it.
>
> The below gets rid of the objtool warnings.
Yes, I confirmed that.
>
> But I still think it's fairly terrible to get a (flawed) carbon copy of
> the kretprobe code.
Indeed. I would like to replace the trampoline code of kretprobe with
rethook, eventually. There is no reason why we keep the clone.
(But I need more arch maintainers help for that, there are too many
archs implemented kretprobes)
> Also, I think both should fix regs->ss.
I'm not sure this part. Since the return trampoline should run in the same
context of the called function, isn't ss same there too?
Thank you,
>
> ---
> diff --git a/arch/x86/kernel/rethook.c b/arch/x86/kernel/rethook.c
> index f0f2f0608282..227a1890a984 100644
> --- a/arch/x86/kernel/rethook.c
> +++ b/arch/x86/kernel/rethook.c
> @@ -20,6 +20,7 @@ asm(
> ".type arch_rethook_trampoline, @function\n"
> "arch_rethook_trampoline:\n"
> #ifdef CONFIG_X86_64
> + ANNOTATE_NOENDBR
> /* Push a fake return address to tell the unwinder it's a kretprobe. */
> " pushq $arch_rethook_trampoline\n"
> UNWIND_HINT_FUNC
> @@ -48,7 +49,7 @@ asm(
> " addl $4, %esp\n"
> " popfl\n"
> #endif
> - " ret\n"
> + ASM_RET
> ".size arch_rethook_trampoline, .-arch_rethook_trampoline\n"
> );
> NOKPROBE_SYMBOL(arch_rethook_trampoline);
--
Masami Hiramatsu <mhiramat@kernel.org>
next prev parent reply other threads:[~2022-03-22 5:31 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220321140327.777f9554@canb.auug.org.au>
[not found] ` <Yjh11UjDZogc3foM@hirez.programming.kicks-ass.net>
2022-03-21 13:04 ` linux-next: build warnings after merge of the tip tree Peter Zijlstra
2022-03-21 13:08 ` Peter Zijlstra
2022-03-21 13:45 ` Peter Zijlstra
2022-03-21 14:19 ` Mark Rutland
2022-03-21 15:28 ` Peter Zijlstra
2022-03-21 15:45 ` Peter Zijlstra
2022-03-21 16:37 ` Linus Torvalds
2022-03-21 16:44 ` Peter Zijlstra
2022-03-21 16:52 ` Linus Torvalds
2022-03-21 22:05 ` Stephen Rothwell
2022-03-21 22:12 ` Alexei Starovoitov
2022-03-21 22:46 ` Stephen Rothwell
2022-03-21 22:50 ` Alexei Starovoitov
2022-03-21 22:55 ` Steven Rostedt
2022-03-22 4:51 ` Masami Hiramatsu
2022-03-22 4:53 ` Alexei Starovoitov
2022-03-22 7:42 ` Peter Zijlstra
2022-03-22 4:38 ` Masami Hiramatsu
2022-03-21 15:28 ` Steven Rostedt
2022-03-21 16:04 ` Peter Zijlstra
2022-03-21 16:12 ` Steven Rostedt
2022-03-21 16:15 ` Steven Rostedt
2022-03-21 16:22 ` Steven Rostedt
2022-03-21 16:39 ` Steven Rostedt
2022-03-21 16:40 ` Peter Zijlstra
2022-03-21 16:45 ` Steven Rostedt
2022-03-21 16:50 ` Peter Zijlstra
2022-03-21 16:54 ` Steven Rostedt
2022-03-22 7:54 ` Peter Zijlstra
2022-03-22 13:12 ` Steven Rostedt
2022-03-22 14:35 ` Peter Zijlstra
2022-03-22 15:04 ` Steven Rostedt
2022-03-22 15:19 ` Peter Zijlstra
2022-03-22 15:48 ` Peter Zijlstra
2022-03-22 16:17 ` Steven Rostedt
2022-03-23 2:23 ` Masami Hiramatsu
2022-03-23 2:42 ` Steven Rostedt
2022-03-23 6:28 ` Masami Hiramatsu
2022-03-22 14:25 ` Masami Hiramatsu
2022-03-21 16:48 ` Peter Zijlstra
2022-03-22 5:31 ` Masami Hiramatsu [this message]
2022-03-22 8:08 ` Peter Zijlstra
2022-03-22 9:14 ` Masami Hiramatsu
2022-03-22 12:07 ` Peter Zijlstra
2022-03-22 12:17 ` Peter Zijlstra
2022-03-22 12:46 ` Masami Hiramatsu
2022-03-22 13:22 ` Steven Rostedt
2022-03-22 13:15 ` Mark Rutland
2022-03-22 13:51 ` Masami Hiramatsu
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=20220322143136.0e78366c3521b54b7b9385b8@kernel.org \
--to=mhiramat@kernel.org \
--cc=Andrew.Cooper3@citrix.com \
--cc=ast@kernel.org \
--cc=hjl.tools@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linux-toolchains@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.org \
--cc=rick.p.edgecombe@intel.com \
--cc=rostedt@goodmis.org \
--cc=rppt@kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=tglx@linutronix.de \
/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).