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: 192321 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:e09d:b0:103:945f:af90 with SMTP id gm29csp312623dyb; Thu, 25 Jan 2024 14:58:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IGBLujZoqLcwadX8Jm2pIaT6Kzdhs+WPhVs6V68261x5NgsPbH8CuZiZiQBLP5WpiLM/jeJ X-Received: by 2002:a17:902:efc9:b0:1d3:f9ac:c9d3 with SMTP id ja9-20020a170902efc900b001d3f9acc9d3mr355098plb.76.1706223514070; Thu, 25 Jan 2024 14:58:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706223514; cv=pass; d=google.com; s=arc-20160816; b=NK+IIPUPqvIC0534HDQPN+K9hEFdLtIIla5+MDDRFhvEL0ThxmS9pzPAZj+BLTOYw9 ZDpaZ8b0dA18Cm7u0IunitpL394/5lw6unrVE8Ti0FSFayrStG/CSPy/XbeQrekg7rqr ukI/BYbsV6PsWgzy/MbjUZym02A7sa2em+p36/FeQRr9t35LD2jCVINwdTBc8GpFFOKg x/nhiVsTPRPggNhkDblAo6+/RCVAGramZuaoIyyoemXmDJCD0+gk8Qom9pKIBXEgYOvH nQ+E1/4u6i1eBPcb6oKNEe4FxRvgiANxDQ6KHGNuhqi9Lh5rzYs04eiv5HAO1Hh/MveG LcdA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=nhqHZlKedTYd521me0goz/UlDNwP5AuiQgzkF3nyGis=; fh=WyATUlJ8AwUUPPGcsmVKZaVck7VeYNPqcoucm0HU17M=; b=XmeK35AE+b7wHnmVjTAxiyA9grwFv2t5ROY57LhzCiCNnwFCarf4IqlFtCdwliG0xh IDcfOXd9fuTrdUOMRjiGk4F4eg/P7ergsdRgJFCbZcPi3JlW+sJgTPSKcES6daolfqQS vRA/FKs6sH8myYOdFraqngkK/prHYTrmTjYT7qIKQR0YCOgbglCu64pQUKf6aw6+aIn4 74XDUAwHfXsG5eWL+v8mjRuHgR4+WxuBdaaIMRFEPXsCz6dwC/pAcinSKD+fgXI3wl/0 h6UusUww0WaBXoLm3o4dYYnpcXeFm5K8pNf3tDDwk6j6O1JvWj+niO8c/RZsW8i73YHs T47w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PXgoZJ9e; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-39383-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39383-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ix6-20020a170902f80600b001d787d9d62esi13191plb.210.2024.01.25.14.58.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 14:58:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39383-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PXgoZJ9e; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-39383-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39383-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1E1DD29474F for ; Thu, 25 Jan 2024 22:57:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 90DAF1B27D; Thu, 25 Jan 2024 22:56:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PXgoZJ9e" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DCD861758B; Thu, 25 Jan 2024 22:56:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706223364; cv=none; b=rcbfAuvD+GU4UPbETj660X31gpWv/Ig/0/Ajfekcw8WjIBKizgYngYmCcUifiI6y+PColSinXWlihiDNh4ppB6mKoDgFjbFvWHpiInfKlkaWEHf31ZNJxe3HrhQM3r8XR45u6NyjTp2hcJmTmlpGwfkhNZAS6W3tiOysBXlevqc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706223364; c=relaxed/simple; bh=aDJyZ8b/ki4c/IiJRPATBv6E4x5P0FcV6nLpehyyims=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=n0dZ3QyjNFgJTHmXMGxzi/U7UnTInulxtYHMn+FyMI1f4Q5Or/77AvszaZpA+AvfRHKrNEFFQ/DHRLJkg8jvgAG1oD3kGaGeFDNOrt7EK6tjJucgbKiA+AVzmNFbuXqQIbIM680HCEoaAFKQ+P1nsgdCaD4TiX4qfKeYHrOpWIs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PXgoZJ9e; arc=none smtp.client-ip=10.30.226.201 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789105027404188752 X-GMAIL-MSGID: 1789105027404188752 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)