diff mbox series

[v4,1/4] u-boot: disable CONFIG_BLOBLIST on genericarm64 and qemuarm64

Message ID 20250526083548.413834-1-mikko.rapeli@linaro.org
State New
Headers show
Series [v4,1/4] u-boot: disable CONFIG_BLOBLIST on genericarm64 and qemuarm64 | expand

Commit Message

Mikko Rapeli May 26, 2025, 8:35 a.m. UTC
Booting u-boot on qemu with kvm is currently hanging on aarch64
build host. Root cause is in u-boot and CONFIG_BLOBLIST can be
disabled as a workaround.

To reproduce, build on kvm enabled host where "kvm-ok"
succeeds. For example genericarm64 machine and core-image-base
should then boot with:

$ runqemu slirp nographic novga snapshot kvm

On qemuarm64, default kvm setup will boot directly to kernel
and is not affected by this. If build enables u-boot as bios
then the same issue happens.

Without this config workaround, the boot hangs without
any messages in qemu output but ctrl-a-c to qemu console
can shutdown the emulated machine.

This seems to have regressed after u-boot 2025.04 update.
KVM boot can be detected from speed, for example genericarm64
boots in 550 ms with KVM and without in over 5 seconds.

Fixes: [YOCTO #15872]

Upstream u-boot discussion:
https://lists.denx.de/pipermail/u-boot/2025-May/590101.html

Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
 meta/recipes-bsp/u-boot/files/disable-CONFIG_BLOBLIST.cfg | 1 +
 meta/recipes-bsp/u-boot/u-boot-common.inc                 | 4 ++++
 2 files changed, 5 insertions(+)
 create mode 100644 meta/recipes-bsp/u-boot/files/disable-CONFIG_BLOBLIST.cfg

v4: no changes, posted together with selftest for feature

v3: added u-boot discussion link to commit message
    https://lists.openembedded.org/g/openembedded-core/message/217105

v2: applying to genericarm64 and qemuarm64 machines only
    https://lists.openembedded.org/g/openembedded-core/message/217054

v1: https://lists.openembedded.org/g/openembedded-core/message/217030

Comments

Tom Rini May 28, 2025, 12:51 a.m. UTC | #1
On Mon, May 26, 2025 at 11:35:44AM +0300, Mikko Rapeli wrote:

> Booting u-boot on qemu with kvm is currently hanging on aarch64
> build host. Root cause is in u-boot and CONFIG_BLOBLIST can be
> disabled as a workaround.
> 
> To reproduce, build on kvm enabled host where "kvm-ok"
> succeeds. For example genericarm64 machine and core-image-base
> should then boot with:
> 
> $ runqemu slirp nographic novga snapshot kvm
> 
> On qemuarm64, default kvm setup will boot directly to kernel
> and is not affected by this. If build enables u-boot as bios
> then the same issue happens.
> 
> Without this config workaround, the boot hangs without
> any messages in qemu output but ctrl-a-c to qemu console
> can shutdown the emulated machine.
> 
> This seems to have regressed after u-boot 2025.04 update.
> KVM boot can be detected from speed, for example genericarm64
> boots in 550 ms with KVM and without in over 5 seconds.
> 
> Fixes: [YOCTO #15872]
> 
> Upstream u-boot discussion:
> https://lists.denx.de/pipermail/u-boot/2025-May/590101.html
> 
> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>

I think it's a tad early to disable this. On the U-Boot side, it's being
looked in to. In fact, you're saying v2025.04 is working (current
release) and v2025.07-rcX is failing. At this point in the U-Boot cycle
I think we'll figure out the problem and fix it. If we can't figure out
how to keep all the use cases working for v2025.07 then disabling
BLOBLIST here in OE can be thought on, I would expect. Thanks.
Mikko Rapeli May 28, 2025, 6:40 a.m. UTC | #2
Hi,

On Tue, May 27, 2025 at 06:51:33PM -0600, Tom Rini wrote:
> On Mon, May 26, 2025 at 11:35:44AM +0300, Mikko Rapeli wrote:
> 
> > Booting u-boot on qemu with kvm is currently hanging on aarch64
> > build host. Root cause is in u-boot and CONFIG_BLOBLIST can be
> > disabled as a workaround.
> > 
> > To reproduce, build on kvm enabled host where "kvm-ok"
> > succeeds. For example genericarm64 machine and core-image-base
> > should then boot with:
> > 
> > $ runqemu slirp nographic novga snapshot kvm
> > 
> > On qemuarm64, default kvm setup will boot directly to kernel
> > and is not affected by this. If build enables u-boot as bios
> > then the same issue happens.
> > 
> > Without this config workaround, the boot hangs without
> > any messages in qemu output but ctrl-a-c to qemu console
> > can shutdown the emulated machine.
> > 
> > This seems to have regressed after u-boot 2025.04 update.
> > KVM boot can be detected from speed, for example genericarm64
> > boots in 550 ms with KVM and without in over 5 seconds.
> > 
> > Fixes: [YOCTO #15872]
> > 
> > Upstream u-boot discussion:
> > https://lists.denx.de/pipermail/u-boot/2025-May/590101.html
> > 
> > Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> > Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> 
> I think it's a tad early to disable this. On the U-Boot side, it's being
> looked in to. In fact, you're saying v2025.04 is working (current
> release) and v2025.07-rcX is failing. At this point in the U-Boot cycle
> I think we'll figure out the problem and fix it. If we can't figure out
> how to keep all the use cases working for v2025.07 then disabling
> BLOBLIST here in OE can be thought on, I would expect. Thanks.

2025.04 is affected by this. My wording for this is not accurate enough, sorry.

We have a workaround for qemuarm64 and generiarm64 for testing use cases
with disabling BLOBLIST so we might as well use it since there does
not seem to be any downsides to it in testing.

Cheers,

-Mikko
Tom Rini May 28, 2025, 2:18 p.m. UTC | #3
On Wed, May 28, 2025 at 09:40:59AM +0300, Mikko Rapeli wrote:
> Hi,
> 
> On Tue, May 27, 2025 at 06:51:33PM -0600, Tom Rini wrote:
> > On Mon, May 26, 2025 at 11:35:44AM +0300, Mikko Rapeli wrote:
> > 
> > > Booting u-boot on qemu with kvm is currently hanging on aarch64
> > > build host. Root cause is in u-boot and CONFIG_BLOBLIST can be
> > > disabled as a workaround.
> > > 
> > > To reproduce, build on kvm enabled host where "kvm-ok"
> > > succeeds. For example genericarm64 machine and core-image-base
> > > should then boot with:
> > > 
> > > $ runqemu slirp nographic novga snapshot kvm
> > > 
> > > On qemuarm64, default kvm setup will boot directly to kernel
> > > and is not affected by this. If build enables u-boot as bios
> > > then the same issue happens.
> > > 
> > > Without this config workaround, the boot hangs without
> > > any messages in qemu output but ctrl-a-c to qemu console
> > > can shutdown the emulated machine.
> > > 
> > > This seems to have regressed after u-boot 2025.04 update.
> > > KVM boot can be detected from speed, for example genericarm64
> > > boots in 550 ms with KVM and without in over 5 seconds.
> > > 
> > > Fixes: [YOCTO #15872]
> > > 
> > > Upstream u-boot discussion:
> > > https://lists.denx.de/pipermail/u-boot/2025-May/590101.html
> > > 
> > > Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> > > Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> > 
> > I think it's a tad early to disable this. On the U-Boot side, it's being
> > looked in to. In fact, you're saying v2025.04 is working (current
> > release) and v2025.07-rcX is failing. At this point in the U-Boot cycle
> > I think we'll figure out the problem and fix it. If we can't figure out
> > how to keep all the use cases working for v2025.07 then disabling
> > BLOBLIST here in OE can be thought on, I would expect. Thanks.
> 
> 2025.04 is affected by this. My wording for this is not accurate enough, sorry.

Do you have a known good version where it does work? I assume it's
v2025.01 that does work, and an OE-specific revert of commit
53d5a221632e ("emulation: Use bloblist to hold tables") with appropriate
status tags about it being discussed upstream would make the most sense.
Mikko Rapeli June 4, 2025, 10:09 a.m. UTC | #4
Hi,

On Wed, May 28, 2025 at 08:18:08AM -0600, Tom Rini wrote:
> On Wed, May 28, 2025 at 09:40:59AM +0300, Mikko Rapeli wrote:
> > On Tue, May 27, 2025 at 06:51:33PM -0600, Tom Rini wrote:
> > > On Mon, May 26, 2025 at 11:35:44AM +0300, Mikko Rapeli wrote:
> > > 
> > > > Booting u-boot on qemu with kvm is currently hanging on aarch64
> > > > build host. Root cause is in u-boot and CONFIG_BLOBLIST can be
> > > > disabled as a workaround.
> > > > 
> > > > To reproduce, build on kvm enabled host where "kvm-ok"
> > > > succeeds. For example genericarm64 machine and core-image-base
> > > > should then boot with:
> > > > 
> > > > $ runqemu slirp nographic novga snapshot kvm
> > > > 
> > > > On qemuarm64, default kvm setup will boot directly to kernel
> > > > and is not affected by this. If build enables u-boot as bios
> > > > then the same issue happens.
> > > > 
> > > > Without this config workaround, the boot hangs without
> > > > any messages in qemu output but ctrl-a-c to qemu console
> > > > can shutdown the emulated machine.
> > > > 
> > > > This seems to have regressed after u-boot 2025.04 update.
> > > > KVM boot can be detected from speed, for example genericarm64
> > > > boots in 550 ms with KVM and without in over 5 seconds.
> > > > 
> > > > Fixes: [YOCTO #15872]
> > > > 
> > > > Upstream u-boot discussion:
> > > > https://lists.denx.de/pipermail/u-boot/2025-May/590101.html
> > > > 
> > > > Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> > > > Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> > > 
> > > I think it's a tad early to disable this. On the U-Boot side, it's being
> > > looked in to. In fact, you're saying v2025.04 is working (current
> > > release) and v2025.07-rcX is failing. At this point in the U-Boot cycle
> > > I think we'll figure out the problem and fix it. If we can't figure out
> > > how to keep all the use cases working for v2025.07 then disabling
> > > BLOBLIST here in OE can be thought on, I would expect. Thanks.
> > 
> > 2025.04 is affected by this. My wording for this is not accurate enough, sorry.
> 
> Do you have a known good version where it does work? I assume it's
> v2025.01 that does work, and an OE-specific revert of commit
> 53d5a221632e ("emulation: Use bloblist to hold tables") with appropriate
> status tags about it being discussed upstream would make the most sense.

As you suspected and Ilias bisected this to:

53d5a221632eeef7483d250fdde09bde6cb54df9 is the first bad commit
commit 53d5a221632eeef7483d250fdde09bde6cb54df9
Author: Simon Glass <sjg@chromium.org>
Date:   Fri Jan 10 17:00:17 2025 -0700
    
    emulation: Use bloblist to hold tables
    
    QEMU can have its own internal ACPI and SMBIOS tables. At present U-Boot
    copies out the SMBIOS tables but points directly to the ACPI ones.

    The ACPI tables are not aligned on a 4KB boundary, which means that UPL
    cannot use them directly, since it uses a reserved-memory node for the
    tables and that it assumed (by EDK2) to be 4KB-aligned.

    On x86, QEMU provides the tables in a mapped memory region and U-Boot
    makes use of these directly, thus making it difficult to use any common
    code.
    
    Adjust the logic to fit within the existing table-generation code. Use a
    bloblist always and ensure that the ACPI tables is placed in an aligned
    region. Set a size of 8K for QEMU. This does not actually put all the
    tables in one place, for QEMU, since it currently adds a pointer to the
    tables in QFW.
    
    On ARM, enable bloblist so that SMBIOS tables can be added to the
    bloblist.

    Signed-off-by: Simon Glass <sjg@chromium.org>

So tags v2025.01-rc4 and earlier are fine and v2025.04-rc1 and newer
are affected.

Reverting this is a bit hard due to other changes so for oe-core it's
easier to disable CONFIG_BLOBLIST where possible, on qemuarm64 and
genericarm64 (uses same qemu defconfig) yocto target machines for
example, which for testing purposes can be used with qemu and KVM.

Cheers,

-Mikko
Ilias Apalodimas June 4, 2025, 1:08 p.m. UTC | #5
Hi all,

On Wed, 4 Jun 2025 at 13:09, Mikko Rapeli <mikko.rapeli@linaro.org> wrote:
>
> Hi,
>
> On Wed, May 28, 2025 at 08:18:08AM -0600, Tom Rini wrote:
> > On Wed, May 28, 2025 at 09:40:59AM +0300, Mikko Rapeli wrote:
> > > On Tue, May 27, 2025 at 06:51:33PM -0600, Tom Rini wrote:
> > > > On Mon, May 26, 2025 at 11:35:44AM +0300, Mikko Rapeli wrote:
> > > >
> > > > > Booting u-boot on qemu with kvm is currently hanging on aarch64
> > > > > build host. Root cause is in u-boot and CONFIG_BLOBLIST can be
> > > > > disabled as a workaround.
> > > > >
> > > > > To reproduce, build on kvm enabled host where "kvm-ok"
> > > > > succeeds. For example genericarm64 machine and core-image-base
> > > > > should then boot with:
> > > > >
> > > > > $ runqemu slirp nographic novga snapshot kvm
> > > > >
> > > > > On qemuarm64, default kvm setup will boot directly to kernel
> > > > > and is not affected by this. If build enables u-boot as bios
> > > > > then the same issue happens.
> > > > >
> > > > > Without this config workaround, the boot hangs without
> > > > > any messages in qemu output but ctrl-a-c to qemu console
> > > > > can shutdown the emulated machine.
> > > > >
> > > > > This seems to have regressed after u-boot 2025.04 update.
> > > > > KVM boot can be detected from speed, for example genericarm64
> > > > > boots in 550 ms with KVM and without in over 5 seconds.
> > > > >
> > > > > Fixes: [YOCTO #15872]
> > > > >
> > > > > Upstream u-boot discussion:
> > > > > https://lists.denx.de/pipermail/u-boot/2025-May/590101.html
> > > > >
> > > > > Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> > > > > Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> > > >
> > > > I think it's a tad early to disable this. On the U-Boot side, it's being
> > > > looked in to. In fact, you're saying v2025.04 is working (current
> > > > release) and v2025.07-rcX is failing. At this point in the U-Boot cycle
> > > > I think we'll figure out the problem and fix it. If we can't figure out
> > > > how to keep all the use cases working for v2025.07 then disabling
> > > > BLOBLIST here in OE can be thought on, I would expect. Thanks.
> > >
> > > 2025.04 is affected by this. My wording for this is not accurate enough, sorry.
> >
> > Do you have a known good version where it does work? I assume it's
> > v2025.01 that does work, and an OE-specific revert of commit
> > 53d5a221632e ("emulation: Use bloblist to hold tables") with appropriate
> > status tags about it being discussed upstream would make the most sense.
>
> As you suspected and Ilias bisected this to:
>
> 53d5a221632eeef7483d250fdde09bde6cb54df9 is the first bad commit
> commit 53d5a221632eeef7483d250fdde09bde6cb54df9
> Author: Simon Glass <sjg@chromium.org>
> Date:   Fri Jan 10 17:00:17 2025 -0700
>
>     emulation: Use bloblist to hold tables
>
>     QEMU can have its own internal ACPI and SMBIOS tables. At present U-Boot
>     copies out the SMBIOS tables but points directly to the ACPI ones.
>
>     The ACPI tables are not aligned on a 4KB boundary, which means that UPL
>     cannot use them directly, since it uses a reserved-memory node for the
>     tables and that it assumed (by EDK2) to be 4KB-aligned.
>
>     On x86, QEMU provides the tables in a mapped memory region and U-Boot
>     makes use of these directly, thus making it difficult to use any common
>     code.
>
>     Adjust the logic to fit within the existing table-generation code. Use a
>     bloblist always and ensure that the ACPI tables is placed in an aligned
>     region. Set a size of 8K for QEMU. This does not actually put all the
>     tables in one place, for QEMU, since it currently adds a pointer to the
>     tables in QFW.
>
>     On ARM, enable bloblist so that SMBIOS tables can be added to the
>     bloblist.
>
>     Signed-off-by: Simon Glass <sjg@chromium.org>
>
> So tags v2025.01-rc4 and earlier are fine and v2025.04-rc1 and newer
> are affected.
>
> Reverting this is a bit hard due to other changes so for oe-core it's
> easier to disable CONFIG_BLOBLIST where possible, on qemuarm64 and
> genericarm64 (uses same qemu defconfig) yocto target machines for
> example, which for testing purposes can be used with qemu and KVM.

So I had a closer look. It is affected by previous patches added for
BLOBLIST. The reason this one triggers it is because it
unconditionally enables BLOBLIST for qemu arm64.

I'll need a few more days on it, but I will have a proper fix

Cheers
/Ilias
>
> Cheers,
>
> -Mikko
diff mbox series

Patch

diff --git a/meta/recipes-bsp/u-boot/files/disable-CONFIG_BLOBLIST.cfg b/meta/recipes-bsp/u-boot/files/disable-CONFIG_BLOBLIST.cfg
new file mode 100644
index 0000000000..d01d3d12d8
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/files/disable-CONFIG_BLOBLIST.cfg
@@ -0,0 +1 @@ 
+# CONFIG_BLOBLIST is not set
diff --git a/meta/recipes-bsp/u-boot/u-boot-common.inc b/meta/recipes-bsp/u-boot/u-boot-common.inc
index fd1eab5cdd..a77c49cb8b 100644
--- a/meta/recipes-bsp/u-boot/u-boot-common.inc
+++ b/meta/recipes-bsp/u-boot/u-boot-common.inc
@@ -16,6 +16,10 @@  SRCREV = "34820924edbc4ec7803eb89d9852f4b870fa760a"
 
 SRC_URI = "git://source.denx.de/u-boot/u-boot.git;protocol=https;branch=master;tag=v${PV}"
 
+# workaround for aarch64 kvm qemu boot regression
+SRC_URI:append:qemuarm64 = " file://disable-CONFIG_BLOBLIST.cfg"
+SRC_URI:append:genericarm64 = " file://disable-CONFIG_BLOBLIST.cfg"
+
 S = "${WORKDIR}/git"
 B = "${WORKDIR}/build"