From mboxrd@z Thu Jan 1 00:00:00 1970 From: takahiro.akashi at linaro.org Date: Wed, 15 May 2019 17:25:51 +0900 Subject: [U-Boot] [BUG] simple-bus and rsa-sw with DM_FLAG_PRE_RELOC In-Reply-To: <4d569c6efdfe07126e266a3fa8c5f9b04239cf5c.camel@aisec.fraunhofer.de> References: <20190515055539.GR11160@linaro.org> <20190515071231.GU11160@linaro.org> <4d569c6efdfe07126e266a3fa8c5f9b04239cf5c.camel@aisec.fraunhofer.de> Message-ID: <20190515082550.GV11160@linaro.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, May 15, 2019 at 08:14:18AM +0000, Auer, Lukas wrote: > On Wed, 2019-05-15 at 15:39 +0800, Bin Meng wrote: > > On Wed, May 15, 2019 at 3:12 PM AKASHI Takahiro > > wrote: > > > On Wed, May 15, 2019 at 02:45:19PM +0800, Bin Meng wrote: > > > > On Wed, May 15, 2019 at 1:55 PM AKASHI Takahiro > > > > wrote: > > > > > As of v2019.07-rc1, > > > > > u-boot does fail to boot without any messages on qemu-arm64 when > > > > > configured with qemu_arm64_defconfig plus CONFIG_RSA/RSA_SOFTWARE_EXP. > > > > > (Note that RSA_SOFTWARE_EXP also declares itself with DM_FLAG_PRE_RELOC.) > > > > > > > > > > By bisecting between v2019.04 and v2019.07, I found that the following > > > > > commit triggered this regression: > > > > > > > > > > commit 3a7c45f6a772 > > > > > Author: Lukas Auer > > > > > Date: Wed Apr 10 14:46:07 2019 +0200 > > > > > > > > > > simple-bus: add DM_FLAG_PRE_RELOC flag to simple-bus driver > > > > > > > > > > What's wrong with this? > > > > > > > > I just tested it and it boots for me. > > > > > > > > $ make qemu_arm64_defconfig > > > > $ make menuconfig > > > > adding CONFIG_RSA via "Library routines" -> "Security support" -> "Use > > > > RSA Library" > > > > $ make > > > > > > > > $ qemu-system-aarch64 -machine virt -cpu cortex-a57 -bios u-boot.bin -nographic > > > > > > Thank you. > > > I have used locally-built qemu, so I will check the configuration of > > > my build. > > > > FYI > > > > $ qemu-system-aarch64 -version > > QEMU emulator version 2.5.0 (Debian 1:2.5+dfsg-5ubuntu10.36), > > Copyright (c) 2003-2008 Fabrice Bellard > > > > I was using Ubuntu 16.04 shipped QEMU packages. > > > > Regards, > > Bin > > The device tree might be different on your build. With this patch, more > drivers are probed during the pre-relocation device model. This > increases the size requirements of CONFIG_SYS_MALLOC_F_LEN. qemu-arm64 > uses the default value for CONFIG_SYS_MALLOC_F_LEN, which is likely too > small. We had similar problems on the i.MX devices, see [1]. Increasing > it should fix the issue. > > Thanks, > Lukas > > [1]: https://patchwork.ozlabs.org/patch/1094974/ Ah, it was a known issue. But is there any better, or more flexible, way to fix that issue? It was very difficult for me to find out a clue for root cause. Thanks, -Takahiro Akashi