[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v7 05/19] xen/riscv: add root page table allocation




On 12/18/25 2:58 PM, Jan Beulich wrote:
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.

Good point. I will take that into account when will deal with TODO.

Thanks.

~ Oleksii


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.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.