hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/arch/s390/include/asm/jump_label.h
....@@ -10,7 +10,9 @@
1010 #define JUMP_LABEL_NOP_SIZE 6
1111 #define JUMP_LABEL_NOP_OFFSET 2
1212
13
-#if __GNUC__ < 9
13
+#ifdef CONFIG_CC_IS_CLANG
14
+#define JUMP_LABEL_STATIC_KEY_CONSTRAINT "i"
15
+#elif __GNUC__ < 9
1416 #define JUMP_LABEL_STATIC_KEY_CONSTRAINT "X"
1517 #else
1618 #define JUMP_LABEL_STATIC_KEY_CONSTRAINT "jdd"
....@@ -22,13 +24,13 @@
2224 */
2325 static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
2426 {
25
- asm_volatile_goto("0: brcl 0,"__stringify(JUMP_LABEL_NOP_OFFSET)"\n"
26
- ".pushsection __jump_table, \"aw\"\n"
27
- ".balign 8\n"
28
- ".quad 0b, %l[label], %0+%1\n"
29
- ".popsection\n"
30
- : : JUMP_LABEL_STATIC_KEY_CONSTRAINT (key), "i" (branch) : : label);
31
-
27
+ asm_volatile_goto("0: brcl 0,"__stringify(JUMP_LABEL_NOP_OFFSET)"\n"
28
+ ".pushsection __jump_table,\"aw\"\n"
29
+ ".balign 8\n"
30
+ ".long 0b-.,%l[label]-.\n"
31
+ ".quad %0+%1-.\n"
32
+ ".popsection\n"
33
+ : : JUMP_LABEL_STATIC_KEY_CONSTRAINT (key), "i" (branch) : : label);
3234 return false;
3335 label:
3436 return true;
....@@ -36,25 +38,17 @@
3638
3739 static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)
3840 {
39
- asm_volatile_goto("0: brcl 15, %l[label]\n"
40
- ".pushsection __jump_table, \"aw\"\n"
41
- ".balign 8\n"
42
- ".quad 0b, %l[label], %0+%1\n"
43
- ".popsection\n"
44
- : : JUMP_LABEL_STATIC_KEY_CONSTRAINT (key), "i" (branch) : : label);
45
-
41
+ asm_volatile_goto("0: brcl 15,%l[label]\n"
42
+ ".pushsection __jump_table,\"aw\"\n"
43
+ ".balign 8\n"
44
+ ".long 0b-.,%l[label]-.\n"
45
+ ".quad %0+%1-.\n"
46
+ ".popsection\n"
47
+ : : JUMP_LABEL_STATIC_KEY_CONSTRAINT (key), "i" (branch) : : label);
4648 return false;
4749 label:
4850 return true;
4951 }
50
-
51
-typedef unsigned long jump_label_t;
52
-
53
-struct jump_entry {
54
- jump_label_t code;
55
- jump_label_t target;
56
- jump_label_t key;
57
-};
5852
5953 #endif /* __ASSEMBLY__ */
6054 #endif