Skip to content

Commit 07eecff

Browse files
committed
parisc: Mark jump_table naturally aligned
The jump_table stores two 32-bit words and one 32- (on 32-bit kernel) or one 64-bit word (on 64-bit kernel). Ensure that the last word is always 64-bit aligned on a 64-bit kernel by aligning the whole structure on sizeof(long). Signed-off-by: Helge Deller <deller@gmx.de> Cc: stable@vger.kernel.org # v6.0+
1 parent 33f806d commit 07eecff

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

arch/parisc/include/asm/jump_label.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran
1515
asm_volatile_goto("1:\n\t"
1616
"nop\n\t"
1717
".pushsection __jump_table, \"aw\"\n\t"
18+
".align %1\n\t"
1819
".word 1b - ., %l[l_yes] - .\n\t"
1920
__stringify(ASM_ULONG_INSN) " %c0 - .\n\t"
2021
".popsection\n\t"
21-
: : "i" (&((char *)key)[branch]) : : l_yes);
22+
: : "i" (&((char *)key)[branch]), "i" (sizeof(long))
23+
: : l_yes);
2224

2325
return false;
2426
l_yes:
@@ -30,10 +32,12 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key, bool
3032
asm_volatile_goto("1:\n\t"
3133
"b,n %l[l_yes]\n\t"
3234
".pushsection __jump_table, \"aw\"\n\t"
35+
".align %1\n\t"
3336
".word 1b - ., %l[l_yes] - .\n\t"
3437
__stringify(ASM_ULONG_INSN) " %c0 - .\n\t"
3538
".popsection\n\t"
36-
: : "i" (&((char *)key)[branch]) : : l_yes);
39+
: : "i" (&((char *)key)[branch]), "i" (sizeof(long))
40+
: : l_yes);
3741

3842
return false;
3943
l_yes:

0 commit comments

Comments
 (0)