]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 23 Apr 2019 15:48:55 +0000 (17:48 +0200)
commit522d9ee9f9c63ef14e65a6d060f72e7903c539f0
treeca8b1dbebe166f7f5a350a71f126335e91314475
parent56c684d5a1506f5824c9ada6f00d59bab50e0099
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.

BugLink: https://bugs.launchpad.net/bugs/1822870
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 06d0bbc6d0f56dacac3a79900e9a9a0d5972d818)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
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