]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/code-patching: Improve verification of patchability
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Mon, 15 Nov 2021 10:12:22 +0000 (11:12 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 25 Nov 2021 00:25:32 +0000 (11:25 +1100)
commitbfcf6d5e85072b9189e86cfea965e43613e08a32
tree582258ab2bd7909fa1abeb803043832923002863
parentf4c2f04fb9a620ee4f883a175e5497faabe8b6b0
powerpc/code-patching: Improve verification of patchability

Today, patch_instruction() assumes that it is called exclusively on
valid addresses, and only checks that it is not called on an init
address after init section has been freed.

Improve verification by calling kernel_text_address() instead.

kernel_text_address() already includes a verification of
initmem release.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/bc683d499a411730504b132a924de0ccc2ef1f79.1636971137.git.christophe.leroy@csgroup.eu
arch/powerpc/include/asm/setup.h
arch/powerpc/lib/code-patching.c
arch/powerpc/mm/mem.c