Re: [PATCH RFC v2 01/54] riscv: do not use P4D entries for the linear mapping
From: Rik van Riel
Date: Thu Dec 03 2026 - 00:02:45 EST
On Thu, 2026-11-26 at 13:14 +0200, Mike Rapoport (Microsoft) wrote:
> The linear map uses P4D sized leaves with Sv57 since commit
> 3335068f8721
> ("riscv: Use PUD/P4D/PGD pages for the linear mapping"), but riscv
> has no
> p4d_leaf() and the generic stub returns false.
>
> As a result, kernel page table walks treat P4D leaves as tables and
> wrongly
> descend to lower levels. This affects the split in set_memory_*(),
> kernel_page_present(), ptdump and the hibernation page table copy.
>
> Stop creating P4D leaves rather than teaching every walker about
> them, as
> commit 629db01c64ff ("riscv: Don't use PGD entries for the linear
> mapping")
> did for PGD leaves.
>
> Fixes: 3335068f8721 ("riscv: Use PUD/P4D/PGD pages for the linear
> mapping")
> Signed-off-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
Acked-by: Rik van Riel <riel@xxxxxxxxxxx>
--
All Rights Reversed.