]> www.infradead.org Git - nvme.git/commit
riscv: extend patch_text_nosync() for multiple pages
authorPuranjay Mohan <puranjay12@gmail.com>
Thu, 31 Aug 2023 13:12:27 +0000 (13:12 +0000)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 6 Sep 2023 13:26:05 +0000 (06:26 -0700)
commit9721873c3c023254f04138bbb21d539b4f0f0ad6
treeaad205f7c45646fd33e32e56379f67202d9de60a
parent20e490adea279d49d57b800475938f5b67926d98
riscv: extend patch_text_nosync() for multiple pages

The patch_insn_write() function currently doesn't work for multiple pages
of instructions, therefore patch_text_nosync() will fail with a page fault
if called with lengths spanning multiple pages.

This commit extends the patch_insn_write() function to support multiple
pages by copying at max 2 pages at a time in a loop. This implementation
is similar to text_poke_copy() function of x86.

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