From patchwork Fri Jul 9 00:06:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 12366355 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-22.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA18DC07E96 for ; Fri, 9 Jul 2021 00:11:48 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 680FB61464 for ; Fri, 9 Jul 2021 00:11:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 680FB61464 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: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:In-Reply-To:References: List-Owner; bh=y8AEWA/VgOFcNGBjhCQsCxfAbyIs+IYstpAgyTxIvyQ=; b=C4XGeqfWZ+bi9V LjAmCPf2Lpx4siixqN6dLx6bUPjG0YRLXMdDGeZHBB7IP8lu8dZ4zIjYGtWXEuYUTS/j6K0THmw20 1GxvFLgzWXUo+WcP1hkoF5sCO7QFZ8KyVTX7EOcs/7BF/MsjfIh5e7EpV66DRzU6q82NzeMXPR5it lh/KFo1fcpuoCdAifPitzvAJYscDPrC4mW4SqpUcghLyXQPhNCn8ZqgWyML6eAS+SNaJpYBBnApFi EXDpn7Yxs6Lm3R9OivDz1Pg1ZMwUMenGWfuBIW6Bc+Z193yWxFdzC4mMFyJ/qwv6/fMNknziagoPF TQRN/Pmc1NAvXYdmVQ8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m1e59-000RMN-0c; Fri, 09 Jul 2021 00:09:27 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m1e55-000RLy-7W for linux-arm-kernel@lists.infradead.org; Fri, 09 Jul 2021 00:09:24 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id D6EC461464; Fri, 9 Jul 2021 00:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625789362; bh=ZmxKtJP5ExpVCWmzEkIOSTsoTZNxKk6teetJ374jSgY=; h=From:To:Cc:Subject:Date:From; b=e1xMz/ZO3lHnpTQnO6nQJCUTW11mg3PbgO7ZotO48RfHjaTdM/LPLeG1p92nsfZ2l jFqfO+uamAwpJKdeXk45ogWoKB7slYnNyLyTYZnJ6nOmVCNqIepkVXICOqagk0l89P HuiEZ/382goU13Ujy5eCPcrnuBDvh3tpemVdHq8Tptgm6n/F+1ZjQCjWTWy2Jq1V8I 9OwgOrDApCNL01hXi/mUDDvfmb2RNCJGwDEqR3/N/FZUUOVL+h9A5S1PCXEWk2l5oZ t14/hzyNytWa0xuMFDDFdarw5aENtrGrxKUVsubMyWX/A/zhAL3RmxCFrD8pk9I5Ie JdtgRkx40fkaw== From: Nathan Chancellor To: Catalin Marinas , Will Deacon Cc: Nick Desaulniers , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH] arm64: Restrict ARM64_BTI_KERNEL to clang 12.0.0 and newer Date: Thu, 8 Jul 2021 17:06:27 -0700 Message-Id: <20210709000627.3183718-1-nathan@kernel.org> X-Mailer: git-send-email 2.32.0.93.g670b81a890 MIME-Version: 1.0 X-Patchwork-Bot: notify X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210708_170923_325456_6D7F31D3 X-CRM114-Status: GOOD ( 10.33 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Commit 97fed779f2a6 ("arm64: bti: Provide Kconfig for kernel mode BTI") disabled CONFIG_ARM64_BTI_KERNEL when CONFIG_GCOV_KERNEL was enabled and compilign with clang because of warnings that occur because LLVM was not emitting PAC/BTI instructions for compiler generated functions. This was an adequate fix to avoid the warnings with allmodconfig until commit 51c2ee6d121c ("Kconfig: Introduce ARCH_WANTS_NO_INSTR and CC_HAS_NO_PROFILE_FN_ATTR"), which prevented CONFIG_GCOV_KERNEL from being selected with clang 12.0.0 and older because it does not support the no_profile_instrument_function attribute. As a result, CONFIG_ARM64_BTI_KERNEL gets enabled and there are more warnings of this nature. Rather than play whack-a-mole with the config options, just update this condition to require clang 12.0.0, which should have all of the issues ironed out. Link: https://github.com/ClangBuiltLinux/linux/issues/1428 Link: https://github.com/ClangBuiltLinux/continuous-integration2/runs/3010034706?check_suite_focus=true Link: https://github.com/ClangBuiltLinux/continuous-integration2/runs/3010035725?check_suite_focus=true Signed-off-by: Nathan Chancellor --- arch/arm64/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) base-commit: f55966571d5eb2876a11e48e798b4592fa1ffbb7 diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index e07e7de9ac49..c2127595980f 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1605,7 +1605,8 @@ config ARM64_BTI_KERNEL depends on CC_HAS_BRANCH_PROT_PAC_RET_BTI # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94697 depends on !CC_IS_GCC || GCC_VERSION >= 100100 - depends on !(CC_IS_CLANG && GCOV_KERNEL) + # https://reviews.llvm.org/D85649 + depends on !CC_IS_CLANG || CLANG_VERSION >= 120000 depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_REGS) help Build the kernel with Branch Target Identification annotations