diff options
| author | Samuel Holland <samuel.holland@sifive.com> | 2024-03-27 19:04:44 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-05-09 10:44:03 +0300 |
| commit | b9ded1fb298b29d758f9bb3f6532577fff89cdfe (patch) | |
| tree | 4913baf5732c59b358e70e20c49233f5b0cbeb47 /arch/riscv/include/asm/patch.h | |
| parent | 85484bc611385317bab84d16d8462f82c0390049 (diff) | |
| download | linux-b9ded1fb298b29d758f9bb3f6532577fff89cdfe.tar.xz | |
riscv: Pass patch_text() the length in bytes
commit 51781ce8f4486c3738a6c85175b599ad1be71f89 upstream.
patch_text_nosync() already handles an arbitrary length of code, so this
removes a superfluous loop and reduces the number of icache flushes.
Reviewed-by: Björn Töpel <bjorn@rivosinc.com>
Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240327160520.791322-6-samuel.holland@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
[apply to v6.6]
Signed-off-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/riscv/include/asm/patch.h')
| -rw-r--r-- | arch/riscv/include/asm/patch.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/include/asm/patch.h b/arch/riscv/include/asm/patch.h index 9f5d6e14c405..7228e266b9a1 100644 --- a/arch/riscv/include/asm/patch.h +++ b/arch/riscv/include/asm/patch.h @@ -9,7 +9,7 @@ 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, int ninsns); +int patch_text(void *addr, u32 *insns, size_t len); extern int riscv_patch_in_stop_machine; |
