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=-2.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 E6FFBC47096 for ; Sun, 6 Jun 2021 15:20:56 +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 A785C60FF0 for ; Sun, 6 Jun 2021 15:20:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A785C60FF0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmx.de 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 DB038814A4; Sun, 6 Jun 2021 17:20:52 +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="ka3jHMEE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D53A681780; Sun, 6 Jun 2021 17:20:50 +0200 (CEST) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (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 0536680C58 for ; Sun, 6 Jun 2021 17:20:47 +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=1622992847; bh=AZqf2O/r5FoEFNfEX0hU1nK+xIzNlQPdtJPA/vx0WX8=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=ka3jHMEEwhdivRMV79ldSDNCFuv+0oqMhe2YxuL/xIEMWDTxIYAJF6U8CPpI+Qj2U DJfWT9ONv40E/I1cAc/Ab7T5ByZ0QAasPYR4bhiQFRnLarKcIIwQP9/kXocxtDnK1v dOCMe0QK/I3IKoM+rBOP5hrjO+bvG/GWV1Gabwz8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.35] ([62.143.247.63]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mi2Jt-1lCT1z3YwL-00e0dw; Sun, 06 Jun 2021 17:20:46 +0200 Subject: Re: BISECTED f3866909e350 ("distro_bootcmd: call EFI bootmgr even without having /EFI/boot") To: "Matwey V. Kornilov" Cc: michael@walle.cc, U-Boot Mailing List References: From: Heinrich Schuchardt Message-ID: <5e1f6595-3371-8d56-ebfa-916d10b5aad4@gmx.de> Date: Sun, 6 Jun 2021 17:20:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:GOJ3PJ+idPmCGRTxeCopQdxTsk29SQ9RX3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unnJ5l+/iSrsVhzmiOBmH/mWj4y8BhLJOGDaF6Wyn S/IgSjC/P+P120yEKEOCtRq4YLAYjYed6f03+aTN1SV2iKN6eGKEOi89AGjYsIs9TNw6haG9R pxixYWwciXDnmszvd6Z4DY7R7kktgSj42H+cp8/gpO8D2Ng1QLnSk6veyIcr0ASvFY97iqpeu TMxjHk1GcXcHVhvuuQZP0OWq3AEVQmx6lTAnkXGAWb8P9NCS5OS6/DcyqQUz/RXF6gQCB8NtS KSAeCfxADgl0Fdok2uL0J5TZOLF0J+AgTnK 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 On 6/6/21 4:37 PM, Matwey V. Kornilov wrote: > Hi, > > I've found that > > f3866909e350 ("distro_bootcmd: call EFI bootmgr even without having /EFI= /boot") > > breaks running EFI application from USB device on BeagleBone Black > (am335x) device. > > With this patch I see the following: > > Booting /efi\boot\bootarm.efi > Welcome to GRUB! > > data abort > pc : [<9ce0b6d0>] lr : [<9ffab7c7>] > reloc pc : [<7d69d6d0>] lr : [<8083d7c7>] > sp : 9df44e28 ip : 9ffdfe90 fp : 00000003 > r10: 9ffe3300 r9 : 00000000 r8 : 9df6fe88 > r7 : 00000000 r6 : 9ce5da08 r5 : 9ce571f8 r4 : 9ce2c040 > r3 : 00000000 r2 : 00000001 r1 : 9ce56598 r0 : 00000000 > Flags: NzCv IRQs off FIQs on Mode SVC_32 > Code: e3500000 0a000015 e590000c eb00f96e (e5d03000) > UEFI image [0x9ce46000:0x9cf28fff] '/efi\boot\bootarm.efi' > Resetting CPU ... Hello Matwey, thank you for reporting the issue. $ echo 'Code: e3500000 0a000015 e590000c eb00f96e (e5d03000)' | CROSS_COMPILE=3Darm-linux-gnueabihf- ARCH=3Darm scripts/decodecode Code: e3500000 0a000015 e590000c eb00f96e (e5d03000) All code =3D=3D=3D=3D=3D=3D=3D=3D 0: e3500000 cmp r0, #0 4: 0a000015 beq 0x60 8: e590000c ldr r0, [r0, #12] c: eb00f96e bl 0x3e5cc 10:* e5d03000 ldrb r3, [r0] <-- trapping instruction Code starting with the faulting instruction =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 0: e5d03000 ldrb r3, [r0] Looking at the disassembly above we see that reading memory location NULL fails. We need to find out where the exception occurs. The code position is neither in bootarm.efi nor in U-Boot (9ce0b6d0 is lower than the load position of bootarm.efi, so it is below the relocated U-Boot code). Please, add the following line at the start of grub.cfg to get more output from GRUB: debug=3Dall When building U-Boot, please, add #define DEBUG 1 in lib/efi_loader/efi_disk.c and lib/efi_loader_file.c a line before #include . Best regards Heinrich > > while without the patch, GRUB works as usual. > Could you please help me to figure out what is going wrong here? >