]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
powerpc/asm: Add a patch_site macro & helpers for patching instructions
authorMichael Ellerman <mpe@ellerman.id.au>
Fri, 29 Mar 2019 11:26:03 +0000 (22:26 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2019 04:25:13 +0000 (06:25 +0200)
commitef7c2ea84e7f3e2fa368d63208684d5b6eb2c919
treef5ca22cb72d3925d01e2d46d520acde4595c14e9
parent0890a57258e06446e04662529e2a7ad3f65d9816
powerpc/asm: Add a patch_site macro & helpers for patching instructions

commit 06d0bbc6d0f56dacac3a79900e9a9a0d5972d818 upstream.

Add a macro and some helper C functions for patching single asm
instructions.

The gas macro means we can do something like:

  1: nop
   patch_site 1b, patch__foo

Which is less visually distracting than defining a GLOBAL symbol at 1,
and also doesn't pollute the symbol table which can confuse eg. perf.

These are obviously similar to our existing feature sections, but are
not automatically patched based on CPU/MMU features, rather they are
designed to be manually patched by C code at some arbitrary point.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/include/asm/code-patching-asm.h [new file with mode: 0644]
arch/powerpc/include/asm/code-patching.h
arch/powerpc/lib/code-patching.c