]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
powerpc/asm: Add a patch_site macro & helpers for patching instructions
authorMichael Ellerman <mpe@ellerman.id.au>
Mon, 23 Jul 2018 15:07:52 +0000 (01:07 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 7 Aug 2018 14:32:25 +0000 (00:32 +1000)
commit06d0bbc6d0f56dacac3a79900e9a9a0d5972d818
treec5a1e7711581553f63c1f382945248ce1b1120ab
parent26cb1f36c43ee6e89d2a9f48a5a7500d5248f836
powerpc/asm: Add a patch_site macro & helpers for patching instructions

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>
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