[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 05/19] xen/riscv: add root page table allocation
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
- Date: Thu, 18 Dec 2025 17:23:54 +0100
- Cc: Alistair Francis <alistair.francis@xxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Thu, 18 Dec 2025 16:24:09 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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.
|