diff options
Diffstat (limited to 'arch/arm64/kernel/jump_label.c')
-rw-r--r-- | arch/arm64/kernel/jump_label.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/arch/arm64/kernel/jump_label.c b/arch/arm64/kernel/jump_label.c index 263a166291fb..4f1fec7a46db 100644 --- a/arch/arm64/kernel/jump_label.c +++ b/arch/arm64/kernel/jump_label.c | |||
@@ -22,9 +22,8 @@ | |||
22 | 22 | ||
23 | #ifdef HAVE_JUMP_LABEL | 23 | #ifdef HAVE_JUMP_LABEL |
24 | 24 | ||
25 | static void __arch_jump_label_transform(struct jump_entry *entry, | 25 | void arch_jump_label_transform(struct jump_entry *entry, |
26 | enum jump_label_type type, | 26 | enum jump_label_type type) |
27 | bool is_static) | ||
28 | { | 27 | { |
29 | void *addr = (void *)entry->code; | 28 | void *addr = (void *)entry->code; |
30 | u32 insn; | 29 | u32 insn; |
@@ -37,22 +36,18 @@ static void __arch_jump_label_transform(struct jump_entry *entry, | |||
37 | insn = aarch64_insn_gen_nop(); | 36 | insn = aarch64_insn_gen_nop(); |
38 | } | 37 | } |
39 | 38 | ||
40 | if (is_static) | 39 | aarch64_insn_patch_text(&addr, &insn, 1); |
41 | aarch64_insn_patch_text_nosync(addr, insn); | ||
42 | else | ||
43 | aarch64_insn_patch_text(&addr, &insn, 1); | ||
44 | } | ||
45 | |||
46 | void arch_jump_label_transform(struct jump_entry *entry, | ||
47 | enum jump_label_type type) | ||
48 | { | ||
49 | __arch_jump_label_transform(entry, type, false); | ||
50 | } | 40 | } |
51 | 41 | ||
52 | void arch_jump_label_transform_static(struct jump_entry *entry, | 42 | void arch_jump_label_transform_static(struct jump_entry *entry, |
53 | enum jump_label_type type) | 43 | enum jump_label_type type) |
54 | { | 44 | { |
55 | __arch_jump_label_transform(entry, type, true); | 45 | /* |
46 | * We use the architected A64 NOP in arch_static_branch, so there's no | ||
47 | * need to patch an identical A64 NOP over the top of it here. The core | ||
48 | * will call arch_jump_label_transform from a module notifier if the | ||
49 | * NOP needs to be replaced by a branch. | ||
50 | */ | ||
56 | } | 51 | } |
57 | 52 | ||
58 | #endif /* HAVE_JUMP_LABEL */ | 53 | #endif /* HAVE_JUMP_LABEL */ |