summaryrefslogtreecommitdiff
path: root/arch/powerpc/lib
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2021-11-29 17:41:52 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2021-11-29 17:41:52 +1100
commitaf3fdce4ab0781ea183107c90de9cbf21d701c54 (patch)
tree1807637ca2308d4edf08ea0a5750ab8f914b4303 /arch/powerpc/lib
parent3d030e301856da366380b3865fce6c03037b08a6 (diff)
Revert "powerpc/code-patching: Improve verification of patchability"
This reverts commit 8b8a8f0ab3f5519e45c526f826a655817486c5bb. As reported[1] by Sachin this causes problems with ftrace, and it also causes the code patching selftests to fail as reported[2] by Stephen. So revert it for now. 1: https://lore.kernel.org/linuxppc-dev/3668743C-09DF-4673-B15C-2FFE2A57F7D7@linux.vnet.ibm.com/ 2: https://lore.kernel.org/linuxppc-dev/20211126161747.1f7795b0@canb.auug.org.au/ Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/lib')
-rw-r--r--arch/powerpc/lib/code-patching.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c
index 5e2fe133639e..c5ed98823835 100644
--- a/arch/powerpc/lib/code-patching.c
+++ b/arch/powerpc/lib/code-patching.c
@@ -190,9 +190,10 @@ static int do_patch_instruction(u32 *addr, struct ppc_inst instr)
int patch_instruction(u32 *addr, struct ppc_inst instr)
{
/* Make sure we aren't patching a freed init section */
- if (!kernel_text_address((unsigned long)addr))
+ if (init_mem_is_free && init_section_contains(addr, 4)) {
+ pr_debug("Skipping init section patching addr: 0x%px\n", addr);
return 0;
-
+ }
return do_patch_instruction(addr, instr);
}
NOKPROBE_SYMBOL(patch_instruction);