aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/jump_label.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/include/asm/jump_label.h')
-rw-r--r--arch/s390/include/asm/jump_label.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/s390/include/asm/jump_label.h b/arch/s390/include/asm/jump_label.h
index 346b1c85ffb4..58642fd29c87 100644
--- a/arch/s390/include/asm/jump_label.h
+++ b/arch/s390/include/asm/jump_label.h
@@ -4,6 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6#define JUMP_LABEL_NOP_SIZE 6 6#define JUMP_LABEL_NOP_SIZE 6
7#define JUMP_LABEL_NOP_OFFSET 2
7 8
8#ifdef CONFIG_64BIT 9#ifdef CONFIG_64BIT
9#define ASM_PTR ".quad" 10#define ASM_PTR ".quad"
@@ -13,9 +14,13 @@
13#define ASM_ALIGN ".balign 4" 14#define ASM_ALIGN ".balign 4"
14#endif 15#endif
15 16
17/*
18 * We use a brcl 0,2 instruction for jump labels at compile time so it
19 * can be easily distinguished from a hotpatch generated instruction.
20 */
16static __always_inline bool arch_static_branch(struct static_key *key) 21static __always_inline bool arch_static_branch(struct static_key *key)
17{ 22{
18 asm_volatile_goto("0: brcl 0,0\n" 23 asm_volatile_goto("0: brcl 0,"__stringify(JUMP_LABEL_NOP_OFFSET)"\n"
19 ".pushsection __jump_table, \"aw\"\n" 24 ".pushsection __jump_table, \"aw\"\n"
20 ASM_ALIGN "\n" 25 ASM_ALIGN "\n"
21 ASM_PTR " 0b, %l[label], %0\n" 26 ASM_PTR " 0b, %l[label], %0\n"