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 02196C433F5 for ; Tue, 14 Dec 2021 15:29:47 +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=Z4lAJO96eTPVF/DwOSkDWxgpSPKFnptwiqFwAGJWCRg=; b=nkb6lU8qWDELpr e5XVyPVUOHBbsvcU3rftCNm6SLXu116PDLuecTzdLKgnDfTSQtzbMz6AF7jEQJZQeUAJI9FloDSFC mfo1wHu/HIHEmUWgCHUTG4NSQV1QmUTJAN4BGSotkRcA/1ht6ullNUB52lh84yEG56J7dRkVTnjq6 n1WDp05hv2twqZKRX0Z0idRtycQZlHZAReFbQB84YHCeemuifnmdtJ8fXOsJLcnDGMkECUZ61i5YL fTx0NcOkbPnuGTtfhkzX42tY70X2OVuhgHutsNPkde0IWaUKi3YgSktI9Mwp8YnKvQ5n6V0FQVQBw CZYqkBb1Ar/nV+iDA+6Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mx9jE-00Efml-76; Tue, 14 Dec 2021 15:28:32 +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 1mx9im-00Efen-7m for linux-arm-kernel@lists.infradead.org; Tue, 14 Dec 2021 15:28:05 +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 F351EB81A28; Tue, 14 Dec 2021 15:28:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DECEC34607; Tue, 14 Dec 2021 15:28:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639495681; bh=cHV3XpVBIrWYiFK4Zvv9IbsB0ZJs61IFam7zFFzfKJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kRK0c17aVAMEhsaC80vo/Mgi6dHvMJlNezqDmtJL21lZcIVRGBOcPGk9S1VyF9lI2 35J6hfd0JmoJfVnEDLDXYvXvjhhu7iLAEX58Sn16IImBzRVvS5ufF8rMwyItcVGG63 PUnNpacxiOOWHhpr3cclGW4ZCIhtMDRbhJgqkOp2nPLXoafZaFWC6fplNUWOhTKrHQ HRN2zmU0EoWhg6Z3C5oVm4zJxKUIfquGxfcCRZIuJKpExLwnNdVBjORfn0IHBfkRoD /C6nvuPOEAl1chv9O2jsUUWZR6UVDdWKqN+d6Dt/prC8uaOYjgKA7L9hMpuYZ2pNb5 AekAolotTNf7w== From: Mark Brown To: Catalin Marinas , Will Deacon Cc: Mark Rutland , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org, Mark Brown Subject: [PATCH v4 3/3] arm64: Use BTI C directly and unconditionally Date: Tue, 14 Dec 2021 15:27:14 +0000 Message-Id: <20211214152714.2380849-4-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211214152714.2380849-1-broonie@kernel.org> References: <20211214152714.2380849-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3009; h=from:subject; bh=cHV3XpVBIrWYiFK4Zvv9IbsB0ZJs61IFam7zFFzfKJ0=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBhuLfQC0zWUQxEC9pl/6aV3Tisy2BRpIjVpM7v9XHd ByWf2FaJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYbi30AAKCRAk1otyXVSH0NMVB/ 4lWNSvbRdIksYKND/vn2eSgch9A01naMj+PDru10qRNBJZ5JK2BlwXJSujvlmP+4hEud9XJJKkNsP5 f3iFyT+w0pHqFqoNNEdNdX3PWIaIMSXDOW/lWaor2ymOGBVZZPWm1GCOSB9iUo0LMqA+zE9FCeyZRM YpUt6LdUZrf+hJ9dRUxW54cHllsizMMZyT4Nq9JUQ/X3zInVYlffZJzbzCcVP8nYgOkzsmVRHcdzOC WS1oaB8fAfxXaUtzIB05rMpiOunLzr4M6hrmRX5nJhMFtVDlxhFJtOWaoWic6NlxXM3rTniO9DSKnX KQ2G27WHDoMqaHP1JPyCRPlVR8fZwV 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-20211214_072804_580337_6A9B088A X-CRM114-Status: GOOD ( 15.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 Now we have a macro for BTI C that looks like a regular instruction change all the users of the current BTI_C macro to just emit a BTI C directly and remove the macro. This does mean that we now unconditionally BTI annotate all assembly functions, meaning that they are worse in this respect than code generated by the compiler. The overhead should be minimal for implementations with a reasonable HINT implementation. Signed-off-by: Mark Brown --- arch/arm64/include/asm/linkage.h | 22 ++++++---------------- arch/arm64/kernel/entry-ftrace.S | 8 ++------ arch/arm64/lib/kasan_sw_tags.S | 4 +--- 3 files changed, 9 insertions(+), 25 deletions(-) diff --git a/arch/arm64/include/asm/linkage.h b/arch/arm64/include/asm/linkage.h index 1cfa8bb33edd..9065e4749b42 100644 --- a/arch/arm64/include/asm/linkage.h +++ b/arch/arm64/include/asm/linkage.h @@ -4,16 +4,6 @@ #define __ALIGN .align 2 #define __ALIGN_STR ".align 2" -#if defined(CONFIG_ARM64_BTI_KERNEL) && defined(__aarch64__) - -#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 @@ -23,27 +13,27 @@ */ #define SYM_FUNC_START(name) \ SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN) \ - BTI_C + bti c ; #define SYM_FUNC_START_NOALIGN(name) \ SYM_START(name, SYM_L_GLOBAL, SYM_A_NONE) \ - BTI_C + bti c ; #define SYM_FUNC_START_LOCAL(name) \ SYM_START(name, SYM_L_LOCAL, SYM_A_ALIGN) \ - BTI_C + bti c ; #define SYM_FUNC_START_LOCAL_NOALIGN(name) \ SYM_START(name, SYM_L_LOCAL, SYM_A_NONE) \ - BTI_C + bti c ; #define SYM_FUNC_START_WEAK(name) \ SYM_START(name, SYM_L_WEAK, SYM_A_ALIGN) \ - BTI_C + bti c ; #define SYM_FUNC_START_WEAK_NOALIGN(name) \ SYM_START(name, SYM_L_WEAK, SYM_A_NONE) \ - BTI_C + bti c ; /* * Annotate a function as position independent, i.e., safe to be called before diff --git a/arch/arm64/kernel/entry-ftrace.S b/arch/arm64/kernel/entry-ftrace.S index 8cf970d219f5..e535480a4069 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 + bti c ftrace_regs_entry 1 b ftrace_common SYM_CODE_END(ftrace_regs_caller) SYM_CODE_START(ftrace_caller) -#ifdef BTI_C - BTI_C -#endif + bti c 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..20784ce75def 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 + bti c 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