[PATCH v9 08/12] riscv: Fix accessing pfn bits in PTEs for non-32bit variants

Philipp Tomsich philipp.tomsich at vrull.eu
Wed Apr 13 02:09:31 PDT 2022


On Wed, 13 Apr 2022 at 05:04, Heiko Stuebner <heiko at sntech.de> 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 at sntech.de>

Reviewed-by: Philipp Tomsich <philipp.tomsich at vrull.eu>



More information about the linux-riscv mailing list