@@ -15,6 +15,7 @@
#include <asm/arm64/sve.h>
#include <public/sysctl.h>
+#ifdef CONFIG_SYSCTL
void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
{
pi->capabilities |= XEN_SYSCTL_PHYSCAP_hvm | XEN_SYSCTL_PHYSCAP_hap;
@@ -22,6 +23,7 @@ void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
pi->arch_capabilities |= MASK_INSR(sve_encode_vl(get_sys_vl_len()),
XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK);
}
+#endif
long arch_do_sysctl(struct xen_sysctl *sysctl,
XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
@@ -328,10 +328,12 @@ long arch_do_sysctl(struct xen_sysctl *sysctl,
BUG_ON("unimplemented");
}
+#ifdef CONFIG_SYSCTL
void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
{
BUG_ON("unimplemented");
}
+#endif
/* p2m.c */
@@ -91,6 +91,7 @@ static long cf_check smt_up_down_helper(void *data)
return ret;
}
+#ifdef CONFIG_SYSCTL
void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
{
memcpy(pi->hw_cap, boot_cpu_data.x86_capability,
@@ -104,6 +105,7 @@ void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
if ( IS_ENABLED(CONFIG_SHADOW_PAGING) )
pi->capabilities |= XEN_SYSCTL_PHYSCAP_shadow;
}
+#endif
long arch_do_sysctl(
struct xen_sysctl *sysctl, XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
@@ -581,6 +581,8 @@ out:
return ret;
}
+#ifdef CONFIG_SYSCTL
+static unsigned long avail_domheap_pages(void);
void get_outstanding_claims(uint64_t *free_pages, uint64_t *outstanding_pages)
{
spin_lock(&heap_lock);
@@ -588,6 +590,7 @@ void get_outstanding_claims(uint64_t *free_pages, uint64_t *outstanding_pages)
*free_pages = avail_domheap_pages();
spin_unlock(&heap_lock);
}
+#endif
static bool __read_mostly first_node_initialised;
#ifndef CONFIG_SEPARATE_XENHEAP
@@ -2796,12 +2799,14 @@ unsigned long avail_domheap_pages_region(
return avail_heap_pages(zone_lo, zone_hi, node);
}
+#ifdef CONFIG_SYSCTL
static unsigned long avail_domheap_pages(void)
{
return avail_heap_pages(MEMZONE_XEN + 1,
NR_ZONES - 1,
-1);
}
+#endif
unsigned long avail_node_heap_pages(unsigned int nodeid)
{
@@ -131,7 +131,12 @@ int populate_pt_range(unsigned long virt, unsigned long nr_mfns);
unsigned long __must_check domain_adjust_tot_pages(struct domain *d,
long pages);
int domain_set_outstanding_pages(struct domain *d, unsigned long pages);
+#ifdef CONFIG_SYSCTL
void get_outstanding_claims(uint64_t *free_pages, uint64_t *outstanding_pages);
+#else
+static inline void get_outstanding_claims(uint64_t *free_pages,
+ uint64_t *outstanding_pages) {}
+#endif /* CONFIG_SYSCTL */
/* Domain suballocator. These functions are *not* interrupt-safe.*/
void init_domheap_pages(paddr_t ps, paddr_t pe);
@@ -1291,7 +1291,11 @@ struct cpupool *cpupool_create_pool(unsigned int pool_id, int sched_id);
extern void cf_check dump_runq(unsigned char key);
+#ifdef CONFIG_SYSCTL
void arch_do_physinfo(struct xen_sysctl_physinfo *pi);
+#else
+static inline void arch_do_physinfo(struct xen_sysctl_physinfo *pi) {};
+#endif /* CONFIG_SYSCTL */
#ifdef CONFIG_BOOT_TIME_CPUPOOLS
void btcpupools_allocate_pools(void);
The following functions are only used to deal with XEN_SYSCTL_physinfo, then they shall be wrapped: - arch_do_physinfo - get_outstanding_claims Signed-off-by: Penny Zheng <Penny.Zheng@amd.com> --- xen/arch/arm/sysctl.c | 2 ++ xen/arch/riscv/stubs.c | 2 ++ xen/arch/x86/sysctl.c | 2 ++ xen/common/page_alloc.c | 5 +++++ xen/include/xen/mm.h | 5 +++++ xen/include/xen/sched.h | 4 ++++ 6 files changed, 20 insertions(+)