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 9C806C433F5 for ; Sat, 23 Oct 2021 23:03:05 +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 B08F960EBC for ; Sat, 23 Oct 2021 23:03:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B08F960EBC 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 753FF82BC0; Sun, 24 Oct 2021 01:03:02 +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=1635030182; bh=yZd/PJ5dNQEPZYNxPedOitlgWtW27dTw5y/ochGhpoI=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=NfKnJQCBx2b7QIroAO+AF0w4K20clUGxtBeP6FhdkV+GdW52xSk3KDeb1p7zm2235 SX7MYviFABymZbRdfum6uD3bvLGK0cuaoMzji4xPbRmmGgv12BXpcqwsyvdS8Oj+8g UgmJknytWO4IpXCLSWjEntW+7idfe6DoRLU0sN2K3R0pY2F0FkEfpK4DGOytxd4jYk nirSaws/SgMNmaThZzi+V8io3YQI/x+oUTASTWrzhStIqeDzx4LaNMADInccQVQQyj HYOI+YRFR+CA0FZ4wuDrrc2CHH8i6ZvfqpLy7Vh3vLZ0rczicRxWNWdJ7MCYjjAkbC nsACvtyUnsCWA== 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 913B78291E; Sun, 24 Oct 2021 01:03:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1635030180; bh=yZd/PJ5dNQEPZYNxPedOitlgWtW27dTw5y/ochGhpoI=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=jDjf34pTq8gbwVEneynrE/9OpDjrWvgCvi4gVR0H5MZSbsgd0iyiHOL/yALmpXt5U gDIrlYXfd56MJVYMYngHfRG6tCa4JOkDiRW5PxGpLNIABC2p8DEhKjWn+ICAUdsrOD dk8s3loKMEHOW34bW07LOFBneJBk9E9JGKc4FD6z+UwGyE38WWopoeDYfd08/ek3PN 9h3gPkAUCknC+y0/J0fpLn5U8JdfjvSYSm+qimIomAwyFN3/aY+ihCFzu579jrRgIW +GEnPV6AzpZuoawRuLKe5Aj+kh8XfNuBKpYLFf9947tbyYO/24KttUbU/f2bjxtz1i sRRHulycYC+VQ== 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> From: Marek Vasut Message-ID: Date: Sun, 24 Oct 2021 01:03:00 +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: 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/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.