Re: jump label: mips alignment required?

From: Steven Rostedt
Date: Wed Mar 16 2011 - 11:06:32 EST


On Wed, 2011-03-16 at 15:57 +0100, Ralf Baechle wrote:
> On Mon, Mar 14, 2011 at 11:02:20AM -0400, Jason Baron wrote:
>
> > (off-list)

Added LKML back, as well as others. There was really no reason to take
this off list.

>
> Adding Steve Rosted again.
>
> > After last weeks discussion, I'm going to be re-posting the jump label
> > series. I'm adding the following to the x86 code. If you want to add
> > something similar for mips, I can include it in my posting (as coming
> > from you).
> >
> > thanks,
> >
> > -Jason
> >
> > diff --git a/arch/x86/include/asm/jump_label.h b/arch/x86/include/asm/jump_label.h
> > index f217cee..a32b18c 100644
> > --- a/arch/x86/include/asm/jump_label.h
> > +++ b/arch/x86/include/asm/jump_label.h
> > @@ -16,6 +16,7 @@ static __always_inline bool arch_static_branch(struct jump_label_key *key)
> > asm goto("1:"
> > JUMP_LABEL_INITIAL_NOP
> > ".pushsection __jump_table, \"aw\" \n\t"
> > + _ASM_ALIGN "\n\t"
> > _ASM_PTR "1b, %l[l_yes], %c0 \n\t"
> > ".popsection \n\t"
> > : : "i" (key) : : l_yes);
>
> I don't think we'll need something like this on MIPS. Gas is smart enough to
> set the __jump_table's section automatically to 64-bit if _ASM_PTR is emitting
> 64-bit pointers. So no alignment magic needed nor do I think x86 would need this
> to work correct on both i386 and x86_64.

Yeah, I still have strong doubts that the linker would add holes into a
word aligned section. Such a linker IMNSHO would be broken. Why waste
space?

OK, Jason, I think it's fine if you repost the patches. You can keep the
alignment in x86_64 just to be paranoid^Wsafe.

-- Steve


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/