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 A593FC433EF for ; Mon, 25 Oct 2021 18:52:22 +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 9D9AF60230 for ; Mon, 25 Oct 2021 18:52:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9D9AF60230 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.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 8403E80F3B; Mon, 25 Oct 2021 20:52:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1635187939; bh=lmfPk+MwZrhvdEeq0TMmcMwVhAnN/Z0y1YVHa83ukGo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=q/W0pKD3OTF6J1nEfp4BDWf9onDoMniNnTZxJN9fLDYoTqQDc7/TIthsJGLByQifE UZjyyOhtg3zdiupm0KrHewexcCZKoYxzox5SpUk+IFITgnvz78CHF4YoMDKwMg/LD+ antFiBaSY7xm29YRLALUybTA4fYChW8p25IifmD8ijQoj861S5yC/NptqYrrLbt88z GUi76DiRSmzlCkBcJIgWNa4/Fh7gSxgkVEeKMBtVm3vvzNo2lT3JDWxHVyDEdoP6FQ chLOn98oztvLkOTf8ScQdOuhN4OqDMVtfzd9XCQZGsxzXS6bqJvREGkAH0cG9QydLT yhOnb8EGKloHw== Received: from [IPv6:::1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 8198D80944; Mon, 25 Oct 2021 20:52:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1635187937; bh=lmfPk+MwZrhvdEeq0TMmcMwVhAnN/Z0y1YVHa83ukGo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=we9NL8KnlSoROM1JKnBG++HjexOz+7UfZVkslX0CcidH6fZD4B6a26C9ElESdSS7p ljlKa4HyV0v/u9o2fCCCzb9+9eGtr46JPb56s4VAiRn7VkS1+Q8IS9FPAKfe0wyoaM 03FZH61n+6lvMDDsrgfUtVEuCRTf16CGsC5mZojLqTzVzNqCeu10iwrklVFH0IFY/T YUNjFcbxp3qr9rCePC4HsLZuMGsTE9e/6kCEp29+nST9lk33btJh4NR2HdJ7zkvdFD cbXYixu+cU+qeNcrsI2AZcfSVios9ybS2i48ahIM2lTTdv7k36oEMGcRzlSc0zEusz Bqna4w0mnsPaQ== Subject: Re: [PATCH] efi_loader: Handle GD_FLG_SKIP_RELOC To: Heinrich Schuchardt Cc: Simon Glass , Tom Rini , u-boot@lists.denx.de References: <20211010214857.871670-1-marek.vasut@gmail.com> <835fa80d-1cca-3d86-38d2-7083ab0119cd@gmx.de> From: Marek Vasut Message-ID: Date: Mon, 25 Oct 2021 20:52:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <835fa80d-1cca-3d86-38d2-7083ab0119cd@gmx.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit 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/25/21 8:46 PM, Heinrich Schuchardt wrote: > > > 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=y. >>> lib/efi/efi_app.c:131:  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? It shouldn't, do you have a more generic idea ?