On 20.10.2025 17:57, Oleksii Kurochko wrote:
> Implement the p2m_next_level() function, which enables traversal and dynamic
> allocation of intermediate levels (if necessary) in the RISC-V
> p2m (physical-to-machine) page table hierarchy.
> 
> To support this, the following helpers are introduced:
> - page_to_p2m_table(): Constructs non-leaf PTEs pointing to next-level page
>   tables with correct attributes.
> - p2m_alloc_page(): Allocates page table pages, supporting both hardware and
>   guest domains.
> - p2m_create_table(): Allocates and initializes a new page table page and
>   installs it into the hierarchy.
> 
> Signed-off-by: Oleksii Kurochko <[email protected]>

Acked-by: Jan Beulich <[email protected]>
Just one further nit:

> @@ -490,6 +503,33 @@ static pte_t p2m_pte_from_mfn(mfn_t mfn, p2m_type_t t, 
> bool is_table)
>      return e;
>  }
>  
> +/* Generate table entry with correct attributes. */
> +static pte_t page_to_p2m_table(const struct page_info *page)
> +{
> +    /*
> +     * p2m_invalid will be ignored inside p2m_pte_from_mfn() as is_table is
> +     * set to true and p2m_type_t shouldn't be applied for PTEs which
> +     * describe an intermidiate table.

intermediate

Jan

Reply via email to