From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE22DC433F5 for ; Thu, 28 Oct 2021 16:53: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 87E4A60F02 for ; Thu, 28 Oct 2021 16:53:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 87E4A60F02 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fPe8tNi27ol8Ktok3VY3AxeXWBzKig0/UwGlQYN6n0Q=; b=wUZO09iLBJvtyK kL74ZbzKTgBMwBfzMDfuRNWOaOsPu99duKZaZ51T7Qef4syCv4ovJ8DUPpnNbqWsvs2YRsgKmIMuq Obwn33kE3AxqqgOaVaF3FPu8Oho6rEDkA1DUN0ohL/srxLBhXKSX2xLuVqMoHB+KHyCJEqnCVKbcj eYUSjz9DjfhwurtuIR6pR2JbRqhYL9jNmg9nOJ/uUHr/RpWZ7i4dEvRdX7nnaR8wWIUAkRURmkWoh i2Ve4G8nyFmSuF4UQHsgbyn4w2guEiogAl1UdvBtZMlNCSxXpylcjAJKkDq2Ozc2fG36W0z4ma6Av aLKTzZnYUtx1xXLZdJeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mg8dn-008dHp-VQ; Thu, 28 Oct 2021 16:52:36 +0000 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mg8dk-008dH8-K9 for linux-arm-kernel@lists.infradead.org; Thu, 28 Oct 2021 16:52:34 +0000 Received: by mail-pf1-x42b.google.com with SMTP id t184so6604582pfd.0 for ; Thu, 28 Oct 2021 09:52:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=zQ7kZMwk+IdoWi4at7JrYOqXvIJpxP5dGtdXftDL1Qg=; b=RJbTDZt0YfKmmrxUz3A0BR+JY0hYwk8whh9hlC2L43IyV8uygTmpCuFBYe8dfensZN tyAW/Qd+DrcFsjlyF93ZxX5mGEeZlyO52soLwOM8U3+nUFTLxt++dfnu+Lp6kMM+1lKy aagOiPWrSB6+tsQ+OdQxvLTYiNdhi9JobWp1w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zQ7kZMwk+IdoWi4at7JrYOqXvIJpxP5dGtdXftDL1Qg=; b=OVsawRf0Ce7Wbe3r6Dxy3LD+mb+QCBv94C6Bu/fdx+k9ho/Ao/VLWfTcy6x30HgHl2 7NGO/Qa0eXbk0EzVxjna3Hcp9IC1aHCRnqqOH610Oa+2/Z2aHyl8JIzjRRz1YZqQWTSj OYzE8gmWq1JU4GeV6FlXZdbhPBkSmx9Z4ay0DcoIX1BEUWkw5ysk1MauQydwcACE73gQ 0vAeI243mdzfmsp/k0CYSVK9pF3Cw/7kG4vwaI/QmxocB4fwTIPKmGxEV7mqRwgD/E7Z AoDxa/ScWKM+O0IIKsYYM4562Y9E+A0nqrwhBZ0PQSBm+Z2fy5zcza7pk+5JkoFB8ywx T1bQ== X-Gm-Message-State: AOAM532nkXo07Esgn86OWF2RQn9b7ymJTijTaWcxsFCaCuDreuvRTVJK PffeXUiqOlMMrsdOWQAMF3oYDw== X-Google-Smtp-Source: ABdhPJzJ1QJTOkBbOb5I3ZuOwxNmJ18jdrCiDkxWGo575Z0hXE3pfnCUugcC44ViezFnJ9M3B3hV8g== X-Received: by 2002:a63:751d:: with SMTP id q29mr4048790pgc.222.1635439951281; Thu, 28 Oct 2021 09:52:31 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id e14sm1951696pga.76.2021.10.28.09.52.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 09:52:31 -0700 (PDT) Date: Thu, 28 Oct 2021 09:52:30 -0700 From: Kees Cook To: Ard Biesheuvel Cc: linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk, arnd@arndb.de, ndesaulniers@google.com, nathan@kernel.org Subject: Re: [PATCH] ARM: Thumb2: avoid __builtin_thread_pointer() on Clang Message-ID: <202110280952.352F66D8@keescook> References: <20211028083527.1057158-1-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211028083527.1057158-1-ardb@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211028_095232_703988_0691B11F X-CRM114-Status: GOOD ( 15.93 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Oct 28, 2021 at 10:35:27AM +0200, Ard Biesheuvel wrote: > If available, we use the __builtin_thread_pointer() helper to get the > value of the TLS register, to help the compiler understand that it > doesn't need to reload it every time we access 'current'. > > Unfortunately, Clang fails to emit the MRC system register read > directly when building for Thumb2, and instead, it issues a call to the > __aeabi_read_tp helper, which the kernel does not provide, and so this > result in link failures at build time. > > So create a special case for this, and emit the MRC directly using an > asm() block, just like we do when the helper is not available to begin > with. > > Link: https://github.com/ClangBuiltLinux/linux/issues/1485 > Signed-off-by: Ard Biesheuvel Reviewed-by: Kees Cook -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel