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

[PATCH v1 22/25] xen/domctl: wrap around XEN_DOMCTL_{get,set}_paging_mempool_size


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Sun, 3 Aug 2025 17:47:35 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=s8bVld26wdPkUEIzQ96R8Mizbjv7EQdlxJtjjv8jsMk=; b=pU2aszVw698ftKiXe1KqLCLvx1fja263HTnzn95Ee+lIThwxLV5LPYVTcgDP+yPdihshFwsTQ0wOi2LDnE9693wgqZP0ZAf44A39oqpOEN4Mg2FyVzF1qvBvXDOL4eDC6qd7h0jgvg5PYoKh7OwA/Bvr0Oe/vOsnyrcy3YMI6hZwuquy3TqzTk0q0cD3YSffHVp75EkQPczAZeV/J1lYuzS0OVR2znNutYWPP+wwHzUlsmRLBwVJAn285VvSz3XhhlhUESaVji/YOzPdI2FF78+zJOtw+3lret3FgsnXWkctfdfMkDnR4qrJecQg7lUmmAkc8DZidfqSlwEx2KeTtA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fNx/HqLu0Ch5wp486BoM5q7aFnCcAYma+ZcB+BXUgq8WSBIaegovLuVHdUDiw4T8Bfuu7eyLXaU1+CIOzxqSzIBXjS+eAtuBhtGBi271nDdjf3HpRDz0WigSofReUIpRcdI4yI3fcDAhiS0abuNUPiQXVXzWHX69pf7VCOd3/TUgUZUoalD+vYrL1QjAPi8oQgcMRprI2ywTgSShxoFAGoLLFKIObP7NXYWmI8I4Scguv0V+1UDO1EGshRNaFgjiqqW9dj6KfPdF/buuEAPZ9AF3crdvgv2/Pnc4bZ88JuyWuwwAkeCxFaYGPM5DzfMt2o0OOfm8S6rIOSOCj/0lZw==
  • Cc: <ray.huang@xxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Sun, 03 Aug 2025 09:51:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Arch-specific arch_{get,set}_paging_mempool_size() is responsible for
XEN_DOMCTL_{get,set}_paging_mempool_size domctl-op, and shall be wrapped.

Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
---
 xen/arch/arm/mmu/p2m.c   | 4 ++++
 xen/arch/x86/mm/paging.c | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/xen/arch/arm/mmu/p2m.c b/xen/arch/arm/mmu/p2m.c
index 4b13867fa2..878ce205e2 100644
--- a/xen/arch/arm/mmu/p2m.c
+++ b/xen/arch/arm/mmu/p2m.c
@@ -58,12 +58,14 @@ static void p2m_free_page(struct domain *d, struct 
page_info *pg)
     }
 }
 
+#ifdef CONFIG_DOMCTL
 /* Return the size of the pool, in bytes. */
 int arch_get_paging_mempool_size(struct domain *d, uint64_t *size)
 {
     *size = (uint64_t)ACCESS_ONCE(d->arch.paging.p2m_total_pages) << 
PAGE_SHIFT;
     return 0;
 }
+#endif /* CONFIG_DOMCTL */
 
 /*
  * Set the pool of pages to the required number of pages.
@@ -122,6 +124,7 @@ int p2m_set_allocation(struct domain *d, unsigned long 
pages, bool *preempted)
     return 0;
 }
 
+#ifdef CONFIG_DOMCTL
 int arch_set_paging_mempool_size(struct domain *d, uint64_t size)
 {
     unsigned long pages = size >> PAGE_SHIFT;
@@ -140,6 +143,7 @@ int arch_set_paging_mempool_size(struct domain *d, uint64_t 
size)
 
     return rc;
 }
+#endif /* CONFIG_DOMCTL */
 
 int p2m_teardown_allocation(struct domain *d)
 {
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 3da99ad371..e6eff60df1 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -955,6 +955,7 @@ int __init paging_set_allocation(struct domain *d, unsigned 
int pages,
 }
 #endif
 
+#ifdef CONFIG_DOMCTL
 int arch_get_paging_mempool_size(struct domain *d, uint64_t *size)
 {
     unsigned long pages;
@@ -997,6 +998,7 @@ int arch_set_paging_mempool_size(struct domain *d, uint64_t 
size)
 
     return preempted ? -ERESTART : rc;
 }
+#endif /* CONFIG_DOMCTL */
 
 /*
  * Local variables:
-- 
2.34.1




 


Rackspace

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