mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: X86 ML <x86@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Song Liu <songliubraving@fb.com>, Kairui Song <kasong@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>, Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH v3 2/4] objtool: Add support for C jump tables
Date: Wed, 26 Jun 2019 21:47:00 -0500	[thread overview]
Message-ID: <20190627024700.q4rkcbhmrna6ev4y@treble> (raw)
In-Reply-To: <CAADnVQ+veayfD70Xsu8UnNrLdRW6rh9jxPb=OGoiYT-O=_zW=A@mail.gmail.com>

On Wed, Jun 26, 2019 at 06:42:40PM -0700, Alexei Starovoitov wrote:
> > @@ -1035,9 +1038,18 @@ static struct rela *find_switch_table(struct objtool_file *file,
> >
> >                 /*
> >                  * Make sure the .rodata address isn't associated with a
> > -                * symbol.  gcc jump tables are anonymous data.
> > +                * symbol.  GCC jump tables are anonymous data.
> > +                *
> > +                * Also support C jump tables which are in the same format as
> > +                * switch jump tables.  Each jump table should be a static
> > +                * local const array named "jump_table" for objtool to
> > +                * recognize it.
> 
> Nacked-by: Alexei Starovoitov <ast@kernel.org>
> 
> It's not acceptable for objtool to dictate kernel naming convention.

Abrasive nack notwithstanding, I agree it's not ideal.

How about the following approach instead?  This is the only other way I
can think of to annotate a jump table so that objtool can distinguish
it:

#define __annotate_jump_table __section(".jump_table.rodata")

Then bpf would just need the following:

-	static const void *jumptable[256] = {
+	static const void __annotate_jump_table *jumptable[256] = {

This would be less magical and fragile than my original approach.

I think the jump table would still be placed with all the other rodata,
like before, because the vmlinux linker script recognizes the section
".rodata" suffix and bundles them all together.

-- 
Josh

  reply	other threads:[~2019-06-27  2:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-27  0:33 [PATCH v3 0/4] x86: bpf unwinder fixes Josh Poimboeuf
2019-06-27  0:33 ` [PATCH v3 1/4] perf/x86: Always store regs->ip in perf_callchain_kernel() Josh Poimboeuf
2019-06-27 22:22   ` [tip:x86/urgent] " tip-bot for Song Liu
2019-06-27  0:33 ` [PATCH v3 2/4] objtool: Add support for C jump tables Josh Poimboeuf
2019-06-27  1:42   ` Alexei Starovoitov
2019-06-27  2:47     ` Josh Poimboeuf [this message]
2019-06-27  2:54       ` Alexei Starovoitov
2019-06-27  3:44         ` Josh Poimboeuf
2019-06-27  3:56           ` Josh Poimboeuf
2019-06-27  4:38             ` Alexei Starovoitov
2019-06-27 12:58       ` Steven Rostedt
2019-06-27  0:33 ` [PATCH v3 3/4] bpf: Fix ORC unwinding in non-JIT BPF code Josh Poimboeuf
2019-06-27  0:57   ` Alexei Starovoitov
2019-06-27  1:06     ` Josh Poimboeuf
2019-06-27  1:22       ` Alexei Starovoitov
2019-06-27  1:30         ` Josh Poimboeuf
2019-06-27  0:33 ` [PATCH v3 4/4] x86/unwind/orc: Fall back to using frame pointers for generated code Josh Poimboeuf
2019-06-27 22:22   ` [tip:x86/urgent] " tip-bot for Josh Poimboeuf

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=20190627024700.q4rkcbhmrna6ev4y@treble \
    --to=jpoimboe@redhat.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=bp@alien8.de \
    --cc=kasong@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=songliubraving@fb.com \
    --cc=tglx@linutronix.de \
    --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

all inboxes | Powered by JetHome®