On 24.11.2025 13:33, Oleksii Kurochko wrote: > Introduce support for allocating and initializing the root page table > required for RISC-V stage-2 address translation. > > To implement root page table allocation the following is introduced: > - p2m_get_clean_page() and p2m_alloc_root_table(), p2m_allocate_root() > helpers to allocate and zero a 16 KiB root page table, as mandated > by the RISC-V privileged specification for Sv32x4/Sv39x4/Sv48x4/Sv57x4 > modes. > - Update p2m_init() to inititialize p2m_root_order. > - Add maddr_to_page() and page_to_maddr() macros for easier address > manipulation. > - Introduce paging_ret_to_domheap() to return some pages before > allocate 16 KiB pages for root page table. > - Allocate root p2m table after p2m pool is initialized. > - Add construct_hgatp() to construct the hgatp register value based on > p2m->root, p2m->hgatp_mode and VMID. > > Signed-off-by: Oleksii Kurochko <[email protected]>
Acked-by: Jan Beulich <[email protected]>
