riscv: kprobes: Fix build error when MMU=n
authorJisheng Zhang <jszhang@kernel.org>
Sat, 8 May 2021 15:43:47 +0000 (23:43 +0800)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Sun, 23 May 2021 05:04:58 +0000 (22:04 -0700)
commit02ccdeed1817a587161ad091887e11ac8a2586b2
tree62a0b77b5f258e20d605a8c3d0e79d08a9175bb0
parent97a031082320897ee5b06352d0ab3d7cf47321d3
riscv: kprobes: Fix build error when MMU=n

lkp reported a randconfig failure:

arch/riscv/kernel/probes/kprobes.c:90:22: error: use of undeclared identifier 'PAGE_KERNEL_READ_EXEC'

We implemented the alloc_insn_page() to allocate PAGE_KERNEL_READ_EXEC
page for kprobes insn page for STRICT_MODULE_RWX. But if MMU=n, we
should fall back to the generic weak alloc_insn_page() by generic
kprobe subsystem.

Fixes: cdd1b2bd358f ("riscv: kprobes: Implement alloc_insn_page()")
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/kernel/probes/kprobes.c