aboutsummaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/jump_label.h
diff options
context:
space:
mode:
authorGravatar Ingo Molnar <mingo@kernel.org> 2024-02-27 10:09:49 +0100
committerGravatar Ingo Molnar <mingo@kernel.org> 2024-02-27 10:09:49 +0100
commit9b9c280b9af2aa851d83e7d0b79f36a3d869d745 (patch)
treeb61cf8566669d9615234e87696a833ee487e2655 /arch/arm64/include/asm/jump_label.h
parentx86/apic: Build the x86 topology enumeration functions on UP APIC builds too (diff)
parentx86/bugs: Use fixed addressing for VERW operand (diff)
downloadlinux-9b9c280b9af2aa851d83e7d0b79f36a3d869d745.tar.gz
linux-9b9c280b9af2aa851d83e7d0b79f36a3d869d745.tar.bz2
linux-9b9c280b9af2aa851d83e7d0b79f36a3d869d745.zip
Merge branch 'x86/urgent' into x86/apic, to resolve conflicts
Conflicts: arch/x86/kernel/cpu/common.c arch/x86/kernel/cpu/intel.c Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/arm64/include/asm/jump_label.h')
-rw-r--r--arch/arm64/include/asm/jump_label.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/arm64/include/asm/jump_label.h b/arch/arm64/include/asm/jump_label.h
index 6aafbb789991..b360c4c2b5e7 100644
--- a/arch/arm64/include/asm/jump_label.h
+++ b/arch/arm64/include/asm/jump_label.h
@@ -15,6 +15,10 @@
#define JUMP_LABEL_NOP_SIZE AARCH64_INSN_SIZE
+/*
+ * Prefer the constraint "S" to support PIC with GCC. Clang before 19 does not
+ * support "S" on a symbol with a constant offset, so we use "i" as a fallback.
+ */
static __always_inline bool arch_static_branch(struct static_key * const key,
const bool branch)
{
@@ -23,9 +27,9 @@ static __always_inline bool arch_static_branch(struct static_key * const key,
" .pushsection __jump_table, \"aw\" \n\t"
" .align 3 \n\t"
" .long 1b - ., %l[l_yes] - . \n\t"
- " .quad %c0 - . \n\t"
+ " .quad (%[key] - .) + %[bit0] \n\t"
" .popsection \n\t"
- : : "i"(&((char *)key)[branch]) : : l_yes);
+ : : [key]"Si"(key), [bit0]"i"(branch) : : l_yes);
return false;
l_yes:
@@ -40,9 +44,9 @@ static __always_inline bool arch_static_branch_jump(struct static_key * const ke
" .pushsection __jump_table, \"aw\" \n\t"
" .align 3 \n\t"
" .long 1b - ., %l[l_yes] - . \n\t"
- " .quad %c0 - . \n\t"
+ " .quad (%[key] - .) + %[bit0] \n\t"
" .popsection \n\t"
- : : "i"(&((char *)key)[branch]) : : l_yes);
+ : : [key]"Si"(key), [bit0]"i"(branch) : : l_yes);
return false;
l_yes: