asm-generic-introduce-text-patchingh.patch removed from -mm tree
The quilt patch titled
Subject: asm-generic: introduce text-patching.h
has been removed from the -mm tree. Its filename was
asm-generic-introduce-text-patchingh.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: "Mike Rapoport (Microsoft)" <[email protected]>
Subject: asm-generic: introduce text-patching.h
Date: Wed, 23 Oct 2024 19:27:06 +0300
Several architectures support text patching, but they name the header files that declare patching functions differently.
Make all such headers consistently named text-patching.h and add an empty header in asm-generic for architectures that do not support text patching.
---
arch/alpha/include/asm/Kbuild | 1 arch/arc/include/asm/Kbuild | 1 arch/arm/include/asm/patch.h | 18 - arch/arm/include/asm/text-patching.h | 18 + arch/arm/kernel/ftrace.c | 2 arch/arm/kernel/jump_label.c | 2 arch/arm/kernel/kgdb.c | 2 arch/arm/kernel/patch.c | 2 arch/arm/probes/kprobes/core.c | 2 arch/arm/probes/kprobes/opt-arm.c | 2 arch/arm64/include/asm/patching.h | 17 - arch/arm64/include/asm/text-patching.h | 17 + arch/arm64/kernel/ftrace.c | 2 arch/arm64/kernel/jump_label.c | 2 arch/arm64/kernel/kgdb.c | 2 arch/arm64/kernel/patching.c | 2 arch/arm64/kernel/probes/kprobes.c | 2 arch/arm64/kernel/traps.c | 2 arch/arm64/net/bpf_jit_comp.c | 2 arch/csky/include/asm/Kbuild | 1 arch/hexagon/include/asm/Kbuild | 1 arch/loongarch/include/asm/Kbuild | 1 arch/m68k/include/asm/Kbuild | 1 arch/microblaze/include/asm/Kbuild | 1 arch/mips/include/asm/Kbuild | 1 arch/nios2/include/asm/Kbuild | 1 arch/openrisc/include/asm/Kbuild | 1 arch/parisc/include/asm/patch.h | 13 arch/parisc/include/asm/text-patching.h | 13 arch/parisc/kernel/ftrace.c | 2 arch/parisc/kernel/jump_label.c | 2 arch/parisc/kernel/kgdb.c | 2 arch/parisc/kernel/kprobes.c | 2 arch/parisc/kernel/patch.c | 2 arch/powerpc/include/asm/code-patching.h | 275 -------------------- arch/powerpc/include/asm/kprobes.h | 2 arch/powerpc/include/asm/text-patching.h | 275 ++++++++++++++++++++ arch/powerpc/kernel/crash_dump.c | 2 arch/powerpc/kernel/epapr_paravirt.c | 2 arch/powerpc/kernel/jump_label.c | 2 arch/powerpc/kernel/kgdb.c | 2 arch/powerpc/kernel/kprobes.c | 2 arch/powerpc/kernel/module_32.c | 2 arch/powerpc/kernel/module_64.c | 2 arch/powerpc/kernel/optprobes.c | 2 arch/powerpc/kernel/process.c | 2 arch/powerpc/kernel/security.c | 2 arch/powerpc/kernel/setup_32.c | 2 arch/powerpc/kernel/setup_64.c | 2 arch/powerpc/kernel/static_call.c | 2 arch/powerpc/kernel/trace/ftrace.c | 2 arch/powerpc/kernel/trace/ftrace_64_pg.c | 2 arch/powerpc/lib/code-patching.c | 2 arch/powerpc/lib/feature-fixups.c | 2 arch/powerpc/lib/test-code-patching.c | 2 arch/powerpc/lib/test_emulate_step.c | 2 arch/powerpc/mm/book3s32/mmu.c | 2 arch/powerpc/mm/book3s64/hash_utils.c | 2 arch/powerpc/mm/book3s64/slb.c | 2 arch/powerpc/mm/kasan/init_32.c | 2 arch/powerpc/mm/mem.c | 2 arch/powerpc/mm/nohash/44x.c | 2 arch/powerpc/mm/nohash/book3e_pgtable.c | 2 arch/powerpc/mm/nohash/tlb.c | 2 arch/powerpc/mm/nohash/tlb_64e.c | 2 arch/powerpc/net/bpf_jit_comp.c | 2 arch/powerpc/perf/8xx-pmu.c | 2 arch/powerpc/perf/core-book3s.c | 2 arch/powerpc/platforms/85xx/smp.c | 2 arch/powerpc/platforms/86xx/mpc86xx_smp.c | 2 arch/powerpc/platforms/cell/smp.c | 2 arch/powerpc/platforms/powermac/smp.c | 2 arch/powerpc/platforms/powernv/idle.c | 2 arch/powerpc/platforms/powernv/smp.c | 2 arch/powerpc/platforms/pseries/smp.c | 2 arch/powerpc/xmon/xmon.c | 2 arch/riscv/errata/andes/errata.c | 2 arch/riscv/errata/sifive/errata.c | 2 arch/riscv/errata/thead/errata.c | 2 arch/riscv/include/asm/patch.h | 16 - arch/riscv/include/asm/text-patching.h | 16 + arch/riscv/include/asm/uprobes.h | 2 arch/riscv/kernel/alternative.c | 2 arch/riscv/kernel/cpufeature.c | 3 arch/riscv/kernel/ftrace.c | 2 arch/riscv/kernel/jump_label.c | 2 arch/riscv/kernel/patch.c | 2 arch/riscv/kernel/probes/kprobes.c | 2 arch/riscv/net/bpf_jit_comp64.c | 2 arch/riscv/net/bpf_jit_core.c | 2 arch/sh/include/asm/Kbuild | 1 arch/sparc/include/asm/Kbuild | 1 arch/um/kernel/um_arch.c | 5 arch/x86/include/asm/text-patching.h | 1 arch/xtensa/include/asm/Kbuild | 1 include/asm-generic/text-patching.h | 5 include/linux/text-patching.h | 15 + 97 files changed, 449 insertions(+), 409 deletions(-)
arch/alpha/include/asm/Kbuild renamed from arch/alpha/include/asm/Kbuild~asm-generic-introduce-text-patchingh +1 -0
@@ -5,3 +5,4 @@ generic-y += agp.h generic-y += asm-offsets.h generic-y += kvm_para.h generic-y += mcs_spinlock.h +generic-y += text-patching.h
arch/arc/include/asm/Kbuild renamed from arch/arc/include/asm/Kbuild~asm-generic-introduce-text-patchingh +1 -0
@@ -6,3 +6,4 @@ generic-y += kvm_para.h generic-y += mcs_spinlock.h generic-y += parport.h generic-y += user.h +generic-y += text-patching.h
arch/arm64/include/asm/patching.h deleted +0 -17
@@ -1,17 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef __ASM_PATCHING_H -#define __ASM_PATCHING_H - -#include <linux/types.h> - -int aarch64_insn_read (void *addr,u32 *insnp); -int aarch64_insn_write (void *addr,u32 insn); - -int aarch64_insn_write_literal_u64 (void *addr,u64 val); -void *aarch64_insn_set (void *dst,u32 insn,size_t len); -void *aarch64_insn_copy (void *dst,void *src,size_t len); - -int aarch64_insn_patch_text_nosync (void *addr,u32 insn); -int aarch64_insn_patch_text (void *addrs[],u32 insns[],int cnt); - -#endif /* __ASM_PATCHING_H */
arch/arm64/include/asm/text-patching.h new file +17 -0
@@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_PATCHING_H +#define __ASM_PATCHING_H + +#include <linux/types.h> + +int aarch64_insn_read (void *addr,u32 *insnp); +int aarch64_insn_write (void *addr,u32 insn); + +int aarch64_insn_write_literal_u64 (void *addr,u64 val); +void *aarch64_insn_set (void *dst,u32 insn,size_t len); +void *aarch64_insn_copy (void *dst,void *src,size_t len); + +int aarch64_insn_patch_text_nosync (void *addr,u32 insn); +int aarch64_insn_patch_text (void *addrs[],u32 insns[],int cnt); + +#endif /* __ASM_PATCHING_H */
arch/arm64/kernel/ftrace.c renamed from arch/arm64/kernel/ftrace.c~asm-generic-introduce-text-patchingh +1 -1
@@ -15,7 +15,7 @@#include <asm/debug-monitors.h> #include <asm/ftrace.h> #include <asm/insn.h> -#include <asm/patching.h> +#include <asm/text-patching.h> #ifdef CONFIG_DYNAMIC_FTRACE_WITH_ARGS struct fregs_offset {
arch/arm64/kernel/jump_label.c renamed from arch/arm64/kernel/jump_label.c~asm-generic-introduce-text-patchingh +1 -1
@@ -9,7 +9,7 @@#include <linux/jump_label.h> #include <linux/smp.h> #include <asm/insn.h> -#include <asm/patching.h> +#include <asm/text-patching.h> bool arch_jump_label_transform_queue (struct jump_entry *entry,enum jump_label_type type)
arch/arm64/kernel/kgdb.c renamed from arch/arm64/kernel/kgdb.c~asm-generic-introduce-text-patchingh +1 -1
@@ -17,7 +17,7 @@#include <asm/debug-monitors.h> #include <asm/insn.h> -#include <asm/patching.h> +#include <asm/text-patching.h> #include <asm/traps.h> struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM ] = {
arch/arm64/kernel/patching.c renamed from arch/arm64/kernel/patching.c~asm-generic-introduce-text-patchingh +1 -1
@@ -10,7 +10,7 @@#include <asm/fixmap.h> #include <asm/insn.h> #include <asm/kprobes.h> -#include <asm/patching.h> +#include <asm/text-patching.h> #include <asm/sections.h> static DEFINE_RAW_SPINLOCK (patch_lock);
arch/arm64/kernel/probes/kprobes.c renamed from arch/arm64/kernel/probes/kprobes.c~asm-generic-introduce-text-patchingh +1 -1
@@ -27,7 +27,7 @@#include <asm/debug-monitors.h> #include <asm/insn.h> #include <asm/irq.h> -#include <asm/patching.h> +#include <asm/text-patching.h> #include <asm/ptrace.h> #include <asm/sections.h> #include <asm/system_misc.h>
arch/arm64/kernel/traps.c renamed from arch/arm64/kernel/traps.c~asm-generic-introduce-text-patchingh +1 -1
@@ -41,7 +41,7 @@#include <asm/extable.h> #include <asm/insn.h> #include <asm/kprobes.h> -#include <asm/patching.h> +#include <asm/text-patching.h> #include <asm/traps.h> #include <asm/smp.h> #include <asm/stack_pointer.h>
arch/arm64/net/bpf_jit_comp.c renamed from arch/arm64/net/bpf_jit_comp.c~asm-generic-introduce-text-patchingh +1 -1
@@ -19,7 +19,7 @@#include <asm/cacheflush.h> #include <asm/debug-monitors.h> #include <asm/insn.h> -#include <asm/patching.h> +#include <asm/text-patching.h> #include <asm/set_memory.h> #include "bpf_jit.h"
arch/arm/include/asm/patch.h deleted +0 -18
@@ -1,18 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ARM_KERNEL_PATCH_H -#define _ARM_KERNEL_PATCH_H - -void patch_text (void *addr,unsigned int insn); -void __patch_text_real (void *addr,unsigned int insn,bool remap); - -static inline void __patch_text (void *addr,unsigned int insn) -{ -__patch_text_real (addr, insn, true); -} - -static inline void __patch_text_early (void *addr,unsigned int insn) -{ -__patch_text_real (addr, insn, false); -} - -#endif
arch/arm/include/asm/text-patching.h new file +18 -0
@@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ARM_KERNEL_PATCH_H +#define _ARM_KERNEL_PATCH_H + +void patch_text (void *addr,unsigned int insn); +void __patch_text_real (void *addr,unsigned int insn,bool remap); + +static inline void __patch_text (void *addr,unsigned int insn) +{ +__patch_text_real (addr, insn, true); +} + +static inline void __patch_text_early (void *addr,unsigned int insn) +{ +__patch_text_real (addr, insn, false); +} + +#endif
arch/arm/kernel/ftrace.c renamed from arch/arm/kernel/ftrace.c~asm-generic-introduce-text-patchingh +1 -1
@@ -23,7 +23,7 @@#include <asm/insn.h> #include <asm/set_memory.h> #include <asm/stacktrace.h> -#include <asm/patch.h> +#include <asm/text-patching.h> /* * The compiler emitted profiling hook consists of
arch/arm/kernel/jump_label.c renamed from arch/arm/kernel/jump_label.c~asm-generic-introduce-text-patchingh +1 -1
@@ -1,7 +1,7 @@// SPDX-License-Identifier: GPL-2.0 #include <linux/kernel.h> #include <linux/jump_label.h> -#include <asm/patch.h> +#include <asm/text-patching.h> #include <asm/insn.h> static void __arch_jump_label_transform(struct jump_entry *entry,
arch/arm/kernel/kgdb.c renamed from arch/arm/kernel/kgdb.c~asm-generic-introduce-text-patchingh +1 -1
@@ -15,7 +15,7 @@#include <linux/kgdb.h> #include <linux/uaccess.h> -#include <asm/patch.h> +#include <asm/text-patching.h> #include <asm/traps.h> struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM] =
arch/arm/kernel/patch.c renamed from arch/arm/kernel/patch.c~asm-generic-introduce-text-patchingh +1 -1
@@ -9,7 +9,7 @@#include <asm/fixmap.h> #include <asm/smp_plat.h> #include <asm/opcodes.h> -#include <asm/patch.h> +#include <asm/text-patching.h> struct patch {void *addr;
arch/arm/probes/kprobes/core.c renamed from arch/arm/probes/kprobes/core.c~asm-generic-introduce-text-patchingh +1 -1
@@ -25,7 +25,7 @@#include <asm/cacheflush.h> #include <linux/percpu.h> #include <linux/bug.h> -#include <asm/patch.h> +#include <asm/text-patching.h> #include <asm/sections.h> #include "../decode-arm.h"
arch/arm/probes/kprobes/opt-arm.c renamed from arch/arm/probes/kprobes/opt-arm.c~asm-generic-introduce-text-patchingh +1 -1
@@ -14,7 +14,7 @@/* for arm_gen_branch */ #include <asm/insn.h> /* for patch_text */ -#include <asm/patch.h> +#include <asm/text-patching.h> #include "core.h"
arch/csky/include/asm/Kbuild renamed from arch/csky/include/asm/Kbuild~asm-generic-introduce-text-patchingh +1 -0
@@ -11,3 +11,4 @@ generic-y += qspinlock.h generic-y += parport.h generic-y += user.h generic-y += vmlinux.lds.h +generic-y += text-patching.h
arch/hexagon/include/asm/Kbuild renamed from arch/hexagon/include/asm/Kbuild~asm-generic-introduce-text-patchingh +1 -0
@@ -5,3 +5,4 @@ generic-y += extable.h generic-y += iomap.h generic-y += kvm_para.h generic-y += mcs_spinlock.h +generic-y += text-patching.h
arch/loongarch/include/asm/Kbuild renamed from arch/loongarch/include/asm/Kbuild~asm-generic-introduce-text-patchingh +1 -0
@@ -11,3 +11,4 @@ generic-y += ioctl.h generic-y += mmzone.h generic-y += statfs.h generic-y += param.h +generic-y += text-patching.h
arch/m68k/include/asm/Kbuild renamed from arch/m68k/include/asm/Kbuild~asm-generic-introduce-text-patchingh +1 -0
@@ -4,3 +4,4 @@ generic-y += extable.h generic-y += kvm_para.h generic-y += mcs_spinlock.h generic-y += spinlock.h +generic-y += text-patching.h
arch/microblaze/include/asm/Kbuild renamed from arch/microblaze/include/asm/Kbuild~asm-generic-introduce-text-patchingh +1 -0
@@ -8,3 +8,4 @@ generic-y += parport.h generic-y += syscalls.h generic-y += tlb.h generic-y += user.h +generic-y += text-patching.h
arch/mips/include/asm/Kbuild renamed from arch/mips/include/asm/Kbuild~asm-generic-introduce-text-patchingh +1 -0
@@ -13,3 +13,4 @@ generic-y += parport.h generic-y += qrwlock.h generic-y += qspinlock.h generic-y += user.h +generic-y += text-patching.h
arch/nios2/include/asm/Kbuild renamed from arch/nios2/include/asm/Kbuild~asm-generic-introduce-text-patchingh +1 -0
@@ -7,3 +7,4 @@ generic-y += kvm_para.h generic-y += mcs_spinlock.h generic-y += spinlock.h generic-y += user.h +generic-y += text-patching.h
arch/openrisc/include/asm/Kbuild renamed from arch/openrisc/include/asm/Kbuild~asm-generic-introduce-text-patchingh +1 -0
@@ -9,3 +9,4 @@ generic-y += spinlock.h generic-y += qrwlock_types.h generic-y += qrwlock.h generic-y += user.h +generic-y += text-patching.h
arch/parisc/include/asm/patch.h deleted +0 -13
@@ -1,13 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _PARISC_KERNEL_PATCH_H -#define _PARISC_KERNEL_PATCH_H - -/* stop machine and patch kernel text */ -void patch_text (void *addr,unsigned int insn); -void patch_text_multiple (void *addr,u32 *insn,unsigned int len); - -/* patch kernel text with machine already stopped (e.g. in kgdb) */ -void __patch_text (void *addr,u32 insn); -void __patch_text_multiple (void *addr,u32 *insn,unsigned int len); - -#endif
arch/parisc/include/asm/text-patching.h new file +13 -0
@@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _PARISC_KERNEL_PATCH_H +#define _PARISC_KERNEL_PATCH_H + +/* stop machine and patch kernel text */ +void patch_text (void *addr,unsigned int insn); +void patch_text_multiple (void *addr,u32 *insn,unsigned int len); + +/* patch kernel text with machine already stopped (e.g. in kgdb) */ +void __patch_text (void *addr,u32 insn); +void __patch_text_multiple (void *addr,u32 *insn,unsigned int len); + +#endif
arch/parisc/kernel/ftrace.c renamed from arch/parisc/kernel/ftrace.c~asm-generic-introduce-text-patchingh +1 -1
@@ -20,7 +20,7 @@#include <asm/assembly.h> #include <asm/sections.h> #include <asm/ftrace.h> -#include <asm/patch.h> +#include <asm/text-patching.h> #define __hot __section(".text.hot")
arch/parisc/kernel/jump_label.c renamed from arch/parisc/kernel/jump_label.c~asm-generic-introduce-text-patchingh +1 -1
@@ -8,7 +8,7 @@#include <linux/jump_label.h> #include <linux/bug.h> #include <asm/alternative.h> -#include <asm/patch.h> +#include <asm/text-patching.h> static inline int reassemble_17 (int as17) {
arch/parisc/kernel/kgdb.c renamed from arch/parisc/kernel/kgdb.c~asm-generic-introduce-text-patchingh +1 -1
@@ -16,7 +16,7 @@#include <asm/ptrace.h> #include <asm/traps.h> #include <asm/processor.h> -#include <asm/patch.h> +#include <asm/text-patching.h> #include <asm/cacheflush.h> const struct kgdb_arch arch_kgdb_ops = {
arch/parisc/kernel/kprobes.c renamed from arch/parisc/kernel/kprobes.c~asm-generic-introduce-text-patchingh +1 -1
@@ -12,7 +12,7 @@#include <linux/kprobes.h> #include <linux/slab.h> #include <asm/cacheflush.h> -#include <asm/patch.h> +#include <asm/text-patching.h> DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
arch/parisc/kernel/patch.c renamed from arch/parisc/kernel/patch.c~asm-generic-introduce-text-patchingh +1 -1
@@ -13,7 +13,7 @@#include <asm/cacheflush.h> #include <asm/fixmap.h> -#include <asm/patch.h> +#include <asm/text-patching.h> struct patch {void *addr;
arch/powerpc/include/asm/code-patching.h deleted +0 -275
275 lines not on this page · raw message
arch/powerpc/include/asm/kprobes.h renamed from arch/powerpc/include/asm/kprobes.h~asm-generic-introduce-text-patchingh +1 -1
@@ -21,7 +21,7 @@#include <linux/percpu.h> #include <linux/module.h> #include <asm/probes.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #ifdef CONFIG_KPROBES #define __ARCH_WANT_KPROBES_INSN_SLOT
arch/powerpc/include/asm/text-patching.h new file +275 -0
275 lines not on this page · raw message
arch/powerpc/kernel/crash_dump.c renamed from arch/powerpc/kernel/crash_dump.c~asm-generic-introduce-text-patchingh +1 -1
@@ -13,7 +13,7 @@#include <linux/io.h> #include <linux/memblock.h> #include <linux/of.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/kdump.h> #include <asm/firmware.h> #include <linux/uio.h>
arch/powerpc/kernel/epapr_paravirt.c renamed from arch/powerpc/kernel/epapr_paravirt.c~asm-generic-introduce-text-patchingh +1 -1
@@ -9,7 +9,7 @@#include <linux/of_fdt.h> #include <asm/epapr_hcalls.h> #include <asm/cacheflush.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/machdep.h> #include <asm/inst.h>
arch/powerpc/kernel/jump_label.c renamed from arch/powerpc/kernel/jump_label.c~asm-generic-introduce-text-patchingh +1 -1
@@ -5,7 +5,7 @@#include <linux/kernel.h> #include <linux/jump_label.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/inst.h> void arch_jump_label_transform(struct jump_entry *entry,
arch/powerpc/kernel/kgdb.c renamed from arch/powerpc/kernel/kgdb.c~asm-generic-introduce-text-patchingh +1 -1
@@ -21,7 +21,7 @@#include <asm/processor.h> #include <asm/machdep.h> #include <asm/debug.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <linux/slab.h> #include <asm/inst.h>
arch/powerpc/kernel/kprobes.c renamed from arch/powerpc/kernel/kprobes.c~asm-generic-introduce-text-patchingh +1 -1
@@ -21,7 +21,7 @@#include <linux/slab.h> #include <linux/set_memory.h> #include <linux/execmem.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/cacheflush.h> #include <asm/sstep.h> #include <asm/sections.h>
arch/powerpc/kernel/module_32.c renamed from arch/powerpc/kernel/module_32.c~asm-generic-introduce-text-patchingh +1 -1
@@ -18,7 +18,7 @@#include <linux/bug.h> #include <linux/sort.h> #include <asm/setup.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> /* Count how many different relocations (different symbol, different addend) */
arch/powerpc/kernel/module_64.c renamed from arch/powerpc/kernel/module_64.c~asm-generic-introduce-text-patchingh +1 -1
@@ -17,7 +17,7 @@#include <linux/kernel.h> #include <asm/module.h> #include <asm/firmware.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <linux/sort.h> #include <asm/setup.h> #include <asm/sections.h>
arch/powerpc/kernel/optprobes.c renamed from arch/powerpc/kernel/optprobes.c~asm-generic-introduce-text-patchingh +1 -1
@@ -13,7 +13,7 @@#include <asm/kprobes.h> #include <asm/ptrace.h> #include <asm/cacheflush.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/sstep.h> #include <asm/ppc-opcode.h> #include <asm/inst.h>
arch/powerpc/kernel/process.c renamed from arch/powerpc/kernel/process.c~asm-generic-introduce-text-patchingh +1 -1
@@ -54,7 +54,7 @@#include <asm/firmware.h> #include <asm/hw_irq.h> #endif -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/exec.h> #include <asm/livepatch.h> #include <asm/cpu_has_feature.h>
arch/powerpc/kernel/security.c renamed from arch/powerpc/kernel/security.c~asm-generic-introduce-text-patchingh +1 -1
@@ -14,7 +14,7 @@#include <linux/debugfs.h> #include <asm/asm-prototypes.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/security_features.h> #include <asm/sections.h> #include <asm/setup.h>
arch/powerpc/kernel/setup_32.c renamed from arch/powerpc/kernel/setup_32.c~asm-generic-introduce-text-patchingh +1 -1
@@ -40,7 +40,7 @@#include <asm/time.h> #include <asm/serial.h> #include <asm/udbg.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/cpu_has_feature.h> #include <asm/asm-prototypes.h> #include <asm/kdump.h>
arch/powerpc/kernel/setup_64.c renamed from arch/powerpc/kernel/setup_64.c~asm-generic-introduce-text-patchingh +1 -1
@@ -60,7 +60,7 @@#include <asm/xmon.h> #include <asm/udbg.h> #include <asm/kexec.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/ftrace.h> #include <asm/opal.h> #include <asm/cputhreads.h>
arch/powerpc/kernel/static_call.c renamed from arch/powerpc/kernel/static_call.c~asm-generic-introduce-text-patchingh +1 -1
@@ -2,7 +2,7 @@#include <linux/memory.h> #include <linux/static_call.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> void arch_static_call_transform (void *site,void *tramp,void *func,bool tail) {
arch/powerpc/kernel/trace/ftrace_64_pg.c renamed from arch/powerpc/kernel/trace/ftrace_64_pg.c~asm-generic-introduce-text-patchingh +1 -1
@@ -23,7 +23,7 @@#include <linux/list.h> #include <asm/cacheflush.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/ftrace.h> #include <asm/syscall.h> #include <asm/inst.h>
arch/powerpc/kernel/trace/ftrace.c renamed from arch/powerpc/kernel/trace/ftrace.c~asm-generic-introduce-text-patchingh +1 -1
@@ -23,7 +23,7 @@#include <linux/list.h> #include <asm/cacheflush.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/ftrace.h> #include <asm/syscall.h> #include <asm/inst.h>
arch/powerpc/lib/code-patching.c renamed from arch/powerpc/lib/code-patching.c~asm-generic-introduce-text-patchingh +1 -1
@@ -17,7 +17,7 @@#include <asm/tlb.h> #include <asm/tlbflush.h> #include <asm/page.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/inst.h> static int __patch_mem (void *exec_addr,unsigned long val,void *patch_addr,bool is_dword)
arch/powerpc/lib/feature-fixups.c renamed from arch/powerpc/lib/feature-fixups.c~asm-generic-introduce-text-patchingh +1 -1
@@ -16,7 +16,7 @@#include <linux/sched/mm.h> #include <linux/stop_machine.h> #include <asm/cputable.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/interrupt.h> #include <asm/page.h> #include <asm/sections.h>
arch/powerpc/lib/test-code-patching.c renamed from arch/powerpc/lib/test-code-patching.c~asm-generic-introduce-text-patchingh +1 -1
@@ -6,7 +6,7 @@#include <linux/vmalloc.h> #include <linux/init.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> static int __init instr_is_branch_to_addr (const u32 *instr,unsigned long addr) {
arch/powerpc/lib/test_emulate_step.c renamed from arch/powerpc/lib/test_emulate_step.c~asm-generic-introduce-text-patchingh +1 -1
@@ -11,7 +11,7 @@#include <asm/cpu_has_feature.h> #include <asm/sstep.h> #include <asm/ppc-opcode.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/inst.h> #define MAX_SUBTESTS 16
arch/powerpc/mm/book3s32/mmu.c renamed from arch/powerpc/mm/book3s32/mmu.c~asm-generic-introduce-text-patchingh +1 -1
@@ -25,7 +25,7 @@#include <asm/mmu.h> #include <asm/machdep.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/sections.h> #include <mm/mmu_decl.h>
arch/powerpc/mm/book3s64/hash_utils.c renamed from arch/powerpc/mm/book3s64/hash_utils.c~asm-generic-introduce-text-patchingh +1 -1
@@ -57,7 +57,7 @@#include <asm/sections.h> #include <asm/copro.h> #include <asm/udbg.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/fadump.h> #include <asm/firmware.h> #include <asm/tm.h>
arch/powerpc/mm/book3s64/slb.c renamed from arch/powerpc/mm/book3s64/slb.c~asm-generic-introduce-text-patchingh +1 -1
@@ -24,7 +24,7 @@#include <linux/pgtable.h> #include <asm/udbg.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include "internal.h"
arch/powerpc/mm/kasan/init_32.c renamed from arch/powerpc/mm/kasan/init_32.c~asm-generic-introduce-text-patchingh +1 -1
@@ -7,7 +7,7 @@#include <linux/memblock.h> #include <linux/sched/task.h> #include <asm/pgalloc.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <mm/mmu_decl.h> static pgprot_t __init kasan_prot_ro (void )
arch/powerpc/mm/mem.c renamed from arch/powerpc/mm/mem.c~asm-generic-introduce-text-patchingh +1 -1
@@ -26,7 +26,7 @@#include <asm/svm.h> #include <asm/mmzone.h> #include <asm/ftrace.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/setup.h> #include <asm/fixmap.h>
arch/powerpc/mm/nohash/44x.c renamed from arch/powerpc/mm/nohash/44x.c~asm-generic-introduce-text-patchingh +1 -1
@@ -24,7 +24,7 @@#include <asm/mmu.h> #include <asm/page.h> #include <asm/cacheflush.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/smp.h> #include <mm/mmu_decl.h>
arch/powerpc/mm/nohash/book3e_pgtable.c renamed from arch/powerpc/mm/nohash/book3e_pgtable.c~asm-generic-introduce-text-patchingh +1 -1
@@ -10,7 +10,7 @@#include <asm/pgalloc.h> #include <asm/tlb.h> #include <asm/dma.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <mm/mmu_decl.h>
arch/powerpc/mm/nohash/tlb_64e.c renamed from arch/powerpc/mm/nohash/tlb_64e.c~asm-generic-introduce-text-patchingh +1 -1
@@ -24,7 +24,7 @@#include <asm/pgalloc.h> #include <asm/tlbflush.h> #include <asm/tlb.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/cputhreads.h> #include <mm/mmu_decl.h>
arch/powerpc/mm/nohash/tlb.c renamed from arch/powerpc/mm/nohash/tlb.c~asm-generic-introduce-text-patchingh +1 -1
@@ -37,7 +37,7 @@#include <asm/pgalloc.h> #include <asm/tlbflush.h> #include <asm/tlb.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/cputhreads.h> #include <asm/hugetlb.h> #include <asm/paca.h>
arch/powerpc/net/bpf_jit_comp.c renamed from arch/powerpc/net/bpf_jit_comp.c~asm-generic-introduce-text-patchingh +1 -1
@@ -18,7 +18,7 @@#include <linux/bpf.h> #include <asm/kprobes.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include "bpf_jit.h"
arch/powerpc/perf/8xx-pmu.c renamed from arch/powerpc/perf/8xx-pmu.c~asm-generic-introduce-text-patchingh +1 -1
@@ -14,7 +14,7 @@#include <asm/machdep.h> #include <asm/firmware.h> #include <asm/ptrace.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/inst.h> #define PERF_8xx_ID_CPU_CYCLES 1
arch/powerpc/perf/core-book3s.c renamed from arch/powerpc/perf/core-book3s.c~asm-generic-introduce-text-patchingh +1 -1
@@ -16,7 +16,7 @@#include <asm/machdep.h> #include <asm/firmware.h> #include <asm/ptrace.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/hw_irq.h> #include <asm/interrupt.h>
arch/powerpc/platforms/85xx/smp.c renamed from arch/powerpc/platforms/85xx/smp.c~asm-generic-introduce-text-patchingh +1 -1
@@ -23,7 +23,7 @@#include <asm/mpic.h> #include <asm/cacheflush.h> #include <asm/dbell.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/cputhreads.h> #include <asm/fsl_pm.h>
arch/powerpc/platforms/86xx/mpc86xx_smp.c renamed from arch/powerpc/platforms/86xx/mpc86xx_smp.c~asm-generic-introduce-text-patchingh +1 -1
@@ -12,7 +12,7 @@#include <linux/delay.h> #include <linux/pgtable.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/page.h> #include <asm/pci-bridge.h> #include <asm/mpic.h>
arch/powerpc/platforms/cell/smp.c renamed from arch/powerpc/platforms/cell/smp.c~asm-generic-introduce-text-patchingh +1 -1
@@ -35,7 +35,7 @@#include <asm/firmware.h> #include <asm/rtas.h> #include <asm/cputhreads.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include "interrupt.h" #include <asm/udbg.h>
arch/powerpc/platforms/powermac/smp.c renamed from arch/powerpc/platforms/powermac/smp.c~asm-generic-introduce-text-patchingh +1 -1
@@ -35,7 +35,7 @@#include <asm/ptrace.h> #include <linux/atomic.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/irq.h> #include <asm/page.h> #include <asm/sections.h>
arch/powerpc/platforms/powernv/idle.c renamed from arch/powerpc/platforms/powernv/idle.c~asm-generic-introduce-text-patchingh +1 -1
@@ -18,7 +18,7 @@#include <asm/opal.h> #include <asm/cputhreads.h> #include <asm/cpuidle.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/smp.h> #include <asm/runlatch.h> #include <asm/dbell.h>
arch/powerpc/platforms/powernv/smp.c renamed from arch/powerpc/platforms/powernv/smp.c~asm-generic-introduce-text-patchingh +1 -1
@@ -28,7 +28,7 @@#include <asm/xive.h> #include <asm/opal.h> #include <asm/runlatch.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/dbell.h> #include <asm/kvm_ppc.h> #include <asm/ppc-opcode.h>
arch/powerpc/platforms/pseries/smp.c renamed from arch/powerpc/platforms/pseries/smp.c~asm-generic-introduce-text-patchingh +1 -1
@@ -39,7 +39,7 @@#include <asm/xive.h> #include <asm/dbell.h> #include <asm/plpar_wrappers.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/svm.h> #include <asm/kvm_guest.h>
arch/powerpc/xmon/xmon.c renamed from arch/powerpc/xmon/xmon.c~asm-generic-introduce-text-patchingh +1 -1
@@ -50,7 +50,7 @@#include <asm/xive.h> #include <asm/opal.h> #include <asm/firmware.h> -#include <asm/code-patching.h> +#include <asm/text-patching.h> #include <asm/sections.h> #include <asm/inst.h> #include <asm/interrupt.h>
arch/riscv/errata/andes/errata.c renamed from arch/riscv/errata/andes/errata.c~asm-generic-introduce-text-patchingh +1 -1
@@ -13,7 +13,7 @@#include <asm/alternative.h> #include <asm/cacheflush.h> #include <asm/errata_list.h> -#include <asm/patch.h> +#include <asm/text-patching.h> #include <asm/processor.h> #include <asm/sbi.h> #include <asm/vendorid_list.h>
arch/riscv/errata/sifive/errata.c renamed from arch/riscv/errata/sifive/errata.c~asm-generic-introduce-text-patchingh +1 -1
@@ -8,7 +8,7 @@#include <linux/module.h> #include <linux/string.h> #include <linux/bug.h> -#include <asm/patch.h> +#include <asm/text-patching.h> #include <asm/alternative.h> #include <asm/vendorid_list.h> #include <asm/errata_list.h>
arch/riscv/errata/thead/errata.c renamed from arch/riscv/errata/thead/errata.c~asm-generic-introduce-text-patchingh +1 -1
@@ -16,7 +16,7 @@#include <asm/errata_list.h> #include <asm/hwprobe.h> #include <asm/io.h> -#include <asm/patch.h> +#include <asm/text-patching.h> #include <asm/vendorid_list.h> #include <asm/vendor_extensions.h>
arch/riscv/include/asm/patch.h deleted +0 -16
@@ -1,16 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* -* Copyright (C) 2020 SiFive -*/ - -#ifndef _ASM_RISCV_PATCH_H -#define _ASM_RISCV_PATCH_H - -int patch_insn_write (void *addr,const void *insn,size_t len); -int patch_text_nosync (void *addr,const void *insns,size_t len); -int patch_text_set_nosync (void *addr,u8 c,size_t len); -int patch_text (void *addr,u32 *insns,size_t len); - -extern int riscv_patch_in_stop_machine; - -#endif /* _ASM_RISCV_PATCH_H */
arch/riscv/include/asm/text-patching.h new file +16 -0
@@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +* Copyright (C) 2020 SiFive +*/ + +#ifndef _ASM_RISCV_PATCH_H +#define _ASM_RISCV_PATCH_H + +int patch_insn_write (void *addr,const void *insn,size_t len); +int patch_text_nosync (void *addr,const void *insns,size_t len); +int patch_text_set_nosync (void *addr,u8 c,size_t len); +int patch_text (void *addr,u32 *insns,size_t len); + +extern int riscv_patch_in_stop_machine; + +#endif /* _ASM_RISCV_PATCH_H */
arch/riscv/include/asm/uprobes.h renamed from arch/riscv/include/asm/uprobes.h~asm-generic-introduce-text-patchingh +1 -1
@@ -4,7 +4,7 @@#define _ASM_RISCV_UPROBES_H#include <asm/probes.h> -#include <asm/patch.h> +#include <asm/text-patching.h> #include <asm/bug.h> #define MAX_UINSN_BYTES 8
arch/riscv/kernel/alternative.c renamed from arch/riscv/kernel/alternative.c~asm-generic-introduce-text-patchingh +1 -1
@@ -18,7 +18,7 @@#include <asm/sbi.h> #include <asm/csr.h> #include <asm/insn.h> -#include <asm/patch.h> +#include <asm/text-patching.h> struct cpu_manufacturer_info_t {unsigned long vendor_id;
arch/riscv/kernel/cpufeature.c renamed from arch/riscv/kernel/cpufeature.c~asm-generic-introduce-text-patchingh +2 -1
@@ -20,7 +20,8 @@#include <asm/cacheflush.h> #include <asm/cpufeature.h> #include <asm/hwcap.h> -#include <asm/patch.h> +#include <asm/text-patching.h> +#include <asm/hwprobe.h> #include <asm/processor.h> #include <asm/sbi.h> #include <asm/vector.h>
arch/riscv/kernel/ftrace.c renamed from arch/riscv/kernel/ftrace.c~asm-generic-introduce-text-patchingh +1 -1
@@ -10,7 +10,7 @@#include <linux/memory.h> #include <linux/stop_machine.h> #include <asm/cacheflush.h> -#include <asm/patch.h> +#include <asm/text-patching.h> #ifdef CONFIG_DYNAMIC_FTRACE void ftrace_arch_code_modify_prepare(void) __acquires(&text_mutex)
arch/riscv/kernel/jump_label.c renamed from arch/riscv/kernel/jump_label.c~asm-generic-introduce-text-patchingh +1 -1
@@ -10,7 +10,7 @@#include <linux/mutex.h> #include <asm/bug.h> #include <asm/cacheflush.h> -#include <asm/patch.h> +#include <asm/text-patching.h> #define RISCV_INSN_NOP 0x00000013U#define RISCV_INSN_JAL 0x0000006fU
arch/riscv/kernel/patch.c renamed from arch/riscv/kernel/patch.c~asm-generic-introduce-text-patchingh +1 -1
@@ -13,7 +13,7 @@#include <asm/cacheflush.h> #include <asm/fixmap.h> #include <asm/ftrace.h> -#include <asm/patch.h> +#include <asm/text-patching.h> #include <asm/sections.h> struct patch_insn {
arch/riscv/kernel/probes/kprobes.c renamed from arch/riscv/kernel/probes/kprobes.c~asm-generic-introduce-text-patchingh +1 -1
@@ -12,7 +12,7 @@#include <asm/sections.h> #include <asm/cacheflush.h> #include <asm/bug.h> -#include <asm/patch.h> +#include <asm/text-patching.h> #include "decode-insn.h"
arch/riscv/net/bpf_jit_comp64.c renamed from arch/riscv/net/bpf_jit_comp64.c~asm-generic-introduce-text-patchingh +1 -1
@@ -10,7 +10,7 @@#include <linux/filter.h> #include <linux/memory.h> #include <linux/stop_machine.h> -#include <asm/patch.h> +#include <asm/text-patching.h> #include <asm/cfi.h> #include <asm/percpu.h> #include "bpf_jit.h"
arch/riscv/net/bpf_jit_core.c renamed from arch/riscv/net/bpf_jit_core.c~asm-generic-introduce-text-patchingh +1 -1
@@ -9,7 +9,7 @@#include <linux/bpf.h> #include <linux/filter.h> #include <linux/memory.h> -#include <asm/patch.h> +#include <asm/text-patching.h> #include <asm/cfi.h> #include "bpf_jit.h"
arch/sh/include/asm/Kbuild renamed from arch/sh/include/asm/Kbuild~asm-generic-introduce-text-patchingh +1 -0
@@ -3,3 +3,4 @@ generated-y += syscall_table.h generic-y += kvm_para.h generic-y += mcs_spinlock.h generic-y += parport.h +generic-y += text-patching.h
arch/sparc/include/asm/Kbuild renamed from arch/sparc/include/asm/Kbuild~asm-generic-introduce-text-patchingh +1 -0
@@ -4,3 +4,4 @@ generated-y += syscall_table_64.h generic-y += agp.h generic-y += kvm_para.h generic-y += mcs_spinlock.h +generic-y += text-patching.h
arch/um/kernel/um_arch.c renamed from arch/um/kernel/um_arch.c~asm-generic-introduce-text-patchingh +5 -0
@@ -468,6 +468,11 @@ void *text_poke(void *addr, const void *return memcpy (addr, opcode, len); } +void *text_poke_copy (void *addr,const void *opcode,size_t len) +{ +return text_poke (addr, opcode, len); +} +void text_poke_sync (void ) { }
arch/x86/include/asm/text-patching.h renamed from arch/x86/include/asm/text-patching.h~asm-generic-introduce-text-patchingh +1 -0
@@ -35,6 +35,7 @@ extern void *text_poke(void *addr, constextern void text_poke_sync (void );extern void *text_poke_kgdb (void *addr,const void *opcode,size_t len);extern void *text_poke_copy (void *addr,const void *opcode,size_t len); +#define text_poke_copy text_poke_copyextern void *text_poke_copy_locked (void *addr,const void *opcode,size_t len,bool core_ok);extern void *text_poke_set (void *addr,int c,size_t len);extern int poke_int3_handler (struct pt_regs *regs);
arch/xtensa/include/asm/Kbuild renamed from arch/xtensa/include/asm/Kbuild~asm-generic-introduce-text-patchingh +1 -0
@@ -8,3 +8,4 @@ generic-y += parport.h generic-y += qrwlock.h generic-y += qspinlock.h generic-y += user.h +generic-y += text-patching.h
include/asm-generic/text-patching.h new file +5 -0
@@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_GENERIC_TEXT_PATCHING_H +#define _ASM_GENERIC_TEXT_PATCHING_H + +#endif /* _ASM_GENERIC_TEXT_PATCHING_H */
include/linux/text-patching.h new file +15 -0
@@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_TEXT_PATCHING_H +#define _LINUX_TEXT_PATCHING_H + +#include <asm/text-patching.h> + +#ifndef text_poke_copy +static inline void *text_poke_copy (void *dst,const void *src,size_t len) +{ +return memcpy (dst, src, len); +} +#define text_poke_copy text_poke_copy +#endif + +#endif /* _LINUX_TEXT_PATCHING_H */
_
Patches currently in -mm which might be from [email protected] are