Re: [PATCH v9 08/12] riscv: Fix accessing pfn bits in PTEs for non-32bit variants
From: Philipp Tomsich
Date: Wed Apr 13 2022 - 05:10:01 EST
On Wed, 13 Apr 2022 at 05:04, Heiko Stuebner <heiko@xxxxxxxxx> wrote:
>
> On rv32 the PFN part of PTEs is defined to use bits [xlen-1:10]
> while on rv64 it is defined to use bits [53:10], leaving [63:54]
> as reserved.
>
> With upcoming optional extensions like svpbmt these previously
> reserved bits will get used so simply right-shifting the PTE
> to get the PFN won't be enough.
>
> So introduce a _PAGE_PFN_MASK constant to mask the correct bits
> for both rv32 and rv64 before shifting.
>
> Signed-off-by: Heiko Stuebner <heiko@xxxxxxxxx>
Reviewed-by: Philipp Tomsich <philipp.tomsich@xxxxxxxx>