x86: efi_loader: Ensure the SMBIOS tables are sent via EFI
PATCH 1/1 x86: efi_loader: Ensure the SMBIOS tables are sent via EFI
The EFI-loader code has not been fully converted to use bloblist, so relies on the SMBIOS-table address being set in global_data.
Set this up in write_tables() so that the SMBIOS tables are actually available.
Enable the command for x86 QEMU so that the SMBIOS tests actually run.
---
arch/x86/lib/tables.c | 2 ++ board/emulation/qemu-x86/Kconfig | 1 + lib/efi_loader/efi_smbios.c | 1 + 3 files changed, 4 insertions(+)
arch/x86/lib/tables.c +2 -0
@@ -126,6 +126,8 @@ int write_tables(void) use_high = true;if (!gd->arch.table_start_high) gd->arch.table_start_high = rom_addr; +if (table->tag ==BLOBLISTT_SMBIOS_TABLES ) +gd_set_smbios_start (rom_addr); } rom_table_end = table->write (rom_addr);if (!rom_table_end) {
board/emulation/qemu-x86/Kconfig +1 -0
@@ -23,5 +23,6 @@ config BOARD_SPECIFIC_OPTIONS # dummy imply VIRTIO_PCI imply VIRTIO_NET imply VIRTIO_BLK + imply CMD_SMBIOS endif
lib/efi_loader/efi_smbios.c +1 -0
@@ -35,6 +35,7 @@ efi_status_t efi_smbios_register(void)void *buf; addr =gd_smbios_start (); +printf ("register %lx\n" , addr);if (!addr) {log_err ("No SMBIOS tables to install\n" );return EFI_NOT_FOUND ;
Signature · 1 line
2.43.0
Hi Simon
Quoted 3 lines · Simon Glass
The EFI-loader code has not been fully converted to use bloblist, so relies on the SMBIOS-table address being set in
global_data.
Can you explain a bit more what this means? The SMBIOS tables for EFI are supposed to be on EFI allocated memory
Quoted 45 lines
Set this up in
write_tables()so that the SMBIOS tables are actually available.Enable the command for x86 QEMU so that the SMBIOS tests actually run.
Signed-off-by Simon Glass <[email protected]>Fixes 83ce35d6ebb ("emulation: Use bloblist to hold tables")Reported-by Niklas Sombert <[email protected]>---
arch/x86/lib/tables.c | 2 ++ board/emulation/qemu-x86/Kconfig | 1 + lib/efi_loader/efi_smbios.c | 1 + 3 files changed, 4 insertions(+)arch/x86/lib/tables.c +2
-0@@ -126,6 +126,8 @@ int write_tables(void) use_high = true;if (!gd->arch.table_start_high) gd->arch.table_start_high = rom_addr; +if (table->tag ==BLOBLISTT_SMBIOS_TABLES ) +gd_set_smbios_start (rom_addr); } rom_table_end = table->write (rom_addr);if (!rom_table_end) {board/emulation/qemu-x86/Kconfig +1
-0@@ -23,5 +23,6 @@ config BOARD_SPECIFIC_OPTIONS # dummy imply VIRTIO_PCI imply VIRTIO_NET imply VIRTIO_BLK + imply CMD_SMBIOS endiflib/efi_loader/efi_smbios.c +0
-0
lib/efi_loader/efi_smbios.c efi_status_t efi_smbios_register(void) · line 38
Quoted 4 lines
lib/efi_loader/efi_smbios.c +1
-0@@ -35,6 +35,7 @@ efi_status_t efi_smbios_register(void)void *buf; addr =gd_smbios_start (); +printf ("register %lx\n" , addr);
I don't think this print is useful at all, why isn't the log_err() right below enough?
Quoted 6 lines
lib/efi_loader/efi_smbios.c +0
-1if (!addr) {log_err ("No SMBIOS tables to install\n" );return EFI_NOT_FOUND ; --2.43.0
Thanks
/Ilias
Quoted 57 lines · Ilias Apalodimas
Hi Simon
Quoted 3 lines · Simon Glass
The EFI-loader code has not been fully converted to use bloblist, so relies on the SMBIOS-table address being set in
global_data.Can you explain a bit more what this means? The SMBIOS tables for EFI are supposed to be on EFI allocated memory
Quoted 47 lines
Set this up in
write_tables()so that the SMBIOS tables are actually available.Enable the command for x86 QEMU so that the SMBIOS tests actually run.
Signed-off-by Simon Glass <[email protected]>Fixes 83ce35d6ebb ("emulation: Use bloblist to hold tables")Reported-by Niklas Sombert <[email protected]>---
arch/x86/lib/tables.c | 2 ++ board/emulation/qemu-x86/Kconfig | 1 + lib/efi_loader/efi_smbios.c | 1 + 3 files changed, 4 insertions(+)arch/x86/lib/tables.c +2
-0@@ -126,6 +126,8 @@ int write_tables(void) use_high = true;if (!gd->arch.table_start_high) gd->arch.table_start_high = rom_addr; +if (table->tag ==BLOBLISTT_SMBIOS_TABLES ) +gd_set_smbios_start (rom_addr); } rom_table_end = table->write (rom_addr);if (!rom_table_end) {board/emulation/qemu-x86/Kconfig +1
-0@@ -23,5 +23,6 @@ config BOARD_SPECIFIC_OPTIONS # dummy imply VIRTIO_PCI imply VIRTIO_NET imply VIRTIO_BLK + imply CMD_SMBIOS endiflib/efi_loader/efi_smbios.c +0
-0@@ -35,6 +35,7 @@ efi_status_t efi_smbios_register(void)void *buf;
Quoted 2 lines
lib/efi_loader/efi_smbios.c efi_status_t efi_smbios_register(void) · line 38
Quoted 2 lines
lib/efi_loader/efi_smbios.c +1
-0addr =gd_smbios_start (); +printf ("register %lx\n" , addr);
User will not know what "register" relates to.
log_debug() with a meaningful message in the else branch of the if statement below would be acceptable.
Best regards
Heinrich
Quoted 13 lines
I don't think this print is useful at all, why isn't the
log_err()right below enough?Quoted 6 lines
lib/efi_loader/efi_smbios.c +0
-1if (!addr) {log_err ("No SMBIOS tables to install\n" );return EFI_NOT_FOUND ; --2.43.0
Thanks
/Ilias
Hi Ilias,
Quoted 9 lines · Ilias Apalodimas
Hi Simon
Quoted 3 lines · Simon Glass
The EFI-loader code has not been fully converted to use bloblist, so relies on the SMBIOS-table address being set in
global_data.Can you explain a bit more what this means?
It means that the EFI-loader code is still using gd->arch.smbios_start to find the SMBIOS table. At some point we should move it to use bloblist_get_blob().
Quoted 2 lines
The SMBIOS tables for EFI
are supposed to be on EFI allocated memory
Not allocated by EFI, just added to the EFI memory map. See efi_smbios_register(). We still want to support SMBIOS tables if not booting with EFI.
Quoted 48 lines
Quoted 48 lines
Set this up in
write_tables()so that the SMBIOS tables are actually available.Enable the command for x86 QEMU so that the SMBIOS tests actually run.
Signed-off-by Simon Glass <[email protected]>Fixes 83ce35d6ebb ("emulation: Use bloblist to hold tables")Reported-by Niklas Sombert <[email protected]>---
arch/x86/lib/tables.c | 2 ++ board/emulation/qemu-x86/Kconfig | 1 + lib/efi_loader/efi_smbios.c | 1 + 3 files changed, 4 insertions(+)arch/x86/lib/tables.c +2
-0@@ -126,6 +126,8 @@ int write_tables(void) use_high = true;if (!gd->arch.table_start_high) gd->arch.table_start_high = rom_addr; +if (table->tag ==BLOBLISTT_SMBIOS_TABLES ) +gd_set_smbios_start (rom_addr); } rom_table_end = table->write (rom_addr);if (!rom_table_end) {board/emulation/qemu-x86/Kconfig +1
-0@@ -23,5 +23,6 @@ config BOARD_SPECIFIC_OPTIONS # dummy imply VIRTIO_PCI imply VIRTIO_NET imply VIRTIO_BLK + imply CMD_SMBIOS endiflib/efi_loader/efi_smbios.c +0
-0@@ -35,6 +35,7 @@ efi_status_t efi_smbios_register(void)void *buf;
Quoted 5 lines
lib/efi_loader/efi_smbios.c efi_status_t efi_smbios_register(void) · line 38
Quoted 2 lines
lib/efi_loader/efi_smbios.c +1
-0addr =gd_smbios_start (); +printf ("register %lx\n" , addr);I don't think this print is useful at all, why isn't the
log_err()right below enough?
This was left in inadvertently and should be removed.
Quoted 8 lines
Quoted 7 lines
lib/efi_loader/efi_smbios.c +0
-1if (!addr) {log_err ("No SMBIOS tables to install\n" );return EFI_NOT_FOUND ; --2.43.0
Regards,
Simon
Hi Simon,
this solves my problem, thanks!
Since SMBIOS is broken again in v2025.07-rc1 (and disabling bloblist doesn't work anymore), I applied this patch and it worked. I probably should have tried this sooner.
Greetings,
Niklas
Quoted 54 lines · Simon Glass
The EFI-loader code has not been fully converted to use bloblist, so relies on the SMBIOS-table address being set in
global_data.Set this up in
write_tables()so that the SMBIOS tables are actually available.Enable the command for x86 QEMU so that the SMBIOS tests actually run.
Signed-off-by Simon Glass <[email protected]>Fixes 83ce35d6ebb ("emulation: Use bloblist to hold tables")Reported-by Niklas Sombert <[email protected]>---
arch/x86/lib/tables.c | 2 ++ board/emulation/qemu-x86/Kconfig | 1 + lib/efi_loader/efi_smbios.c | 1 + 3 files changed, 4 insertions(+)arch/x86/lib/tables.c +2
-0@@ -126,6 +126,8 @@ int write_tables(void) use_high = true;if (!gd->arch.table_start_high) gd->arch.table_start_high = rom_addr; +if (table->tag ==BLOBLISTT_SMBIOS_TABLES ) +gd_set_smbios_start (rom_addr); } rom_table_end = table->write (rom_addr);if (!rom_table_end) {board/emulation/qemu-x86/Kconfig +1
-0@@ -23,5 +23,6 @@ config BOARD_SPECIFIC_OPTIONS # dummy imply VIRTIO_PCI imply VIRTIO_NET imply VIRTIO_BLK + imply CMD_SMBIOS endiflib/efi_loader/efi_smbios.c +1
-0@@ -35,6 +35,7 @@ efi_status_t efi_smbios_register(void)void *buf; addr =gd_smbios_start (); +printf ("register %lx\n" , addr);if (!addr) {log_err ("No SMBIOS tables to install\n" );return EFI_NOT_FOUND ;
Hi Niklas,
Quoted 8 lines · Niklas Sombert
Hi Simon,
this solves my problem, thanks!
Since SMBIOS is broken again in v2025.07-rc1 (and disabling bloblist doesn't work anymore), I applied this patch and it worked. I probably should have tried this sooner.
Thanks for testing this. Can you please reply with a 'Tested-by' tag?
Regards,
Simon
Quoted 60 lines
Greetings,
NiklasQuoted 54 lines · Simon Glass
The EFI-loader code has not been fully converted to use bloblist, so relies on the SMBIOS-table address being set in
global_data.Set this up in
write_tables()so that the SMBIOS tables are actually available.Enable the command for x86 QEMU so that the SMBIOS tests actually run.
Signed-off-by Simon Glass <[email protected]>Fixes 83ce35d6ebb ("emulation: Use bloblist to hold tables")Reported-by Niklas Sombert <[email protected]>---
arch/x86/lib/tables.c | 2 ++ board/emulation/qemu-x86/Kconfig | 1 + lib/efi_loader/efi_smbios.c | 1 + 3 files changed, 4 insertions(+)arch/x86/lib/tables.c +2
-0@@ -126,6 +126,8 @@ int write_tables(void) use_high = true;if (!gd->arch.table_start_high) gd->arch.table_start_high = rom_addr; +if (table->tag ==BLOBLISTT_SMBIOS_TABLES ) +gd_set_smbios_start (rom_addr); } rom_table_end = table->write (rom_addr);if (!rom_table_end) {board/emulation/qemu-x86/Kconfig +1
-0@@ -23,5 +23,6 @@ config BOARD_SPECIFIC_OPTIONS # dummy imply VIRTIO_PCI imply VIRTIO_NET imply VIRTIO_BLK + imply CMD_SMBIOS endiflib/efi_loader/efi_smbios.c +1
-0@@ -35,6 +35,7 @@ efi_status_t efi_smbios_register(void)void *buf; addr =gd_smbios_start (); +printf ("register %lx\n" , addr);if (!addr) {log_err ("No SMBIOS tables to install\n" );return EFI_NOT_FOUND ;
Niklas Sombert
Tested-byQuoted 1 line · Simon Glass
Thanks for testing this. Can you please reply with a 'Tested-by' tag?
Sure.