From patchwork Thu Jan 25 22:55:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13531824 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 C9A58C48285 for ; Thu, 25 Jan 2024 22:56:23 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FNqYGYU9eNjT2fdQb9IK+Fdvyply2QDHMLrz9SttF6o=; b=RgVkZspvUo4ohO PTbwXABSIaFBBfNkm0LvTc4NYNTe8I2/p1wCIgeZFHvDUjLsIbyGy9Wziiajd83lJx+NUCzqHeMtB tz63MTYRuBb45ZXPe8L8tXkw94hTahEbp898PDZcXQ95tBQI7rBCkaETXgQ6HtW/WjyVkUFLL5HRr GwLDfxAUQq30UDgoxttWPae5T2h7qyzrJXORtnXTz5biIaRlvHCbQLKkrnaSxQ7n30LpK/JXMTxoi VXIjALyg/+t3jFPDndAI7q1E2f939aubiCSk6UouyM4sPNqkhmEoiM5AP3npxO1J7/qjvwBbj/0E/ wz9ZB/zUARBG+wcqP/gw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT8dp-00000002JQ7-3XnZ; Thu, 25 Jan 2024 22:56:13 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT8dg-00000002JJv-0c0m for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 22:56:06 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 8D19162372; Thu, 25 Jan 2024 22:56:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFB36C433B1; Thu, 25 Jan 2024 22:56:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706223363; bh=aDJyZ8b/ki4c/IiJRPATBv6E4x5P0FcV6nLpehyyims=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=PXgoZJ9e4NvES+qBfNL9F7ox62KqmezHHBnrme/7JcFLXheOVLH13brLvZbguS/lF yeUK7xKNiqx/4127zDkwxteqID8cX8Ct2hdJsTOoHEMtkLBYKEHKpjqc1AZEuVlVI9 XINNnzvlJ2gotWtwI4RObmQu7CJ5uXXnb9XmWHL3aD9Bd4+SG4sy2yPHSdxkkpOxNy NH3/l3GTunTpjo4951ATyglOIASR75p4mk63x2mfeSlm/bObfaEuJC0vq7wyy/nHZZ tyFtLqAfX45lthqKXtHZ83G7hmv4z6YgtRl2gOABi42+W2E8PyZ50DzQR/jiwH5+xB ww+JbkJjfU/wg== From: Nathan Chancellor Date: Thu, 25 Jan 2024 15:55:10 -0700 Subject: [PATCH 04/11] ARM: Remove Thumb2 __builtin_thread_pointer workaround for Clang MIME-Version: 1.0 Message-Id: <20240125-bump-min-llvm-ver-to-13-0-1-v1-4-f5ff9bda41c5@kernel.org> References: <20240125-bump-min-llvm-ver-to-13-0-1-v1-0-f5ff9bda41c5@kernel.org> In-Reply-To: <20240125-bump-min-llvm-ver-to-13-0-1-v1-0-f5ff9bda41c5@kernel.org> To: akpm@linux-foundation.org, masahiroy@kernel.org Cc: nicolas@fjasle.eu, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev, linux-kernel@vger.kernel.org, Nathan Chancellor , linux@armlinux.org.uk, ardb@kernel.org, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.13-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1827; i=nathan@kernel.org; h=from:subject:message-id; bh=aDJyZ8b/ki4c/IiJRPATBv6E4x5P0FcV6nLpehyyims=; b=owGbwMvMwCUmm602sfCA1DTG02pJDKmbnv3dYNwY1sg8t+xyNndscVrHzemLVkrkTCrIsld5O O1bwqlLHaUsDGJcDLJiiizVj1WPGxrOOct449QkmDmsTCBDGLg4BWAi0xwZGZbPWHQzzfWBs1n/ vP8/uB44Cs9cymzwmC1vnbPDRru9u2Yw/Pd9O9U66+B05efnkhkX84n/7WJQO3cxKzyU+fZmXZ7 tLQwA X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240125_145604_588653_FAF1CAB6 X-CRM114-Status: GOOD ( 12.72 ) 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 Now that the minimum supported version of LLVM for building the kernel has been bumped to 13.0.1, the conditional expression added to get_current() by commit c1e42efacb9b ("ARM: 9151/1: Thumb2: avoid __builtin_thread_pointer() on Clang") is always true, as the build will fail during the configuration stage for older LLVM versions. Remove it, effectively reverting the aforementioned change. Signed-off-by: Nathan Chancellor Reviewed-by: Ard Biesheuvel --- Cc: linux@armlinux.org.uk Cc: ardb@kernel.org Cc: linux-arm-kernel@lists.infradead.org --- arch/arm/include/asm/current.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/arm/include/asm/current.h b/arch/arm/include/asm/current.h index 1e1178bf176d..5225cb1c803b 100644 --- a/arch/arm/include/asm/current.h +++ b/arch/arm/include/asm/current.h @@ -18,18 +18,12 @@ static __always_inline __attribute_const__ struct task_struct *get_current(void) { struct task_struct *cur; -#if __has_builtin(__builtin_thread_pointer) && \ - defined(CONFIG_CURRENT_POINTER_IN_TPIDRURO) && \ - !(defined(CONFIG_THUMB2_KERNEL) && \ - defined(CONFIG_CC_IS_CLANG) && CONFIG_CLANG_VERSION < 130001) +#if __has_builtin(__builtin_thread_pointer) && defined(CONFIG_CURRENT_POINTER_IN_TPIDRURO) /* * Use the __builtin helper when available - this results in better * code, especially when using GCC in combination with the per-task * stack protector, as the compiler will recognize that it needs to * load the TLS register only once in every function. - * - * Clang < 13.0.1 gets this wrong for Thumb2 builds: - * https://github.com/ClangBuiltLinux/linux/issues/1485 */ cur = __builtin_thread_pointer(); #elif defined(CONFIG_CURRENT_POINTER_IN_TPIDRURO) || defined(CONFIG_SMP)