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 X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87A48C47084 for ; Tue, 25 May 2021 00:57:39 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B85D6141F for ; Tue, 25 May 2021 00:57:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B85D6141F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 67A8C82CC6; Tue, 25 May 2021 02:57:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="cSUhS4zx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 16BB482F76; Tue, 25 May 2021 02:56:54 +0200 (CEST) Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8C5AD82F61 for ; Tue, 25 May 2021 02:56:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf32.google.com with SMTP id a7so10876842qvf.11 for ; Mon, 24 May 2021 17:56:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Ve5GGYcazXE4ViihAm2z6mkNWBG6ZvyrXiNJEHy9DMg=; b=cSUhS4zxwFBoH7LoqzMTGwTbemH7TEMSK7MbB1XGlgGORxc8hpZUQHoOFiWPwNNs0Y PutA0oGqFh9uPC2gGCSWh3KZFzuhKZFgCFKYowAXG6PcKLcFH+54qjBRsTptx+0z3/H4 u7fOKHJKS7+Ndh98j2tEtmo+vRpQdcmVH9KyQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Ve5GGYcazXE4ViihAm2z6mkNWBG6ZvyrXiNJEHy9DMg=; b=gLZE4H+Q5zL1b2/SEQ0DhRdxkOsL8/OddftanJqVRZdqaapqJ5FBkFEE529TfC501a wYpZ+KpVpCXvsTxjDGNREPptmIpmRa+N8lrMyJvq4cd7xL280KeS957Samtg05QjGQC8 LJpznkB12pXmSRJl6tTDx2tMdZhkHhtvTLxzRL3lQk23NAw0/ivwuO7mQyP1IyZM0Gf4 cPJq6lJV6GrTwnRfK7It5HDghlUnUFBbncA50sCwoB95LbNnn21rLHu++BT5ALwowgPg rW4b63PFSsA4ij9hTMDk5XbDGenythauJf0+VJXX93HM1+xF180ZnpmOw5bXoCd8i6DC Btjg== X-Gm-Message-State: AOAM530/f32x6IbGaNMVSOmwMJFe1o/c/IgN+E7HRPDGWYVLeAZ1MF1j vNsrclu+MEZghZiLrKadz9PulQ== X-Google-Smtp-Source: ABdhPJylM7Lrc/ylO+7pRJKeUjouCSch5VoNQLyMCtePzQv9XfTOSSn7N/IOJXh6avkEqJ4ZJjh1mw== X-Received: by 2002:ad4:446c:: with SMTP id s12mr33108965qvt.34.1621904175590; Mon, 24 May 2021 17:56:15 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-5ce8-9acb-4a3a-47a0.res6.spectrum.com. [2603:6081:7b01:cbda:5ce8:9acb:4a3a:47a0]) by smtp.gmail.com with ESMTPSA id a10sm11280690qtg.40.2021.05.24.17.56.14 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 May 2021 17:56:14 -0700 (PDT) Date: Mon, 24 May 2021 20:56:12 -0400 From: Tom Rini To: Marek =?iso-8859-1?Q?Beh=FAn?= Cc: u-boot@lists.denx.de, Simon Glass , Heiko Schocher , Patrick Delaunay , Patrice CHOTARD , Miquel Raynal , Pali =?iso-8859-1?Q?Roh=E1r?= , Stefan Roese , Heinrich Schuchardt , Alexander Graf , Marek Vasut , Neil Armstrong , Ryder Lee , Adam Ford , Bin Meng , Harald Seiler , Tim Harvey Subject: Re: [PATCH u-boot v4 21/36] ARM: make gd a function call for LTO and set via set_gd() Message-ID: <20210525005612.GB17669@bill-the-cat> References: <20210520112425.25166-1-marek.behun@nic.cz> <20210520112425.25166-22-marek.behun@nic.cz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="TO+C2CEso28YlQFN" Content-Disposition: inline In-Reply-To: <20210520112425.25166-22-marek.behun@nic.cz> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean --TO+C2CEso28YlQFN Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 20, 2021 at 01:24:10PM +0200, Marek Beh=FAn wrote: > On ARM, the gd pointer is stored in registers r9 / x18. For this the > -ffixed-r9 / -ffixed-x18 flag is used when compiling, but using global > register variables causes errors when building with LTO, and these > errors are very difficult to overcome. >=20 > Richard Biener says [1]: > Note that global register vars shouldn't be used with LTO and if they > are restricted to just a few compilation units the recommended fix is > to build those CUs without -flto. >=20 > We cannot do this for U-Boot since all CUs use -ffixed-reg flag. >=20 > It seems that with LTO we could in fact store the gd pointer differently > and gain performance or size benefit by allowing the compiler to use > r9 / x18. But this would need more work. >=20 > So for now, when building with LTO, go the clang way, and instead of > declaring gd a global register variable, we make it a function call via > macro. >=20 > [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D68384 >=20 > Signed-off-by: Marek Beh=FAn > Reviewed-by: Simon Glass Applied to u-boot/master, thanks! --=20 Tom --TO+C2CEso28YlQFN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmCsSywACgkQFHw5/5Y0 tyzJkgwAum8oUsEgH7GnuCTIM0H00Z3HJ22nn0hDan8cC61+VK5dQ121HEAlhtGm UeH1jk6iiPp5WwQCx2yzgK4gH65DFql+U8I0z4o3DScGPaEA25kc1k+uNkXHCCJI jdVBJozlGRVoR6dPlExJFG++lBBfD8DcudHCUa5Xl7MXImRSvwu6cmYODmbxoqB3 lXiQiHMgh7nnjFDvXkn/89kJusGvTbWVqJ29Tu/8i0sJ9J/tUghXP+w5M2p5Hl0Q b5MYBUv5U/Lt9hHaRE6gTduQlnuSCPizH6PGM01uO00i8DqH0E1LCg9dLPGk7SxJ cBplDZseoY7L4TTmQ9NPkrkUcmZIyC7E5+n4Knws+Hz5aXPC8igldo8b+lgLTTsC D7+wk0LAjdmZjRxhkKSgEF+jHuw5Pib2gLpr73Bj/jzjrqwkt5kg9JC+yqfFNkDM PNRIjxUyWI7Sr2FoP0LPN4TkNp3uXI/HLMD+vbcyPju06ggUvY1TX6WDjvaiVGy/ HhSuohxV =N2WR -----END PGP SIGNATURE----- --TO+C2CEso28YlQFN--