@@ -1758,6 +1758,7 @@ int offline_page(mfn_t mfn, int broken, uint32_t *status)
return 0;
}
+#ifdef CONFIG_SYSCTL
/*
* Online the memory.
* The caller should make sure end_pfn <= max_page,
@@ -1842,6 +1843,7 @@ int query_page_offline(mfn_t mfn, uint32_t *status)
return 0;
}
+#endif /* CONFIG_SYSCTL */
/*
* This function should only be called with valid pages from the same NUMA
@@ -188,6 +188,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
break;
#endif /* CONFIG_PM_STATS */
+#ifdef CONFIG_SYSCTL
case XEN_SYSCTL_page_offline_op:
{
uint32_t *status, *ptr;
@@ -248,6 +249,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
copyback = 0;
}
break;
+#endif /* CONFIG_SYSCTL */
case XEN_SYSCTL_cpupool_op:
ret = cpupool_do_sysctl(&op->u.cpupool_op);
@@ -138,7 +138,9 @@ struct xsm_ops {
int (*resource_setup_gsi)(int gsi);
int (*resource_setup_misc)(void);
+#ifdef CONFIG_SYSCTL
int (*page_offline)(uint32_t cmd);
+#endif
int (*hypfs_op)(void);
long (*do_xsm_op)(XEN_GUEST_HANDLE_PARAM(void) op);
@@ -597,7 +599,11 @@ static inline int xsm_resource_setup_misc(xsm_default_t def)
static inline int xsm_page_offline(xsm_default_t def, uint32_t cmd)
{
+#ifdef CONFIG_SYSCTL
return alternative_call(xsm_ops.page_offline, cmd);
+#else
+ return -EOPNOTSUPP;
+#endif
}
static inline int xsm_hypfs_op(xsm_default_t def)
@@ -96,7 +96,9 @@ static const struct xsm_ops __initconst_cf_clobber dummy_ops = {
.resource_setup_gsi = xsm_resource_setup_gsi,
.resource_setup_misc = xsm_resource_setup_misc,
+#ifdef CONFIG_SYSCTL
.page_offline = xsm_page_offline,
+#endif
.hypfs_op = xsm_hypfs_op,
.hvm_param = xsm_hvm_param,
.hvm_param_altp2mhvm = xsm_hvm_param_altp2mhvm,
@@ -1206,10 +1206,12 @@ static int cf_check flask_resource_unplug_core(void)
return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__UNPLUG, NULL);
}
+#ifdef CONFIG_SYSCTL
static int flask_resource_use_core(void)
{
return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESOURCE__USE, NULL);
}
+#endif
static int cf_check flask_resource_plug_pci(uint32_t machine_bdf)
{
@@ -1274,6 +1276,7 @@ static int cf_check flask_resource_setup_misc(void)
return avc_current_has_perm(SECINITSID_XEN, SECCLASS_RESOURCE, RESOURCE__SETUP, NULL);
}
+#ifdef CONFIG_SYSCTL
static inline int cf_check flask_page_offline(uint32_t cmd)
{
switch ( cmd )
@@ -1288,6 +1291,7 @@ static inline int cf_check flask_page_offline(uint32_t cmd)
return avc_unknown_permission("page_offline", cmd);
}
}
+#endif
static inline int cf_check flask_hypfs_op(void)
{
@@ -1948,7 +1952,9 @@ static const struct xsm_ops __initconst_cf_clobber flask_ops = {
.resource_setup_gsi = flask_resource_setup_gsi,
.resource_setup_misc = flask_resource_setup_misc,
+#ifdef CONFIG_SYSCTL
.page_offline = flask_page_offline,
+#endif
.hypfs_op = flask_hypfs_op,
.hvm_param = flask_hvm_param,
.hvm_param_altp2mhvm = flask_hvm_param_altp2mhvm,