[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 05/20] xen/riscv: construct the P2M pages pool for guests
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
- Date: Wed, 6 Aug 2025 14:01:44 +0200
- 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: Wed, 06 Aug 2025 12:01:55 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 8/5/25 12:40 PM, Jan Beulich wrote:
On 31.07.2025 17:58, Oleksii Kurochko wrote:
@@ -30,3 +34,18 @@ int p2m_init(struct domain *d)
return 0;
}
+
+/*
+ * Set the pool of pages to the required number of pages.
+ * Returns 0 for success, non-zero for failure.
+ * Call with d->arch.paging.lock held.
+ */
+int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted)
Noticed only when looking at the subsequent patch: With this being ...
+{
+ int rc;
+
+ if ( (rc = paging_freelist_init(d, pages, preempted)) )
... a caller of this function, the "init" in the name feels wrong.
I thought about paging_freelist_alloc(), but it feels wrong too as it sounds like
freelist is being allocated inside this functions, but what really happens that
pages are allocated and just added/removed to/from freelist.
Maybe something like paging_freelist_resize() or *_adjust() would be better?
~ Oleksii
|