|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] xen/xsm: wrap around xsm_sysctl with CONFIG_SYSCTL
commit c9eabaa03a685cd922b916dc4acdb4874ed806ce
Author: Penny Zheng <Penny.Zheng@xxxxxxx>
AuthorDate: Fri Jul 11 12:31:52 2025 +0800
Commit: Stefano Stabellini <stefano.stabellini@xxxxxxx>
CommitDate: Wed Jul 16 17:36:35 2025 -0700
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@xxxxxxx>
Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Acked-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
---
xen/include/xsm/xsm.h | 4 ++++
xen/xsm/dummy.c | 2 ++
xen/xsm/flask/hooks.c | 4 ++++
3 files changed, 10 insertions(+)
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 24acc16125..22e2429f52 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -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)
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 93fbfc43cc..93a0665ecc 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -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,
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 6a53487ea4..3a43e5a1d6 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -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,
--
generated by git-patchbot for /home/xen/git/xen.git#master
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |