From 7a7b2be4132d3b96833690ccdb637e339aea6d2e Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Thu, 4 Nov 2021 19:36:23 +0000 Subject: [PATCH] xsm: Use __initconst_cf_clobber for xsm_ops All calls through xsm_ops are fully altcall'd. Harden all function pointer targets. This yields: (XEN) altcall: Optimised away 197 endbr64 instructions of 1655 on an everything-enabled build of Xen, which is ~12%. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich Reviewed-by: Daniel P. Smith --- xen/xsm/dummy.c | 2 +- xen/xsm/flask/hooks.c | 2 +- xen/xsm/silo.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index 4d29a9aa5b..8c044ef615 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -13,7 +13,7 @@ #define XSM_NO_WRAPPERS #include -static const struct xsm_ops __initconstrel dummy_ops = { +static const struct xsm_ops __initconst_cf_clobber dummy_ops = { .security_domaininfo = xsm_security_domaininfo, .domain_create = xsm_domain_create, .getdomaininfo = xsm_getdomaininfo, diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index 63484e323c..0bf63ffa84 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -1765,7 +1765,7 @@ static int cf_check flask_argo_send( #endif -static const struct xsm_ops __initconstrel flask_ops = { +static const struct xsm_ops __initconst_cf_clobber flask_ops = { .security_domaininfo = flask_security_domaininfo, .domain_create = flask_domain_create, .getdomaininfo = flask_getdomaininfo, diff --git a/xen/xsm/silo.c b/xen/xsm/silo.c index 4d5fc98e7e..b89b364287 100644 --- a/xen/xsm/silo.c +++ b/xen/xsm/silo.c @@ -102,7 +102,7 @@ static int cf_check silo_argo_send( #endif -static const struct xsm_ops __initconstrel silo_xsm_ops = { +static const struct xsm_ops __initconst_cf_clobber silo_xsm_ops = { .evtchn_unbound = silo_evtchn_unbound, .evtchn_interdomain = silo_evtchn_interdomain, .grant_mapref = silo_grant_mapref, -- 2.30.2