mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
XSM: make .grant_*() hooks dependent upon GRANT_TABLE=y
They're unreachable / dead otherwise. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
This commit is contained in:
1 parent
813a62811f
commit
d1d1287764
4 files changed
+16
No files matched your search
@@ -191,6 +191,8 @@ static XSM_INLINE void cf_check xsm_free_security_domain(struct domain *d)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_GRANT_TABLE
|
||||
|
||||
static XSM_INLINE int cf_check xsm_grant_mapref(
|
||||
XSM_DEFAULT_ARG struct domain *d1, struct domain *d2, uint32_t flags)
|
||||
{
|
||||
@@ -233,6 +235,8 @@ static XSM_INLINE int cf_check xsm_grant_query_size(
|
||||
return xsm_default_action(action, d1, d2);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_GRANT_TABLE */
|
||||
|
||||
static XSM_INLINE int cf_check xsm_memory_exchange(
|
||||
XSM_DEFAULT_ARG struct domain *d)
|
||||
{
|
||||
|
||||
@@ -35,12 +35,14 @@ XSM_HOOK(int, evtchn_send, struct domain *, struct evtchn *)
|
||||
XSM_HOOK(int, evtchn_status, struct domain *, struct evtchn *)
|
||||
XSM_HOOK(int, evtchn_reset, struct domain *, struct domain *)
|
||||
|
||||
#ifdef CONFIG_GRANT_TABLE
|
||||
XSM_HOOK(int, grant_mapref, struct domain *, struct domain *, uint32_t)
|
||||
XSM_HOOK(int, grant_unmapref, struct domain *, struct domain *)
|
||||
XSM_HOOK(int, grant_setup, struct domain *, struct domain *)
|
||||
XSM_HOOK(int, grant_transfer, struct domain *, struct domain *)
|
||||
XSM_HOOK(int, grant_copy, struct domain *, struct domain *)
|
||||
XSM_HOOK(int, grant_query_size, struct domain *, struct domain *)
|
||||
#endif
|
||||
|
||||
XSM_HOOK(int, init_hardware_domain, struct domain *)
|
||||
|
||||
|
||||
@@ -434,6 +434,8 @@ static int cf_check flask_init_hardware_domain(struct domain *d)
|
||||
return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__CREATE_HARDWARE_DOMAIN);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_GRANT_TABLE
|
||||
|
||||
static int cf_check flask_grant_mapref(
|
||||
struct domain *d1, struct domain *d2, uint32_t flags)
|
||||
{
|
||||
@@ -470,6 +472,8 @@ static int cf_check flask_grant_query_size(struct domain *d1, struct domain *d2)
|
||||
return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__QUERY);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_GRANT_TABLE */
|
||||
|
||||
static int cf_check flask_get_pod_target(struct domain *d)
|
||||
{
|
||||
return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETPODTARGET);
|
||||
|
||||
@@ -60,6 +60,8 @@ static int cf_check silo_evtchn_interdomain(
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_GRANT_TABLE
|
||||
|
||||
static int cf_check silo_grant_mapref(
|
||||
struct domain *d1, struct domain *d2, uint32_t flags)
|
||||
{
|
||||
@@ -82,6 +84,8 @@ static int cf_check silo_grant_copy(struct domain *d1, struct domain *d2)
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_GRANT_TABLE */
|
||||
|
||||
#ifdef CONFIG_ARGO
|
||||
|
||||
static int cf_check silo_argo_register_single_source(
|
||||
@@ -105,9 +109,11 @@ static int cf_check silo_argo_send(
|
||||
static const struct xsm_ops __initconst_cf_clobber silo_xsm_ops = {
|
||||
.evtchn_unbound = silo_evtchn_unbound,
|
||||
.evtchn_interdomain = silo_evtchn_interdomain,
|
||||
#ifdef CONFIG_GRANT_TABLE
|
||||
.grant_mapref = silo_grant_mapref,
|
||||
.grant_transfer = silo_grant_transfer,
|
||||
.grant_copy = silo_grant_copy,
|
||||
#endif
|
||||
#ifdef CONFIG_ARGO
|
||||
.argo_register_single_source = silo_argo_register_single_source,
|
||||
.argo_send = silo_argo_send,
|
||||
|
||||