Skip to content

Commit a6b3eb3

Browse files
committed
Revert "arm64: jump_label: use constraints "Si" instead of "i""
This reverts commit f9daab0. Geert reports that his particular GCC 5.5 vintage toolchain fails to build an arm64 defconfig because of this change: | arch/arm64/include/asm/jump_label.h:25:2: error: invalid 'asm': | invalid operand | asm goto( ^ Aopparently, this is something we claim to support, so let's revert back to the old jump label constraint for now while discussions about raising the minimum GCC version are ongoing. Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://lore.kernel.org/r/CAMuHMdX+6fnAf8Hm6EqYJPAjrrLO9T7c=Gu3S8V_pqjSDowJ6g@mail.gmail.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent 802379b commit a6b3eb3

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

arch/arm64/include/asm/jump_label.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515

1616
#define JUMP_LABEL_NOP_SIZE AARCH64_INSN_SIZE
1717

18-
/*
19-
* Prefer the constraint "S" to support PIC with GCC. Clang before 19 does not
20-
* support "S" on a symbol with a constant offset, so we use "i" as a fallback.
21-
*/
2218
static __always_inline bool arch_static_branch(struct static_key * const key,
2319
const bool branch)
2420
{
@@ -27,9 +23,9 @@ static __always_inline bool arch_static_branch(struct static_key * const key,
2723
" .pushsection __jump_table, \"aw\" \n\t"
2824
" .align 3 \n\t"
2925
" .long 1b - ., %l[l_yes] - . \n\t"
30-
" .quad (%[key] - .) + %[bit0] \n\t"
26+
" .quad %c0 - . \n\t"
3127
" .popsection \n\t"
32-
: : [key]"Si"(key), [bit0]"i"(branch) : : l_yes);
28+
: : "i"(&((char *)key)[branch]) : : l_yes);
3329

3430
return false;
3531
l_yes:
@@ -44,9 +40,9 @@ static __always_inline bool arch_static_branch_jump(struct static_key * const ke
4440
" .pushsection __jump_table, \"aw\" \n\t"
4541
" .align 3 \n\t"
4642
" .long 1b - ., %l[l_yes] - . \n\t"
47-
" .quad (%[key] - .) + %[bit0] \n\t"
43+
" .quad %c0 - . \n\t"
4844
" .popsection \n\t"
49-
: : [key]"Si"(key), [bit0]"i"(branch) : : l_yes);
45+
: : "i"(&((char *)key)[branch]) : : l_yes);
5046

5147
return false;
5248
l_yes:

0 commit comments

Comments
 (0)