mbox series

[0/2] riscv: fix debug_pagealloc

Message ID cover.1715750938.git.namcao@linutronix.de (mailing list archive)
Headers show
Series riscv: fix debug_pagealloc | expand

Message

Nam Cao May 15, 2024, 5:50 a.m. UTC
The debug_pagealloc feature is not functional on RISCV. With this feature
enabled (CONFIG_DEBUG_PAGEALLOC=y and debug_pagealloc=on), kernel crashes
early during boot.

QEMU command that can reproduce this problem:
   qemu-system-riscv64 -machine virt \
   -kernel Image \
   -append "console=ttyS0 root=/dev/vda debug_pagealloc=on" \
   -nographic \
   -drive "file=root.img,format=raw,id=hd0" \
   -device virtio-blk-device,drive=hd0 \
   -m 4G \

This series makes debug_pagealloc functional.

Nam Cao (2):
  riscv: force PAGE_SIZE linear mapping if debug_pagealloc is enabled
  riscv: rewrite __kernel_map_pages() to fix sleeping in invalid context

 arch/riscv/mm/init.c     |  3 +++
 arch/riscv/mm/pageattr.c | 28 ++++++++++++++++++++++------
 2 files changed, 25 insertions(+), 6 deletions(-)

Comments

Nam Cao May 15, 2024, 7:39 a.m. UTC | #1
Forgot to Cc the original author.
+Cc: Zong Li <zong.li@sifive.com>

On Wed, May 15, 2024 at 07:50:38AM +0200, Nam Cao wrote:
> The debug_pagealloc feature is not functional on RISCV. With this feature
> enabled (CONFIG_DEBUG_PAGEALLOC=y and debug_pagealloc=on), kernel crashes
> early during boot.
> 
> QEMU command that can reproduce this problem:
>    qemu-system-riscv64 -machine virt \
>    -kernel Image \
>    -append "console=ttyS0 root=/dev/vda debug_pagealloc=on" \
>    -nographic \
>    -drive "file=root.img,format=raw,id=hd0" \
>    -device virtio-blk-device,drive=hd0 \
>    -m 4G \
> 
> This series makes debug_pagealloc functional.
> 
> Nam Cao (2):
>   riscv: force PAGE_SIZE linear mapping if debug_pagealloc is enabled
>   riscv: rewrite __kernel_map_pages() to fix sleeping in invalid context
> 
>  arch/riscv/mm/init.c     |  3 +++
>  arch/riscv/mm/pageattr.c | 28 ++++++++++++++++++++++------
>  2 files changed, 25 insertions(+), 6 deletions(-)
> 
> -- 
> 2.39.2
>
patchwork-bot+linux-riscv@kernel.org May 22, 2024, 11:51 p.m. UTC | #2
Hello:

This series was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Wed, 15 May 2024 07:50:38 +0200 you wrote:
> The debug_pagealloc feature is not functional on RISCV. With this feature
> enabled (CONFIG_DEBUG_PAGEALLOC=y and debug_pagealloc=on), kernel crashes
> early during boot.
> 
> QEMU command that can reproduce this problem:
>    qemu-system-riscv64 -machine virt \
>    -kernel Image \
>    -append "console=ttyS0 root=/dev/vda debug_pagealloc=on" \
>    -nographic \
>    -drive "file=root.img,format=raw,id=hd0" \
>    -device virtio-blk-device,drive=hd0 \
>    -m 4G \
> 
> [...]

Here is the summary with links:
  - [1/2] riscv: force PAGE_SIZE linear mapping if debug_pagealloc is enabled
    https://git.kernel.org/riscv/c/c67ddf59ac44
  - [2/2] riscv: rewrite __kernel_map_pages() to fix sleeping in invalid context
    https://git.kernel.org/riscv/c/fb1cf0878328

You are awesome, thank you!