]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/code-patching: Replace patch_instruction() by ppc_inst_write() in selftests
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Thu, 2 Dec 2021 12:00:27 +0000 (13:00 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 23 Dec 2021 11:36:58 +0000 (22:36 +1100)
commitda83cd0912a0074570dde481acbbd7d45f9c40de
treeab21cc80e9167a39c3bb6130d79fc637032d3d42
parent19f6e0508a2e91d1bcf01d7c226ddc65dd3513e7
powerpc/code-patching: Replace patch_instruction() by ppc_inst_write() in selftests

The purpose of selftests is to check that instructions are
properly formed. Not to check that they properly run.

For that test it uses normal memory, not special test
memory.

In preparation of a future patch enforcing patch_instruction()
to be used only on valid text areas, implement a ppc_inst_write()
instruction which is the complement of ppc_inst_read(). This
new function writes the formated instruction in valid kernel
memory and doesn't bother about icache.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/7cf5335cc07ca9b6f8cdaa20ca9887fce4df3bea.1638446239.git.christophe.leroy@csgroup.eu
arch/powerpc/include/asm/inst.h
arch/powerpc/lib/test-code-patching.c