History

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).

Helge Deller committed 2 years ago

Commit 07eecff1 parent 33f806d1 file · +6 −2Browse files

Unified · Split

arch/parisc/include/asm/jump_label.h+6−2
@@ -15,10 +15,12 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran · 14 unmodified lines
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 · 5 unmodified lines
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:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t