On 31.07.2025 17:58, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/p2m.c
> +++ b/xen/arch/riscv/p2m.c
> @@ -302,6 +302,48 @@ 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(struct page_info *page)

You don't mean to alter what page points to, so pointer-to-const please.

> @@ -326,9 +368,43 @@ static int p2m_next_level(struct p2m_domain *p2m, bool 
> alloc_tbl,
>                            unsigned int level, pte_t **table,
>                            unsigned int offset)
>  {
> -    panic("%s: hasn't been implemented yet\n", __func__);
> +    pte_t *entry;
> +    int ret;

Please can this move into the more narrow scope it's (solely) used in?

> +    mfn_t mfn;
> +
> +    /* The function p2m_next_level() is never called at the last level */
> +    ASSERT(level != 0);

The revlog says "move", but ...

> +    entry = *table + offset;
> +
> +    if ( !pte_is_valid(*entry) )
> +    {
> +        if ( !alloc_tbl )
> +            return P2M_TABLE_MAP_NONE;
> +
> +        ret = p2m_create_table(p2m, entry);
> +        if ( ret )
> +            return P2M_TABLE_MAP_NOMEM;
> +    }
> +
> +    /* The function p2m_next_level() is never called at the last level */
> +    ASSERT(level != 0);

... the original one's still here.

> --- a/xen/arch/riscv/paging.c
> +++ b/xen/arch/riscv/paging.c
> @@ -91,6 +91,17 @@ void paging_free_page(struct domain *d, struct page_info 
> *pg)
>      spin_unlock(&d->arch.paging.lock);
>  }
>  
> +struct page_info * paging_alloc_page(struct domain *d)

Nit: Stray blank after *.

Jan

Reply via email to