From patchwork Mon Feb 14 12:56:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 12745537 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E2DD0C433EF for ; Mon, 14 Feb 2022 12:57:11 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.271585.466131 (Exim 4.92) (envelope-from ) id 1nJauc-0003IP-U1; Mon, 14 Feb 2022 12:57:02 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 271585.466131; Mon, 14 Feb 2022 12:57:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nJauc-0003Fg-JS; Mon, 14 Feb 2022 12:57:02 +0000 Received: by outflank-mailman (input) for mailman id 271585; Mon, 14 Feb 2022 12:57:01 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nJaua-0001Wb-Tu for xen-devel@lists.xenproject.org; Mon, 14 Feb 2022 12:57:01 +0000 Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 95738935-8d95-11ec-b215-9bbe72dcb22c; Mon, 14 Feb 2022 13:56:55 +0100 (CET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 95738935-8d95-11ec-b215-9bbe72dcb22c DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1644843416; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=bS6U6dpS0uCHmyTfyvV11KW0uKIoo2qJ/wueBOXPivk=; b=A6REouaRBDkRyFwQwIO95HTAALUcEYrhICbPBWWG0Jlfg09Swj3zmvoC 1VABM/sahF7VlpufIgpj/XrCneTchZoZJX4E40TNf2v7UykdVAtBZcq8o KQHi0Rqy373+oz0131T+8hiB5qby075h++3Dkfy/ml07lVlmzdCEWzR61 w=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: DcILunBeCx6JLSKYMAN5Ejn1W6HEpA9UXxQC/kfaq2+bBy5/w2+cDsBLAX4KkGwAkMX0o9PKAR Bzf0W+y7J2bdy8v4TnIcTtrANOJceFf0MiXi8rxTIF/CO5wwSp7XlplHnpvd2P2oGBWbixXBwY paRC12Nqk103A5rHrfBv+ZxZ3CBzCVp2P8waxCfBA87xT6WYWrkREZcFOVigvSiz1ECi+1BFJt vgCd6GO4HmSfFFoI4q70yDuOG55chiPxTDq7Sj4lQSpxVsuFbf+0IltD6EaQpfazFFYhxMnpGV nhJTXpPc+fLmHwSpaAsw1U6h X-SBRS: 5.1 X-MesageID: 64148583 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:XWXNLatFYQLeei+KE2WuiZmVb+fnVEhZMUV32f8akzHdYApBsoF/q tZmKWjUaP2CamLxeIx1bdu+9ksCvZbUxtI3TQpory9nFHlH+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZQP0VOZigHtIQMsadUsxKbVIiGHdJZS5LwbZj2NYy2IThWmthh PupyyHhEA79s9JLGjp8B5Kr8HuDa9yr5Vv0FnRnDRx6lAe2e0s9VfrzFono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kHDP8060sKMYWJBSdmjbDj 1SKAQ0VrPXmqpMu9IWbnriNqoqkHrcsHkdeGGWHv7+6OTODozimyI5EFu2JYSrcRCX//6D7P bdZyPT1MfsmmldWstUjT+Y3nPxmv9a/9aVHyglEHWnQawX5A7xtFXCKwM1Tu/Af3bReowa3B hqC99Qy1W9l4y85/Ir9/DYYU9k= IronPort-HdrOrdr: A9a23:8a+lVqnTUB7VIruLicTU/0ogkSXpDfIo3DAbv31ZSRFFG/Fxl6 iV/cjztCWE8Ar5N0tQ+uxoVJPufZqYz+8Q3WBzB8baYOCFghrLEGgK1+KLqFeMdxEWtNQtsp uIG5IObuEYZmIbsS+V2meF+q4bsby6zJw= X-IronPort-AV: E=Sophos;i="5.88,367,1635220800"; d="scan'208";a="64148583" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper Subject: [PATCH v2 4/7] xsm: Use __initconst_cf_clobber for xsm_ops Date: Mon, 14 Feb 2022 12:56:29 +0000 Message-ID: <20220214125632.24563-5-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20220214125632.24563-1-andrew.cooper3@citrix.com> References: <20220214125632.24563-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 All calls through xsm_ops are fully altcall'd. Harden all fnptr 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 4d29a9aa5b9f..8c044ef61500 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 63484e323c09..0bf63ffa84c4 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 4d5fc98e7e54..b89b36428784 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,