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 26594C433FE for ; Tue, 7 Dec 2021 18:04:49 +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=dwlxCdmbkWTeRA hAC/8MaHdpBfiqPUQ2G8r1zLXoFmPSHXExFENtETo4bQpyIALiYa1RR2E8AXcbGEzMw3h3uKTgAW3 DiLEg4zzr2auZo+bbgrx1bfiXVmbjGBQhxnzwEn0cAN53jp3+K11o5eJWk3l3/3+o+RwZJIWhAvm9 Y+ngbPUuIniUoJSswclHo0NW6KyKgvT3HektqkbWPCA8cftunNQobxB23B+6nft4oJ2zPnkW9toAv 339g0MdyouTsVVzgkGPFD+e/p715LXbUyXsgZnKdloHAiezAZrv2+2YXk/RpSP5VE9kCvU6nCLjAu Bg36k/Rd/R9HqPyNpXDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mueo4-009cyd-0Y; Tue, 07 Dec 2021 18:03:12 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mueni-009csV-7n for linux-arm-kernel@lists.infradead.org; Tue, 07 Dec 2021 18:02:51 +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 sin.source.kernel.org (Postfix) with ESMTPS id 69AC1CE1D55; Tue, 7 Dec 2021 18:02:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FA75C341CA; Tue, 7 Dec 2021 18:02:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638900165; bh=Vw5uKOTu5jLe7tyIVvz4EYkQ+gGbHxRdEwFQbpNBRZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YAK3k557RrUCF3+xUeElVQgZozr1CCVxWq0BXWUY14SUORC4rv5n3riGgxDXTEZv4 +SMTBNOYYbYQ1a3Mmk9WyeTwFkhagxjmY90WvJh9tWvcH5/8gimujGIataNIlmRLfX Z+5bCvs+4srq1T4nEYVd18YxcDfLtk4YCxNf8NE5cjekO4L6gTZ0KA7RBJR4/vsih8 +D6g5oZmZK1AlKW3xm2YPRpBQ2vUSyh7GfV0XSKqeIsLDnq9dsET/P8yTrrrZxb0aZ 1RSJKaKylNqNEWrjS/GCtZUdHYbfQl/6Zq05EQmg+iztwn8Gr581cPsvcoTfdcU0Ry xO5lrcAhqG44g== From: Mark Brown To: Catalin Marinas , Will Deacon Cc: Mark Rutland , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org, Mark Brown Subject: [PATCH v2 2/2] arm64: Unconditionally override SYM_FUNC macros Date: Tue, 7 Dec 2021 18:01:16 +0000 Message-Id: <20211207180116.1581807-3-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211207180116.1581807-1-broonie@kernel.org> References: <20211207180116.1581807-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/pANAwAKASTWi3JdVIfQAcsmYgBhr6FrcrK6qgIbHCaa2iL3wL3ygLBTI7WFzHhrpRJZ qqoO3vWJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYa+hawAKCRAk1otyXVSH0Mm6B/ 9JEHTOUg/nP9be1u6f/y6VBZDfyYiMzZ0agNcmfOLcmvcmyyrYOnUkcKliCBzOn+m3+aKZ14etDSXo jaXnr7yCLP9yf6qKihSIm34j91M13q4tY4d4BEpKE2Aixz+ANM0+hrN0fzsDQtp6xPy7C/T76U7zS7 fvdyH0a+QT4JbR+9RcgieheyIaASGZoGZwAjWfao0l/FR88D4CJkhk1G6J/U8G2o0Rlpv3EvFJaHNQ umMDN9yOFxPCcyLnBI7vhozUQsVQC4wl3Ma1BLULGEJcYkSTGnCHrw69qSqXomxaiB9rCFrg/c1ZvY 0UyqluM8xmYh6+bm8EPDaVVf/O21Ao 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-20211207_100250_656087_D04C00FE X-CRM114-Status: GOOD ( 17.42 ) 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