All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [BUG] simple-bus and rsa-sw with DM_FLAG_PRE_RELOC
@ 2019-05-15  5:55 AKASHI Takahiro
  2019-05-15  6:45 ` Bin Meng
  0 siblings, 1 reply; 8+ messages in thread
From: AKASHI Takahiro @ 2019-05-15  5:55 UTC (permalink / raw)
  To: u-boot

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 <lukas.auer@aisec.fraunhofer.de>
        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?

-Takahiro Akashi

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [BUG] simple-bus and rsa-sw with DM_FLAG_PRE_RELOC
  2019-05-15  5:55 [U-Boot] [BUG] simple-bus and rsa-sw with DM_FLAG_PRE_RELOC AKASHI Takahiro
@ 2019-05-15  6:45 ` Bin Meng
  2019-05-15  7:12   ` AKASHI Takahiro
  0 siblings, 1 reply; 8+ messages in thread
From: Bin Meng @ 2019-05-15  6:45 UTC (permalink / raw)
  To: u-boot

On Wed, May 15, 2019 at 1:55 PM AKASHI Takahiro
<takahiro.akashi@linaro.org> 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 <lukas.auer@aisec.fraunhofer.de>
>         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

U-Boot 2019.07-rc1-00506-g90176e3 (May 15 2019 - 14:43:21 +0800)

DRAM:  128 MiB
Flash: 128 MiB
*** Warning - bad CRC, using default environment

In:    pl011 at 9000000
Out:   pl011 at 9000000
Err:   pl011 at 9000000
Net:   No ethernet found.
Hit any key to stop autoboot:  0
=>

Regards,
Bin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [BUG] simple-bus and rsa-sw with DM_FLAG_PRE_RELOC
  2019-05-15  6:45 ` Bin Meng
@ 2019-05-15  7:12   ` AKASHI Takahiro
  2019-05-15  7:39     ` Bin Meng
  0 siblings, 1 reply; 8+ messages in thread
From: AKASHI Takahiro @ 2019-05-15  7:12 UTC (permalink / raw)
  To: u-boot

On Wed, May 15, 2019 at 02:45:19PM +0800, Bin Meng wrote:
> On Wed, May 15, 2019 at 1:55 PM AKASHI Takahiro
> <takahiro.akashi@linaro.org> 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 <lukas.auer@aisec.fraunhofer.de>
> >         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.

-Takahiro Akashi

> 
> U-Boot 2019.07-rc1-00506-g90176e3 (May 15 2019 - 14:43:21 +0800)
> 
> DRAM:  128 MiB
> Flash: 128 MiB
> *** Warning - bad CRC, using default environment
> 
> In:    pl011 at 9000000
> Out:   pl011 at 9000000
> Err:   pl011 at 9000000
> Net:   No ethernet found.
> Hit any key to stop autoboot:  0
> =>
> 
> Regards,
> Bin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [BUG] simple-bus and rsa-sw with DM_FLAG_PRE_RELOC
  2019-05-15  7:12   ` AKASHI Takahiro
@ 2019-05-15  7:39     ` Bin Meng
  2019-05-15  8:14       ` Auer, Lukas
  0 siblings, 1 reply; 8+ messages in thread
From: Bin Meng @ 2019-05-15  7:39 UTC (permalink / raw)
  To: u-boot

On Wed, May 15, 2019 at 3:12 PM AKASHI Takahiro
<takahiro.akashi@linaro.org> 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
> > <takahiro.akashi@linaro.org> 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 <lukas.auer@aisec.fraunhofer.de>
> > >         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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [BUG] simple-bus and rsa-sw with DM_FLAG_PRE_RELOC
  2019-05-15  7:39     ` Bin Meng
@ 2019-05-15  8:14       ` Auer, Lukas
  2019-05-15  8:25         ` takahiro.akashi at linaro.org
  2019-05-15  8:29         ` Bin Meng
  0 siblings, 2 replies; 8+ messages in thread
From: Auer, Lukas @ 2019-05-15  8:14 UTC (permalink / raw)
  To: u-boot

On Wed, 2019-05-15 at 15:39 +0800, Bin Meng wrote:
> On Wed, May 15, 2019 at 3:12 PM AKASHI Takahiro
> <takahiro.akashi@linaro.org> 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
> > > <takahiro.akashi@linaro.org> 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 <lukas.auer@aisec.fraunhofer.de>
> > > >         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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [BUG] simple-bus and rsa-sw with DM_FLAG_PRE_RELOC
  2019-05-15  8:14       ` Auer, Lukas
@ 2019-05-15  8:25         ` takahiro.akashi at linaro.org
  2019-05-15  9:05           ` Auer, Lukas
  2019-05-15  8:29         ` Bin Meng
  1 sibling, 1 reply; 8+ messages in thread
From: takahiro.akashi at linaro.org @ 2019-05-15  8:25 UTC (permalink / raw)
  To: u-boot

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
> > <takahiro.akashi@linaro.org> 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
> > > > <takahiro.akashi@linaro.org> 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 <lukas.auer@aisec.fraunhofer.de>
> > > > >         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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [BUG] simple-bus and rsa-sw with DM_FLAG_PRE_RELOC
  2019-05-15  8:14       ` Auer, Lukas
  2019-05-15  8:25         ` takahiro.akashi at linaro.org
@ 2019-05-15  8:29         ` Bin Meng
  1 sibling, 0 replies; 8+ messages in thread
From: Bin Meng @ 2019-05-15  8:29 UTC (permalink / raw)
  To: u-boot

On Wed, May 15, 2019 at 4:14 PM Auer, Lukas
<lukas.auer@aisec.fraunhofer.de> wrote:
>
> On Wed, 2019-05-15 at 15:39 +0800, Bin Meng wrote:
> > On Wed, May 15, 2019 at 3:12 PM AKASHI Takahiro
> > <takahiro.akashi@linaro.org> 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
> > > > <takahiro.akashi@linaro.org> 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 <lukas.auer@aisec.fraunhofer.de>
> > > > >         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

Ah yes! I think the qemu-system-aarch64 I was using is a little bit
old but I did not realize that the DT might be different.

> 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.

I thought it might be due to insufficient CONFIG_SYS_MALLOC_F_LEN but
since I can't reproduce it my QEMU I did not suggest :)

>
> Thanks,
> Lukas
>
> [1]: https://patchwork.ozlabs.org/patch/1094974/

Regards,
Bin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [BUG] simple-bus and rsa-sw with DM_FLAG_PRE_RELOC
  2019-05-15  8:25         ` takahiro.akashi at linaro.org
@ 2019-05-15  9:05           ` Auer, Lukas
  0 siblings, 0 replies; 8+ messages in thread
From: Auer, Lukas @ 2019-05-15  9:05 UTC (permalink / raw)
  To: u-boot

On Wed, 2019-05-15 at 17:25 +0900, takahiro.akashi at linaro.org wrote:
> 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
> > > <takahiro.akashi@linaro.org> 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
> > > > > <takahiro.akashi@linaro.org> 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 <lukas.auer@aisec.fraunhofer.de>
> > > > > >         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

One problem is that the serial console is not yet available when the
out of memory error occurs. However with DEBUG_UART configured, U-Boot
should print an error (I did not test this). We could also increase the
default value of CONFIG_SYS_MALLOC_F_LEN, but this might not be
possible on all boards.

You are right, it would be good to have a better way of fixing this,
but I am not sure what the best way of doing that is.

Thanks,
Lukas

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-05-15  9:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-15  5:55 [U-Boot] [BUG] simple-bus and rsa-sw with DM_FLAG_PRE_RELOC AKASHI Takahiro
2019-05-15  6:45 ` Bin Meng
2019-05-15  7:12   ` AKASHI Takahiro
2019-05-15  7:39     ` Bin Meng
2019-05-15  8:14       ` Auer, Lukas
2019-05-15  8:25         ` takahiro.akashi at linaro.org
2019-05-15  9:05           ` Auer, Lukas
2019-05-15  8:29         ` Bin Meng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.