On 16.12.2025 17:55, Oleksii Kurochko wrote:
> @@ -30,6 +34,11 @@ struct p2m_domain {
> /* Pages used to construct the p2m */
> struct page_list_head pages;
>
> + /* The root of the p2m tree. May be concatenated */
> + struct page_info *root;
> +
> + struct gstage_mode_desc mode;
Why would this need a copy (instance) of the struct? Can't this be a
(const) pointer into the static array that currently is local to
gstage_mode_detect()? Similarly there max_gstage_mode could be a pointer
rather than a separate instance of the struct.
Yes, there is a connection to ...
> @@ -124,6 +193,24 @@ int p2m_init(struct domain *d)
> rwlock_init(&p2m->lock);
> INIT_PAGE_LIST_HEAD(&p2m->pages);
>
> + /*
> + * Currently, the infrastructure required to enable
> CONFIG_HAS_PASSTHROUGH
> + * is not ready for RISC-V support.
> + *
> + * When CONFIG_HAS_PASSTHROUGH=y, p2m->clean_dcache must be properly
> + * initialized.
> + * At the moment, it defaults to false because the p2m structure is
> + * zero-initialized.
> + */
> +#ifdef CONFIG_HAS_PASSTHROUGH
> +# error "Add init of p2m->clean_dcache"
> +#endif
> +
> + /* TODO: don't hardcode used for a domain g-stage mode. */
> + p2m->mode.mode = HGATP_MODE_SV39X4;
> + p2m->mode.paging_levels = 2;
> + safe_strcpy(p2m->mode.name, "Sv39x4");
... this TODO, but surely this code could similarly be made reference the
(then) global array.
Jan