xen/xsm: wrap around xsm_sysctl with CONFIG_SYSCTL

As function xsm_sysctl() is solely invoked in sysctl.c, we need to
wrap around it with CONFIG_SYSCTL

Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
This commit is contained in:
Penny Zheng authored and Stefano Stabellini committed 2025-07-16 17:36:35 -07:00
1 parent dff462313f
commit c9eabaa03a
3 files changed
+10

No files matched your search

+4
View File
@@ -261,7 +261,11 @@ static inline int xsm_domctl(xsm_default_t def, struct domain *d,
static inline int xsm_sysctl(xsm_default_t def, int cmd)
{
#ifdef CONFIG_SYSCTL
return alternative_call(xsm_ops.sysctl, cmd);
#else
return -EOPNOTSUPP;
#endif
}
static inline int xsm_readconsole(xsm_default_t def, uint32_t clear)
+2
View File
@@ -22,7 +22,9 @@ static const struct xsm_ops __initconst_cf_clobber dummy_ops = {
.sysctl_scheduler_op = xsm_sysctl_scheduler_op,
.set_target = xsm_set_target,
.domctl = xsm_domctl,
#ifdef CONFIG_SYSCTL
.sysctl = xsm_sysctl,
#endif
.readconsole = xsm_readconsole,
.evtchn_unbound = xsm_evtchn_unbound,
+4
View File
@@ -856,6 +856,7 @@ static int cf_check flask_domctl(struct domain *d, unsigned int cmd,
}
}
#ifdef CONFIG_SYSCTL
static int cf_check flask_sysctl(int cmd)
{
switch ( cmd )
@@ -933,6 +934,7 @@ static int cf_check flask_sysctl(int cmd)
return avc_unknown_permission("sysctl", cmd);
}
}
#endif /* CONFIG_SYSCTL */
static int cf_check flask_readconsole(uint32_t clear)
{
@@ -1884,7 +1886,9 @@ static const struct xsm_ops __initconst_cf_clobber flask_ops = {
.sysctl_scheduler_op = flask_sysctl_scheduler_op,
.set_target = flask_set_target,
.domctl = flask_domctl,
#ifdef CONFIG_SYSCTL
.sysctl = flask_sysctl,
#endif
.readconsole = flask_readconsole,
.evtchn_unbound = flask_evtchn_unbound,
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.