Skip to contentSkip to conversation

jump label: mips alignment required?

DISCUSSION Steven Rostedt 1 participant 1 message Mar 16, 2011 2 messages not in the archive

lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive
Quoted 3 lines · Ralf Baechle
Quoted 1 line · Jason Baron

(off-list)

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

Quoted 21 lines

Adding Steve Rosted again.

Quoted 18 lines

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,

(quoted diff) +0 -1
-Jason
arch/x86/include/asm/jump_label.h +1 -0
index f217cee..a32b18c 100644
@@ -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"
Quoted 8 lines

arch/x86/include/asm/jump_label.h static __always_inline bool arch_static_branch(struct jump_label_key *key) · line 22

Quoted 3 lines
arch/x86/include/asm/jump_label.h +0 -0
 		_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