aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/code-patching.h
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@csgroup.eu>2022-03-22 16:40:20 +0100
committerMichael Ellerman <mpe@ellerman.id.au>2022-05-11 23:06:39 +1000
commitb033767848c4115e486b1a51946de3bee2ac0fa6 (patch)
tree92673a5723ab58269ac2e7d458fa8f4e45643796 /arch/powerpc/include/asm/code-patching.h
parentpowerpc/code-patching: Don't call is_vmalloc_or_module_addr() without CONFIG_MODULES (diff)
downloadlinux-dev-b033767848c4115e486b1a51946de3bee2ac0fa6.tar.xz
linux-dev-b033767848c4115e486b1a51946de3bee2ac0fa6.zip
powerpc/code-patching: Use jump_label for testing freed initmem
Once init is done, initmem is freed forever so no need to test system_state at every call to patch_instruction(). Use jump_label. This reduces by 2% the time needed to activate ftrace on an 8xx. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/0aee964721cab7316cffde21a2ca223cee14d373.1647962456.git.christophe.leroy@csgroup.eu
Diffstat (limited to '')
-rw-r--r--arch/powerpc/include/asm/code-patching.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/code-patching.h b/arch/powerpc/include/asm/code-patching.h
index 409483b2d0ce..bccc3a538b9f 100644
--- a/arch/powerpc/include/asm/code-patching.h
+++ b/arch/powerpc/include/asm/code-patching.h
@@ -22,6 +22,8 @@
#define BRANCH_SET_LINK 0x1
#define BRANCH_ABSOLUTE 0x2
+DECLARE_STATIC_KEY_FALSE(init_mem_is_free);
+
bool is_offset_in_branch_range(long offset);
bool is_offset_in_cond_branch_range(long offset);
int create_branch(ppc_inst_t *instr, const u32 *addr,