Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp485252rdb; Fri, 26 Jan 2024 01:23:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzcFrC8LdVtXIdMhKx0SvEBoOvIbsumBNxzpA5TZPbsqtgMfyKqLcnvjxeFffRiJP9w/nZ X-Received: by 2002:a2e:7408:0:b0:2cf:2cc2:f4d with SMTP id p8-20020a2e7408000000b002cf2cc20f4dmr574623ljc.87.1706261014054; Fri, 26 Jan 2024 01:23:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706261014; cv=pass; d=google.com; s=arc-20160816; b=Oro9ukz1X6fxSUhQX85oJjIbc4+IiKDQJeIbZvAHCEdnjE6d+wfzty1/r1xhsGU9lY tL3cVKNHlInPzQDerkrKrICX2UkBzEc0f53Gxs2R91V88bftdnByc3he1itt1/Y4PmGv bgrDZyLjQ76MK7o0Gn2oF4vvSexlqF4aw32EQUhwNkkiSoWhTaEoDXJGGmVATAdO5tdm iQWw60HnndWG5k0HrCwCoeC0UUCxFs3kXpwet+hdDOwdYCAPy4aRx/k1YEdpuulz6AEn VYaf94zZg8si3vQ7BaHAGacUQlgEDS2KSROfHViJecTlVca+U/fZnTbQ3Sh3f8iE0AVN sXQA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=2VgBnVu8NUG9UqNNLVmDE1fzIfO3F2pSc0Up0IiM5XA=; fh=oJogvyqITJujdvKXitdstrb+Pso+rxB2DXkAlwq1p30=; b=ZvuQXSRs5129JriyUH7fHiMNnYiMn11VkbBx32GiN26s02seqpT7oDkrpoW7iz6v6Z LW5E+BCATkZAtPgTkDnisnV8WU4mfNrneAR/659gLNlmqBTIs4MwJRN9sYMeuchsENuL PLzkCMDd+HgJAjUD4/YC/FfcqwsJyAlkBdDVbzu4+CV6N5jU4zpTPVkf/X/GeHqnj7mg rMdInCZ+z0b0saE/BFKljkDLLi+lKlBPTL5RY47V9A1f2OFM1gqY7fdFEOnskJsURG/t Ei1g+6rS8wfu0MXyti9cYIPzGt8qDtP0FZWr3zTQasz4JZWmBWinfMwoEuhhUqFHyMup RYiA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DJrwKq0Y; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-39787-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39787-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b18-20020a0564021f1200b0055d39277078si207940edb.82.2024.01.26.01.23.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 01:23:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39787-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DJrwKq0Y; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-39787-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39787-linux.lists.archive=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 9ED0B1F28126 for ; Fri, 26 Jan 2024 09:23:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB9951CD1B; Fri, 26 Jan 2024 08:44:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DJrwKq0Y" 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 E3C6014276; Fri, 26 Jan 2024 08:44:50 +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=1706258691; cv=none; b=eNYyBp6csFBDU2OSGyXT6UjBMXIBqbMfpLREvOTCYX8Lh7BJ0xGJh1yjxCAA59sWiSegOUa6de2R85pyRnCUTyHAtgJzOXsmA6fbijy/0VJOlwqT0zGRD7u4YXEc8KwpqcN/vb/bg67Mv6DynKkyRMjp7OcsjAt7L4FwL8Pv9fs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706258691; c=relaxed/simple; bh=gaO5xq4+iqo/CpWSTXlZvHIwYFC0rTJKMRPwhqMBRbo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=dPRevf5e/WOCCNTPlvdDY5B3BhR8QCfgUYzORMWuRdxswXxxqQEQvI8nlEIXA8cNeiDh6mt5nM0yAGM0GTpKcdIdXtvGW34w4JJzpbCqeBuEn3Zo1GWHg3nO1jLhDZMvnMdIbRGx5nRRQ1enx+5LwCOkvdyAd6lEI2UZ/0Y7Aco= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DJrwKq0Y; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD862C433B1; Fri, 26 Jan 2024 08:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706258690; bh=gaO5xq4+iqo/CpWSTXlZvHIwYFC0rTJKMRPwhqMBRbo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=DJrwKq0YiCYXRsEOAkgnCozSU3DFfNvol2WhYcL+1l7yRpdzxU97/wyN6dC3VvYZi AVQrz3RS5yS9M7Hi26EsL4tQTmix5gNZ5L0ydLrSsRJfcNqq9PHgR+uVj5mHn1WoZI w6eKuPT/PK1ycyJoVYkSgq6yOWbT1hVxSy2lEw4XNllrCqh0ZZWQg0Lc1VLQ/IoXf7 OzdDPBQ+w7d3Qu7cq8kqO78yyb64RHjG1yNfiB0cAkxIrPoxGYUrOFuyKV5i8wbpaw KysOQx0Yb2GKXV3kpzSNrUgl5Gm78WWcQfaMo6z2arb6GFDNu0TQ1ZGHESve7lNNZ9 tcWnTV9YcfvRQ== Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-5102188d2aeso94365e87.2; Fri, 26 Jan 2024 00:44:50 -0800 (PST) X-Gm-Message-State: AOJu0Ywei91T/6fI16Pu0chJJNH6KVZZ3KJweRdUVX9ZiugojvnHu8S5 Y9YZjFy8HhEwz2Hs1aPpC6yaSklYIGc6/WyVT/pVnwb9isnDYsURS+t+guuGb3NY5TncblghSwA ORtnplGK9iIFYjylgK/Oy2JeUvlA= X-Received: by 2002:a05:6512:2246:b0:50e:7410:d5b0 with SMTP id i6-20020a056512224600b0050e7410d5b0mr669457lfu.28.1706258688908; Fri, 26 Jan 2024 00:44:48 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240125-bump-min-llvm-ver-to-13-0-1-v1-0-f5ff9bda41c5@kernel.org> <20240125-bump-min-llvm-ver-to-13-0-1-v1-4-f5ff9bda41c5@kernel.org> In-Reply-To: <20240125-bump-min-llvm-ver-to-13-0-1-v1-4-f5ff9bda41c5@kernel.org> From: Ard Biesheuvel Date: Fri, 26 Jan 2024 09:44:37 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 04/11] ARM: Remove Thumb2 __builtin_thread_pointer workaround for Clang To: Nathan Chancellor Cc: akpm@linux-foundation.org, masahiroy@kernel.org, nicolas@fjasle.eu, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev, linux-kernel@vger.kernel.org, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" On Thu, 25 Jan 2024 at 23:56, Nathan Chancellor wrote: > > 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) > > -- > 2.43.0 >