Skip to content

riscv: fix KFENCE pool initialization

Jackie Liu linux-mm linux-riscv 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2riscv: Recognize P4D leaves when splitting the linear mappingarch/riscv/mm/pageattr.c+2 -10 replies
2/2riscv: Prepare late KFENCE pools with PTE mappingsarch/riscv/include/asm/kfence.h arch/riscv/include/asm/set_memory.h arch/riscv/mm/init.c +1 more+65 -210 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] riscv: fix KFENCE pool initialization

From: Jackie Liu <[email protected]>

RISC-V KFENCE pool reservation failures can prevent the system from booting. These fixes allow boot to continue with KFENCE disabled and prepare late pools with the page mappings KFENCE requires.

The first patch fixes P4D leaf detection in the linear-map splitter. The second uses that splitter to prepare late KFENCE pools, while retaining the early PTE mapping.

Built RV64 kernels and RV32 pageattr.o. QEMU KFENCE KUnit covered boot and runtime enabling, pool reservation failure, and page-table allocation failures.

Thanks,
Jackie

Jackie Liu (2):
riscv: Recognize P4D leaves when splitting the linear mapping
riscv: Prepare late KFENCE pools with PTE mappings

 arch/riscv/include/asm/kfence.h     |  4 +-
 arch/riscv/include/asm/set_memory.h |  3 ++
 arch/riscv/mm/init.c                | 23 +++++++++--
 arch/riscv/mm/pageattr.c            | 59 ++++++++++++++++++++---------
 4 files changed, 67 insertions(+), 22 deletions(-)

base-commit: c339f4010dea8b0d754f84ace70cd1b089878ef8