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 8850FC433F5 for ; Mon, 25 Oct 2021 18:46:54 +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 CCEB36101C for ; Mon, 25 Oct 2021 18:46:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CCEB36101C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmx.de 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 2D9B280615; Mon, 25 Oct 2021 20:46:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmx.de 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; secure) header.d=gmx.net header.i=@gmx.net header.b="gDAZANRN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5C00B8352D; Mon, 25 Oct 2021 20:46:49 +0200 (CEST) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BA2538029E for ; Mon, 25 Oct 2021 20:46:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1635187604; bh=2RVjp400jJuwrOXjLAluo/F0VFx9Sdcb7vRT8X2PZ3A=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=gDAZANRNzmoQZ1Y57BxvdRUVwA23GsFlbmQRGYRt6lIN06CscfrpvTB/cy5uJHj+V M9gw9Bmji9VAu5+kZl1iBUm320dJWuSNdSEqJjCZjeDHWOD8YF7wVqcUNI+F2OpDRX 4ahjQySWwdSpe0nh8anDBVPfzkMVQSGaHyl4OogQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.35] ([88.152.144.157]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MmlTC-1n3eqY1BIc-00jqWH; Mon, 25 Oct 2021 20:46:44 +0200 Message-ID: <835fa80d-1cca-3d86-38d2-7083ab0119cd@gmx.de> Date: Mon, 25 Oct 2021 20:46:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: Re: [PATCH] efi_loader: Handle GD_FLG_SKIP_RELOC Content-Language: en-US To: Marek Vasut Cc: Simon Glass , Tom Rini , u-boot@lists.denx.de References: <20211010214857.871670-1-marek.vasut@gmail.com> From: Heinrich Schuchardt In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:iLV7d/3tIyDuhbkzBNXIMvucdY85mmRhC145/j9C0G7wF9SdpMu 2WGQoqpgXWGMuIWWDsVvdsVpK731LNV9XTOTZSSythFE4yQG0r94+2PgE1iOIG9ZsxeDS7i BDGqS0WdeAjNuh14xtE/qYAQWTS16fcjSHEXqBWRwyu66RA511D9CXCTRrWnOnI0ki0Aaep oRQddMp++tSxMmK3MMj7g== X-UI-Out-Filterresults: notjunk:1;V03:K0:f4bIKaLMq2Q=:DneO73Vy+tY4hOJjfJ/Dr2 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IdfMsHrdB5cazEn/3XS nQi/L/buV0QkA0= 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 On 10/24/21 01:03, Marek Vasut wrote: > On 10/11/21 1:36 PM, Heinrich Schuchardt wrote: > Hi, > >>> In case U-Boot starts with GD_FLG_SKIP_RELOC, the efi loader >>> relocation code breaks down because it assumes gd->relocaddr >>> points to relocated U-Boot code, which is not the case. Add >>> special case for handling GD_FLG_SKIP_RELOC, which uses the >>> __image_copy_start instead of gd->relocaddr for efi loader >>> code relocation source address. >> >> GD_FLG_SKIP_RELOC is only to be used by the x86 EFI app which is >> incompatible with CONFIG_EFI_LOADER=3Dy. >> lib/efi/efi_app.c:131:=C2=A0 board_init_f(GD_FLG_SKIP_RELOC); >> >> Why do we need this patch? > > GD_FLG_SKIP_RELOC is set when U-Boot doesn't perform relocation, it has > nothing to do with EFI. That case is currently broken, try setting > GD_FLG_SKIP_RELOC early on in U-Boot (somewhere early, e.g. in > mach_cpu_init()) and the system crashes on board_init_r when > initializing EFI. You missed the second question: Why should the change be ARM specific? Best regards Heinrich