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=-17.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,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 8DE21C4338F for ; Mon, 2 Aug 2021 21:31:00 +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 06A5760F39 for ; Mon, 2 Aug 2021 21:31:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 06A5760F39 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 141EB83439; Mon, 2 Aug 2021 23:30:58 +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="FLbDQrMK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 28C478342D; Mon, 2 Aug 2021 23:30:56 +0200 (CEST) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (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 832528343D for ; Mon, 2 Aug 2021 23:30:49 +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-qt1-x82b.google.com with SMTP id w10so12671710qtj.3 for ; Mon, 02 Aug 2021 14:30:49 -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=9NKRBilqQaFiPlNFSf7cyd53bUUK1ulA5iKmYg+EleE=; b=FLbDQrMKfUI8wfhhfkxroO69rw/4gzn+JC1E65fBGobYG1Ve4XXkoBNYFmpfgBkpBd 2riVuuaKUtV7z2E8IRwvFS1UaRQSM1jNRQNuiZygLST1edDqKqaeov3yQpa2HW9PXIyC o/yK6WJbUS2P1Vdp3bQ093I/E2fSe0rB2yvuc= 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=9NKRBilqQaFiPlNFSf7cyd53bUUK1ulA5iKmYg+EleE=; b=qQWzK/VUCjKr5wLa3HJAI5trIHW+7iPiFCJMAI9tkETqbELH5lZzCBF1FuFuAJUlDL zXCSqf1S9joYWmCxg3d+jJyt1K+HHeoVfh6Z3vaYXxLltuP1tFNlFnO2Q2OVunGiPEqM zEZV7FnZrEaL3wwgjybouPMzSdQtcYS9z7zjah6z45IRu3lHYmMBYr55C5AWYMi4yhV8 8l3uBEIl0DCWriKntwJvQmXbB8WNzZ+1CmUE1lAoxFky6G80lIO1PJ2bzVZ+Kty5o1sZ qDzxgu9D2lWv0mwzbnNvr/Yu2iDo/q+QHcmfNK5O8cHyjSMsQumD+GahAQSlzaaP020m 9m9Q== X-Gm-Message-State: AOAM533af3qpU9G1Kv3z7XtNWNV1JRma5LoxH0ARjGCWteqPSSogWkS8 2NEKmCLnBIfkbIOEw8tN/2sptR+XVqzztQ== X-Google-Smtp-Source: ABdhPJyNdPLMe7wURZ5MMbeebw5HISDkPrkNWKPT3RKuNIb+VVgeanhAy6JarInDt0TViNwSTKnVng== X-Received: by 2002:a05:622a:1704:: with SMTP id h4mr16044863qtk.346.1627939847965; Mon, 02 Aug 2021 14:30:47 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-a0a3-ef76-0712-405d.res6.spectrum.com. [2603:6081:7b01:cbda:a0a3:ef76:712:405d]) by smtp.gmail.com with ESMTPSA id c16sm5178361qtv.32.2021.08.02.14.30.47 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Aug 2021 14:30:47 -0700 (PDT) Date: Mon, 2 Aug 2021 17:30:45 -0400 From: Tom Rini To: Chia-Wei Wang Cc: u-boot@lists.denx.de Subject: Re: [PATCH] armv7: Add Position Independent Execution support Message-ID: <20210802213045.GE9379@bill-the-cat> References: <20210802104457.31906-1-chiawei_wang@aspeedtech.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zCA1yBaUmQgsyyxZ" Content-Disposition: inline In-Reply-To: <20210802104457.31906-1-chiawei_wang@aspeedtech.com> 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.103.2 at phobos.denx.de X-Virus-Status: Clean --zCA1yBaUmQgsyyxZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 02, 2021 at 06:44:57PM +0800, Chia-Wei Wang wrote: > A U-Boot image could be loaded and executed at a different > location than it was linked at. >=20 > For example, Aspeed takes a stable release version of U-Boot image > as the golden one for recovery purposes. When the primary storage > such as flash is corrupted, the golden image could be loaded to any > SRAM/DRAM address on demands through ethernet/UART/etc. >=20 > To deal with this condition, the PIE is needed as there is only one > signed, golden image, which could be however executed at different > places. >=20 > This patch adds the PIE support for ARMv7 platform. >=20 > Signed-off-by: Chia-Wei Wang > --- > arch/arm/Kconfig | 4 +++- > arch/arm/cpu/armv7/start.S | 43 ++++++++++++++++++++++++++++++++++++++ > arch/arm/lib/crt0.S | 11 ++++++++++ > arch/arm/lib/relocate.S | 35 ++++++++++++++++++++++--------- > 4 files changed, 82 insertions(+), 11 deletions(-) >=20 > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index 2b7b625705..45879c9f06 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -9,7 +9,7 @@ config ARM64 > select PHYS_64BIT > select SYS_CACHE_SHIFT_6 > =20 > -if ARM64 > +if ARM64 || CPU_V7A > config POSITION_INDEPENDENT > bool "Generate position-independent pre-relocation code" > help Thanks for doing this. I think we need to fix the depends on lines here rather than hide with if ARM64 || CPU_V7A, and then fix anything else that follows to also have the correct dependencies. --=20 Tom --zCA1yBaUmQgsyyxZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmEIZAUACgkQFHw5/5Y0 tyxRvAv/QsFxDOFpAgU/H04t364CuUveZw5hkj9+p3sZI5tyoh16jm3EWyMjcMvu OON+m2w9VwuPfZRx8A+wPnPnADXReESQO4+5E2Rq/U4oz5w5d6khbF275WzZCMPP KjqxX9M+68npx2wkyf3pXju9dRr1pj2e7lDxruWIoXV57fWi5mcvyeeWPhJFiQe/ bXwKFf4WfrbglLL8stN98YWoWB60W2Zmw/9COaM2fJ0rsZQcr8YNaTbHIaszispz dCtuRQajr+bycrNZCGuFnBEJojwJOZ/GAefqk2tW2NaybyQpOW6/5L37I5m0aaIz Dxth9d691/8pcx5u1vwb/TXFa4hm2LritwnFb3yCDSAzqrz1Gna/Z1rmR2rG4xHX k21ow7Ck0sSbymzLmdoopIELxckw8OmtF7CDsw5Djt5/2mm8mZtAIjxRnigM2r2n VKXGuwsipeeTvZGl8O47CbWh7m2C1jI/2qnwxb2BJ8f7lj5GdHFQEXSzz1Ekh4v/ 82ZHzah3 =3mxB -----END PGP SIGNATURE----- --zCA1yBaUmQgsyyxZ--