[Concept,1/1] bloblist: adjust default bloblist size after reloc

Message ID 20251028094536.43676-1-heinrich.schuchardt@canonical.com
State New
Headers
Series [Concept,1/1] bloblist: adjust default bloblist size after reloc |

Commit Message

Heinrich Schuchardt Oct. 28, 2025, 9:45 a.m. UTC
  If neither CONFIG_BLOBLIST_FIXED NOR CONFIG_BLOBLIST_ALLOC is set,
currently CONFIG_BLOBLIST_SIZE_RELOC defaults to 0 except if
* CONFIG_ARM=y && CONFIG_EFI_LOADER=y && GENERATE_ACPI_TABLE=y.

A size of zero never makes sense for a bloblist.

When using QFW we need more than 64 KiB to host the ACPI table.
In this case CONFIG_BLOBLIST_ALLOC is used.

Set a reasonable default.

Remove the CONFIG_BLOBLIST_SIZE_RELOC in ARM QEMU defconfigs which are
not compatible with ACPI tables passed from QEMU.

Fixes: 6f9b015c138b ("common: Enable BLOBLIST_TABLES on arm")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 common/Kconfig               | 4 ++--
 configs/qemu_arm64_defconfig | 1 -
 configs/qemu_arm_defconfig   | 1 -
 3 files changed, 2 insertions(+), 4 deletions(-)
  

Comments

Simon Glass Oct. 30, 2025, 8:53 a.m. UTC | #1
Hi Heinrich,

On Tue, 28 Oct 2025 at 10:45, Heinrich Schuchardt
<heinrich.schuchardt@canonical.com> wrote:
>
> If neither CONFIG_BLOBLIST_FIXED NOR CONFIG_BLOBLIST_ALLOC is set,
> currently CONFIG_BLOBLIST_SIZE_RELOC defaults to 0 except if
> * CONFIG_ARM=y && CONFIG_EFI_LOADER=y && GENERATE_ACPI_TABLE=y.
>
> A size of zero never makes sense for a bloblist.
>
> When using QFW we need more than 64 KiB to host the ACPI table.
> In this case CONFIG_BLOBLIST_ALLOC is used.
>
> Set a reasonable default.
>
> Remove the CONFIG_BLOBLIST_SIZE_RELOC in ARM QEMU defconfigs which are
> not compatible with ACPI tables passed from QEMU.
>
> Fixes: 6f9b015c138b ("common: Enable BLOBLIST_TABLES on arm")
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>  common/Kconfig               | 4 ++--
>  configs/qemu_arm64_defconfig | 1 -
>  configs/qemu_arm_defconfig   | 1 -
>  3 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/common/Kconfig b/common/Kconfig
> index 3bd11f44c51..1665d34fac5 100644
> --- a/common/Kconfig
> +++ b/common/Kconfig
> @@ -1129,8 +1129,8 @@ config BLOBLIST_SIZE
>
>  config BLOBLIST_SIZE_RELOC
>         hex "Size of bloblist after relocation"
> -       default BLOBLIST_SIZE if BLOBLIST_FIXED || BLOBLIST_ALLOC
> -       default 0x20000 if (ARM && EFI_LOADER && GENERATE_ACPI_TABLE)
> +       default BLOBLIST_SIZE if BLOBLIST_FIXED
> +       default 0x20000

Why not use BLOBLIST_SIZE when BLOBLIST_ALLOC is used? There would
normally be no need to expand it.

Perhaps we should use 128K only if ACPI is enabled?

>         help
>           Sets the size of the bloblist in bytes after relocation. Since U-Boot
>           has a lot more memory available then, it is possible to use a larger
> diff --git a/configs/qemu_arm64_defconfig b/configs/qemu_arm64_defconfig
> index e6555b6d3d3..4fff61d7675 100644
> --- a/configs/qemu_arm64_defconfig
> +++ b/configs/qemu_arm64_defconfig
> @@ -2,7 +2,6 @@ CONFIG_ARM=y
>  CONFIG_POSITION_INDEPENDENT=y
>  CONFIG_ARCH_QEMU_ARM=y
>  CONFIG_SYS_MALLOC_LEN=0x1000000
> -CONFIG_BLOBLIST_SIZE_RELOC=0x2000
>  CONFIG_NR_DRAM_BANKS=1
>  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x40200000
>  CONFIG_ENV_SIZE=0x40000
> diff --git a/configs/qemu_arm_defconfig b/configs/qemu_arm_defconfig
> index 22781226efb..50046e2fbf2 100644
> --- a/configs/qemu_arm_defconfig
> +++ b/configs/qemu_arm_defconfig
> @@ -2,7 +2,6 @@ CONFIG_ARM=y
>  CONFIG_ARM_SMCCC=y
>  CONFIG_ARCH_QEMU_ARM=y
>  CONFIG_SYS_MALLOC_LEN=0x1000000
> -CONFIG_BLOBLIST_SIZE_RELOC=0x2000
>  CONFIG_NR_DRAM_BANKS=1
>  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x40200000
>  CONFIG_ENV_SIZE=0x40000
> --
> 2.51.0
>

Regards,
Simon
  
Heinrich Schuchardt Oct. 30, 2025, 9:52 a.m. UTC | #2
On 10/30/25 09:53, Simon Glass wrote:
> Hi Heinrich,
> 
> On Tue, 28 Oct 2025 at 10:45, Heinrich Schuchardt
> <heinrich.schuchardt@canonical.com> wrote:
>>
>> If neither CONFIG_BLOBLIST_FIXED NOR CONFIG_BLOBLIST_ALLOC is set,
>> currently CONFIG_BLOBLIST_SIZE_RELOC defaults to 0 except if
>> * CONFIG_ARM=y && CONFIG_EFI_LOADER=y && GENERATE_ACPI_TABLE=y.
>>
>> A size of zero never makes sense for a bloblist.
>>
>> When using QFW we need more than 64 KiB to host the ACPI table.
>> In this case CONFIG_BLOBLIST_ALLOC is used.
>>
>> Set a reasonable default.
>>
>> Remove the CONFIG_BLOBLIST_SIZE_RELOC in ARM QEMU defconfigs which are
>> not compatible with ACPI tables passed from QEMU.
>>
>> Fixes: 6f9b015c138b ("common: Enable BLOBLIST_TABLES on arm")
>> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
>> ---
>>   common/Kconfig               | 4 ++--
>>   configs/qemu_arm64_defconfig | 1 -
>>   configs/qemu_arm_defconfig   | 1 -
>>   3 files changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/common/Kconfig b/common/Kconfig
>> index 3bd11f44c51..1665d34fac5 100644
>> --- a/common/Kconfig
>> +++ b/common/Kconfig
>> @@ -1129,8 +1129,8 @@ config BLOBLIST_SIZE
>>
>>   config BLOBLIST_SIZE_RELOC
>>          hex "Size of bloblist after relocation"
>> -       default BLOBLIST_SIZE if BLOBLIST_FIXED || BLOBLIST_ALLOC
>> -       default 0x20000 if (ARM && EFI_LOADER && GENERATE_ACPI_TABLE)
>> +       default BLOBLIST_SIZE if BLOBLIST_FIXED
>> +       default 0x20000
> 
> Why not use BLOBLIST_SIZE when BLOBLIST_ALLOC is used? There would
> normally be no need to expand it.
> 
> Perhaps we should use 128K only if ACPI is enabled?

Thanks for reviewing.

This patch has been merged in upstream U-Boot.
559f11e66cf7 ("bloblist: adjust default bloblist size after reloc")

If you have better ideas how to keep qemu-riscv64_smode_acpi building, 
please, contribute this upstreams. We should avoid a delta here.

Best regards

Heinrich

> 
>>          help
>>            Sets the size of the bloblist in bytes after relocation. Since U-Boot
>>            has a lot more memory available then, it is possible to use a larger
>> diff --git a/configs/qemu_arm64_defconfig b/configs/qemu_arm64_defconfig
>> index e6555b6d3d3..4fff61d7675 100644
>> --- a/configs/qemu_arm64_defconfig
>> +++ b/configs/qemu_arm64_defconfig
>> @@ -2,7 +2,6 @@ CONFIG_ARM=y
>>   CONFIG_POSITION_INDEPENDENT=y
>>   CONFIG_ARCH_QEMU_ARM=y
>>   CONFIG_SYS_MALLOC_LEN=0x1000000
>> -CONFIG_BLOBLIST_SIZE_RELOC=0x2000
>>   CONFIG_NR_DRAM_BANKS=1
>>   CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x40200000
>>   CONFIG_ENV_SIZE=0x40000
>> diff --git a/configs/qemu_arm_defconfig b/configs/qemu_arm_defconfig
>> index 22781226efb..50046e2fbf2 100644
>> --- a/configs/qemu_arm_defconfig
>> +++ b/configs/qemu_arm_defconfig
>> @@ -2,7 +2,6 @@ CONFIG_ARM=y
>>   CONFIG_ARM_SMCCC=y
>>   CONFIG_ARCH_QEMU_ARM=y
>>   CONFIG_SYS_MALLOC_LEN=0x1000000
>> -CONFIG_BLOBLIST_SIZE_RELOC=0x2000
>>   CONFIG_NR_DRAM_BANKS=1
>>   CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x40200000
>>   CONFIG_ENV_SIZE=0x40000
>> --
>> 2.51.0
>>
> 
> Regards,
> Simon
  
Simon Glass Oct. 30, 2025, 3:30 p.m. UTC | #3
Hi Heinrich,

On Thu, 30 Oct 2025 at 10:53, Heinrich Schuchardt
<heinrich.schuchardt@canonical.com> wrote:
>
> On 10/30/25 09:53, Simon Glass wrote:
> > Hi Heinrich,
> >
> > On Tue, 28 Oct 2025 at 10:45, Heinrich Schuchardt
> > <heinrich.schuchardt@canonical.com> wrote:
> >>
> >> If neither CONFIG_BLOBLIST_FIXED NOR CONFIG_BLOBLIST_ALLOC is set,
> >> currently CONFIG_BLOBLIST_SIZE_RELOC defaults to 0 except if
> >> * CONFIG_ARM=y && CONFIG_EFI_LOADER=y && GENERATE_ACPI_TABLE=y.
> >>
> >> A size of zero never makes sense for a bloblist.
> >>
> >> When using QFW we need more than 64 KiB to host the ACPI table.
> >> In this case CONFIG_BLOBLIST_ALLOC is used.
> >>
> >> Set a reasonable default.
> >>
> >> Remove the CONFIG_BLOBLIST_SIZE_RELOC in ARM QEMU defconfigs which are
> >> not compatible with ACPI tables passed from QEMU.
> >>
> >> Fixes: 6f9b015c138b ("common: Enable BLOBLIST_TABLES on arm")
> >> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> >> ---
> >>   common/Kconfig               | 4 ++--
> >>   configs/qemu_arm64_defconfig | 1 -
> >>   configs/qemu_arm_defconfig   | 1 -
> >>   3 files changed, 2 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/common/Kconfig b/common/Kconfig
> >> index 3bd11f44c51..1665d34fac5 100644
> >> --- a/common/Kconfig
> >> +++ b/common/Kconfig
> >> @@ -1129,8 +1129,8 @@ config BLOBLIST_SIZE
> >>
> >>   config BLOBLIST_SIZE_RELOC
> >>          hex "Size of bloblist after relocation"
> >> -       default BLOBLIST_SIZE if BLOBLIST_FIXED || BLOBLIST_ALLOC
> >> -       default 0x20000 if (ARM && EFI_LOADER && GENERATE_ACPI_TABLE)
> >> +       default BLOBLIST_SIZE if BLOBLIST_FIXED
> >> +       default 0x20000
> >
> > Why not use BLOBLIST_SIZE when BLOBLIST_ALLOC is used? There would
> > normally be no need to expand it.
> >
> > Perhaps we should use 128K only if ACPI is enabled?
>
> Thanks for reviewing.
>
> This patch has been merged in upstream U-Boot.
> 559f11e66cf7 ("bloblist: adjust default bloblist size after reloc")
>
> If you have better ideas how to keep qemu-riscv64_smode_acpi building,
> please, contribute this upstreams. We should avoid a delta here.

Well my point isn't very important, so let's just use this.

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

>
> Best regards
>
> Heinrich
>
> >
> >>          help
> >>            Sets the size of the bloblist in bytes after relocation. Since U-Boot
> >>            has a lot more memory available then, it is possible to use a larger
> >> diff --git a/configs/qemu_arm64_defconfig b/configs/qemu_arm64_defconfig
> >> index e6555b6d3d3..4fff61d7675 100644
> >> --- a/configs/qemu_arm64_defconfig
> >> +++ b/configs/qemu_arm64_defconfig
> >> @@ -2,7 +2,6 @@ CONFIG_ARM=y
> >>   CONFIG_POSITION_INDEPENDENT=y
> >>   CONFIG_ARCH_QEMU_ARM=y
> >>   CONFIG_SYS_MALLOC_LEN=0x1000000
> >> -CONFIG_BLOBLIST_SIZE_RELOC=0x2000
> >>   CONFIG_NR_DRAM_BANKS=1
> >>   CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x40200000
> >>   CONFIG_ENV_SIZE=0x40000
> >> diff --git a/configs/qemu_arm_defconfig b/configs/qemu_arm_defconfig
> >> index 22781226efb..50046e2fbf2 100644
> >> --- a/configs/qemu_arm_defconfig
> >> +++ b/configs/qemu_arm_defconfig
> >> @@ -2,7 +2,6 @@ CONFIG_ARM=y
> >>   CONFIG_ARM_SMCCC=y
> >>   CONFIG_ARCH_QEMU_ARM=y
> >>   CONFIG_SYS_MALLOC_LEN=0x1000000
> >> -CONFIG_BLOBLIST_SIZE_RELOC=0x2000
> >>   CONFIG_NR_DRAM_BANKS=1
> >>   CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x40200000
> >>   CONFIG_ENV_SIZE=0x40000
> >> --
> >> 2.51.0
> >>
> >
> > Regards,
> > Simon
>
  

Patch

diff --git a/common/Kconfig b/common/Kconfig
index 3bd11f44c51..1665d34fac5 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1129,8 +1129,8 @@  config BLOBLIST_SIZE
 
 config BLOBLIST_SIZE_RELOC
 	hex "Size of bloblist after relocation"
-	default BLOBLIST_SIZE if BLOBLIST_FIXED || BLOBLIST_ALLOC
-	default 0x20000 if (ARM && EFI_LOADER && GENERATE_ACPI_TABLE)
+	default BLOBLIST_SIZE if BLOBLIST_FIXED
+	default 0x20000
 	help
 	  Sets the size of the bloblist in bytes after relocation. Since U-Boot
 	  has a lot more memory available then, it is possible to use a larger
diff --git a/configs/qemu_arm64_defconfig b/configs/qemu_arm64_defconfig
index e6555b6d3d3..4fff61d7675 100644
--- a/configs/qemu_arm64_defconfig
+++ b/configs/qemu_arm64_defconfig
@@ -2,7 +2,6 @@  CONFIG_ARM=y
 CONFIG_POSITION_INDEPENDENT=y
 CONFIG_ARCH_QEMU_ARM=y
 CONFIG_SYS_MALLOC_LEN=0x1000000
-CONFIG_BLOBLIST_SIZE_RELOC=0x2000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x40200000
 CONFIG_ENV_SIZE=0x40000
diff --git a/configs/qemu_arm_defconfig b/configs/qemu_arm_defconfig
index 22781226efb..50046e2fbf2 100644
--- a/configs/qemu_arm_defconfig
+++ b/configs/qemu_arm_defconfig
@@ -2,7 +2,6 @@  CONFIG_ARM=y
 CONFIG_ARM_SMCCC=y
 CONFIG_ARCH_QEMU_ARM=y
 CONFIG_SYS_MALLOC_LEN=0x1000000
-CONFIG_BLOBLIST_SIZE_RELOC=0x2000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x40200000
 CONFIG_ENV_SIZE=0x40000