[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190627085804.070a9541@gandalf.local.home>
Date: Thu, 27 Jun 2019 08:58:04 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Alexei Starovoitov <alexei.starovoitov@...il.com>,
X86 ML <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
Song Liu <songliubraving@...com>,
Kairui Song <kasong@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Borislav Petkov <bp@...en8.de>, Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH v3 2/4] objtool: Add support for C jump tables
On Wed, 26 Jun 2019 21:47:00 -0500
Josh Poimboeuf <jpoimboe@...hat.com> wrote:
> 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@...nel.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.
>
After finally getting a chance to skim through this lovely thread, I
was going to suggest exactly this. This is the way we usually handle
"special" data.
As it appears that Alexei is good with this approach, please go this
route.
Thanks!
-- Steve
Powered by blists - more mailing lists