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.zh...@amd.com>
---
 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


Reply via email to