OSDN Git Service

riscv: implement a memset like function for text
authorPuranjay Mohan <puranjay12@gmail.com>
Thu, 31 Aug 2023 13:12:28 +0000 (13:12 +0000)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 6 Sep 2023 13:26:06 +0000 (06:26 -0700)
commitcad539baa48ff257b598000a90db2b7edd4b2dd5
treeeee232a8bf720d79d5c2a19e76df01658e593658
parent9721873c3c023254f04138bbb21d539b4f0f0ad6
riscv: implement a memset like function for text

The BPF JIT needs to write invalid instructions to RX regions of memory to
invalidate removed BPF programs. This needs a function like memset() that
can work with RX memory.

Implement patch_text_set_nosync() which is similar to text_poke_set() of
x86.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Reviewed-by: Pu Lehui <pulehui@huawei.com>
Acked-by: Björn Töpel <bjorn@kernel.org>
Tested-by: Björn Töpel <bjorn@rivosinc.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/20230831131229.497941-4-puranjay12@gmail.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/patch.h
arch/riscv/kernel/patch.c