Merge tag 'kvm-x86-misc-6.9' of https://github.com/kvm-x86/linux into HEAD
[linux-2.6-block.git] / arch / arm64 / include / asm / jump_label.h
index b360c4c2b5e792ef276443ca550b535e7050cb35..6aafbb7899916e631eab9241c39c1313a7c93707 100644 (file)
 
 #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)
 {
@@ -27,9 +23,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           (%[key] - .) + %[bit0]  \n\t"
+                "      .quad           %c0 - .                 \n\t"
                 "      .popsection                             \n\t"
-                :  :  [key]"Si"(key), [bit0]"i"(branch) :  : l_yes);
+                :  :  "i"(&((char *)key)[branch]) :  : l_yes);
 
        return false;
 l_yes:
@@ -44,9 +40,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           (%[key] - .) + %[bit0]  \n\t"
+                "      .quad           %c0 - .                 \n\t"
                 "      .popsection                             \n\t"
-                :  :  [key]"Si"(key), [bit0]"i"(branch) :  : l_yes);
+                :  :  "i"(&((char *)key)[branch]) :  : l_yes);
 
        return false;
 l_yes: