powerpc/code-patching: Remove protection against patching init addresses after init
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Fri, 2 Dec 2022 08:31:43 +0000 (09:31 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 2 Dec 2022 10:59:57 +0000 (21:59 +1100)
commit6f3a81b60091031c2c14eb2373d1937b027deb46
tree6185cf59f2c988b5d5f7f5ae943f7968dd88708f
parentb988e7797d09379057cf991ae082f9ad7a309a63
powerpc/code-patching: Remove protection against patching init addresses after init

Once init section is freed, attempting to patch init code
ends up in the weed.

Commit 51c3c62b58b3 ("powerpc: Avoid code patching freed init sections")
protected patch_instruction() against that, but it is the responsibility
of the caller to ensure that the patched memory is valid.

All callers have now been verified and fixed so the check
can be removed.

This improves ftrace activation by about 2% on 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/504310828f473d424e2ed229eff57bf075f52796.1669969781.git.christophe.leroy@csgroup.eu
arch/powerpc/include/asm/code-patching.h
arch/powerpc/lib/code-patching.c
arch/powerpc/mm/mem.c