From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D9439C433EF for ; Wed, 8 Dec 2021 16:15:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=29AI9WcPlIMCfPE1b6JYS/ePfpfzs9dhJ8ZzG8HEFtg=; b=k2VKLtSPY8ZgQH yyT6uu8YLU6xwVFyW4CzJJ2VR1xx/66UZcd//rwoHPjzt5kQSSuzsMZolVTsyWPxNY370pdpSSs5j qgu/42KAnZBTodvBTC5v7KFwf0anCMiPsnWv5+V8fUISUuNiI5GMS8hOQnGe+qmQw8YBJM6p10W7l jqH/cKXg6Y/zKso1yMkva+Bynrn65R9qi87pflvcQr03Xnm8q5THpaEe3zSPjugI8ZM1ZgtOxKesR mDBpXGt1TuVyCZmF0mh0v2pt7x4z3TWSUYhJnULHuEeJdWjiHprpyfeCN17flxSKrjY5wu3ET1SnK z7LZUunK1/Pdhr3KytHg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muzaH-00DVWR-6U; Wed, 08 Dec 2021 16:14:21 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muzZu-00DVTQ-Kk for linux-arm-kernel@lists.infradead.org; Wed, 08 Dec 2021 16:14:00 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 65D6AB82184; Wed, 8 Dec 2021 16:13:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE36FC341C7; Wed, 8 Dec 2021 16:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638980037; bh=Vw5uKOTu5jLe7tyIVvz4EYkQ+gGbHxRdEwFQbpNBRZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J9hJiGj5KhTecU64YVn9sFVgjrWscAMDb/MgO6DQlCZW6ZdzvPSdDyw5I5NqmNepb xckx15lGl3JIpRJGgq2ptfMk0i7kVmTnleZaWMMUr4CZ9/ChqUgwT802sSp80JOrj9 Lq8e5R7+U/GIb2Grp+E3CJafVSdbarXzfDJkKvEmoUJbV/00G+BtsODnOrnnPIGQPi TQhRP5WoXqpqxdNPAhIOm/zAOz7jHouPDaML2Jbmz57GoG7D2AgXohQRyvpWTZ4hVA 1zeW8572Ms7n89LA81wTfGyrmDPokCioybIyS1qihhzvZ4fW7hL2KUPPp/OiUlD3tY k4V3TDQnr/D/Q== From: Mark Brown To: Catalin Marinas , Will Deacon Cc: Mark Rutland , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org, Mark Brown Subject: [PATCH v3 2/2] arm64: Unconditionally override SYM_FUNC macros Date: Wed, 8 Dec 2021 16:08:19 +0000 Message-Id: <20211208160819.3515958-3-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211208160819.3515958-1-broonie@kernel.org> References: <20211208160819.3515958-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2821; h=from:subject; bh=Vw5uKOTu5jLe7tyIVvz4EYkQ+gGbHxRdEwFQbpNBRZY=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBhsNhvcrK6qgIbHCaa2iL3wL3ygLBTI7WFzHhrpRJZ qqoO3vWJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYbDYbwAKCRAk1otyXVSH0KfQB/ 9L8zm+5zk0RAgdZKzTCVuFCHMedmyaLovVae9OodoL0g9UMxWNz3WZ5cn4ToBfXobzIZ8IoEXAZuLi R+26Hn3ZP/Jj6sPHgu7Juczcy3SpPE2sOmITFQ84WamF71CHeLNQZEkoYoh8GKHFX82zrgg2BbyRbu n8FHOsFqYIFM8Kk0fymA1sUkpxCkABkB+8Z1sON16E9kxiQx8iRqc0uVMB14fg1+UEuU2X9qFcUzMv qJfL0IfH7spCKdMS8rkepEhvvI4t+mSY61I2e/FA+8T7AbR36oLF1NcBfsfDNU7Q9vvF2vcy8pe4Mx GNpRDXUgkLxA27wkaAN+D66txdmXGx X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211208_081358_984184_10CD50CE X-CRM114-Status: GOOD ( 17.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently we only override the SYM_FUNC macros when we need to insert BTI C into them. Since we now unconditionally provide the BTI_C macro used to do that let's always override them, that way any issues with our overrides it'll show up more consistently. Since this means that we now have an unconditional definition of BTI_C update the other users to remove the ifdefs around usage, making them look a bit neater. Suggested-by: Mark Rutland Signed-off-by: Mark Brown --- arch/arm64/include/asm/linkage.h | 16 +++++++++++----- arch/arm64/kernel/entry-ftrace.S | 4 ---- arch/arm64/lib/kasan_sw_tags.S | 2 -- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/arm64/include/asm/linkage.h b/arch/arm64/include/asm/linkage.h index c5d0c11d7709..1cfa8bb33edd 100644 --- a/arch/arm64/include/asm/linkage.h +++ b/arch/arm64/include/asm/linkage.h @@ -8,10 +8,18 @@ #define BTI_C bti c ; +#else + +#define BTI_C + +#endif + /* - * When using in-kernel BTI we need to ensure that PCS-conformant assembly - * functions have suitable annotations. Override SYM_FUNC_START to insert - * a BTI landing pad at the start of everything. + * When using in-kernel BTI we need to ensure that PCS-conformant + * assembly functions have suitable annotations. Override + * SYM_FUNC_START to insert a BTI landing pad at the start of + * everything, the override is done unconditionally so we're more + * likely to notice any drift from the overridden definitions. */ #define SYM_FUNC_START(name) \ SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN) \ @@ -37,8 +45,6 @@ SYM_START(name, SYM_L_WEAK, SYM_A_NONE) \ BTI_C -#endif - /* * Annotate a function as position independent, i.e., safe to be called before * the kernel virtual mapping is activated. diff --git a/arch/arm64/kernel/entry-ftrace.S b/arch/arm64/kernel/entry-ftrace.S index 8cf970d219f5..46a2de864794 100644 --- a/arch/arm64/kernel/entry-ftrace.S +++ b/arch/arm64/kernel/entry-ftrace.S @@ -77,17 +77,13 @@ .endm SYM_CODE_START(ftrace_regs_caller) -#ifdef BTI_C BTI_C -#endif ftrace_regs_entry 1 b ftrace_common SYM_CODE_END(ftrace_regs_caller) SYM_CODE_START(ftrace_caller) -#ifdef BTI_C BTI_C -#endif ftrace_regs_entry 0 b ftrace_common SYM_CODE_END(ftrace_caller) diff --git a/arch/arm64/lib/kasan_sw_tags.S b/arch/arm64/lib/kasan_sw_tags.S index 5b04464c045e..a6d6fa2f761e 100644 --- a/arch/arm64/lib/kasan_sw_tags.S +++ b/arch/arm64/lib/kasan_sw_tags.S @@ -38,9 +38,7 @@ * incremented by 256 prior to return). */ SYM_CODE_START(__hwasan_tag_mismatch) -#ifdef BTI_C BTI_C -#endif add x29, sp, #232 stp x2, x3, [sp, #8 * 2] stp x4, x5, [sp, #8 * 4] -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel