Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp139949pxv; Thu, 8 Jul 2021 17:13:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgsEPa90d0xO+mFN29SHtYMeELt3AyNpXjqYtDNoC0tgCH01X4dxqImtKT9ksXkpfn3u1H X-Received: by 2002:a17:906:4fcb:: with SMTP id i11mr32433522ejw.300.1625789598916; Thu, 08 Jul 2021 17:13:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625789598; cv=none; d=google.com; s=arc-20160816; b=FpLbxLH3hi+x+1oP2tGZWWvUNbRhyVGEp0+k+6FPN+wS+XRuZ5zlWaaZvlWN1BPK+9 ezHwq0SWEi7OOj4KYOyBoHVQ4f+nA6RB9B3oM93i46GmbXCJ4g6kBs29KpeoJupHN0yL 5wgL+IxS5GbdkVHF/G2Q/cnd77B0aAnz/PItSk7lwk8PRUFfo5hQcizWMLmjGr4eK3yD uPTInquSjVAo48dhXdT7Vhoyu9+booDor45FKOUOusyfrR8OEJ4CZLwtHmcEoQ2iTmm4 L+a58VgI++aFEK6K5Yex0KqhiIQTyUyegeBRE9DmkYsBTGnbHZtICgTUdfJoQruJcWVB XGLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=NBrKwVo+96SqJGrve/eeTb19PVRdbKmWSmyW4djSLsY=; b=07IH9aRKXm7dSDpXQ4C0fOQ+U6SC8YQP3oYffZtbTdArjGtYoH9ZX9R/qQZdGCR4mo d4vgopaeqEtnsAmU0l5JECzRK14FOEnsPhdACrHK2LxRdf657cDv4XgDRnVkMqiKS+Mm 9nfLMNt66ANQ4gOZiW3VGNobphtq9tv2nukhug9fhupPYQeLiYJMRFIPIlOg0+lp+9KC a/E3e1y/PJriZEAXfO+5Ye83jAw2ErASJhlHiQYuIS5pLZ/opDiCMAEy06DiP5y6TWQj mffmz8ITSOaVuGeuMDTVbyhVm7vqEgi+x5Z4b/kCXSmR2LET/TaoB8q9ddlEunrc9iDC kiXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="e1xMz/ZO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s22si4849542edr.67.2021.07.08.17.12.56; Thu, 08 Jul 2021 17:13:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="e1xMz/ZO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229637AbhGIAMG (ORCPT + 99 others); Thu, 8 Jul 2021 20:12:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:58284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbhGIAME (ORCPT ); Thu, 8 Jul 2021 20:12:04 -0400 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) 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 base-commit: f55966571d5eb2876a11e48e798b4592fa1ffbb7 -- 2.32.0.93.g670b81a890