mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master 1/4] common: boards: qemu: read the command line from the cmdline fw_cfg key
@ 2026-08-31 13:24 Ahmad Fatoum
  2026-08-31 13:24 ` [PATCH master 2/4] efi: loader: fix EFI_EXIT2 tracing an uninitialized status Ahmad Fatoum
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ahmad Fatoum @ 2026-08-31 13:24 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

The /boot/qemu_fw_cfg script has a guard for /dev/fw_cfg.cmdline but reads
/dev/fw_cfg.initrd, so global.linux.bootargs.dyn.qemu ends up holding
initrd contents instead of the -append string.

Fixes: 67041eb8e505 ("common: boards: qemu: process some standard fw_cfg keys")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/boards/qemu/defaultenv-qemu_fw_cfg/boot/qemu_fw_cfg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/boards/qemu/defaultenv-qemu_fw_cfg/boot/qemu_fw_cfg b/common/boards/qemu/defaultenv-qemu_fw_cfg/boot/qemu_fw_cfg
index a3c12df67ff5..5c698f5a7352 100755
--- a/common/boards/qemu/defaultenv-qemu_fw_cfg/boot/qemu_fw_cfg
+++ b/common/boards/qemu/defaultenv-qemu_fw_cfg/boot/qemu_fw_cfg
@@ -7,6 +7,6 @@ if [ -s /dev/fw_cfg.initrd ]; then
 fi
 
 if [ -s /dev/fw_cfg.cmdline ]; then
-        readf /dev/fw_cfg.initrd qemu_fw_cfg_cmdline
+        readf /dev/fw_cfg.cmdline qemu_fw_cfg_cmdline
         global linux.bootargs.dyn.qemu="${qemu_fw_cfg_cmdline}"
 fi
-- 
2.47.3




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

* [PATCH master 2/4] efi: loader: fix EFI_EXIT2 tracing an uninitialized status
  2026-08-31 13:24 [PATCH master 1/4] common: boards: qemu: read the command line from the cmdline fw_cfg key Ahmad Fatoum
@ 2026-08-31 13:24 ` Ahmad Fatoum
  2026-08-31 13:24 ` [PATCH master 3/4] fs: efivarfs: initialize dummy data written on variable creation Ahmad Fatoum
  2026-08-31 13:24 ` [PATCH master 4/4] sandbox: actually build the assembly setjmp/longjmp/initjmp Ahmad Fatoum
  2 siblings, 0 replies; 4+ messages in thread
From: Ahmad Fatoum @ 2026-08-31 13:24 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

EFI_EXIT2() stores its argument in _r and passes that to EFI_EXIT(),
whose own _r shadows it, so typeof(_r) _r = _r reads the uninitialized
inner variable and the traced status is garbage.

This only affects trace output was and was detected by a warning when
being compiled with clang.

Fixes: c05e8108d769 ("efi: loader: add support for tracing calls back into UEFI")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 include/efi/loader/trace.h | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/include/efi/loader/trace.h b/include/efi/loader/trace.h
index 4acf7c1634cc..767812f84e26 100644
--- a/include/efi/loader/trace.h
+++ b/include/efi/loader/trace.h
@@ -34,24 +34,25 @@ const char *__efi_nesting_dec(void);
  */
 #ifndef EFI_EXIT
 #define EFI_EXIT(ret) ({ \
-	typeof(ret) _r = ret; \
+	typeof(ret) __efi_r = ret; \
 	__EFI_PRINT("%sEFI: Exit: %s: %s (%u)\n", __efi_nesting_dec(), \
-		__func__, efi_strerror((uintptr_t)_r), (u32)((uintptr_t) _r & ~EFI_ERROR_MASK)); \
-	_r; \
+		__func__, efi_strerror((uintptr_t)__efi_r), \
+		(u32)((uintptr_t) __efi_r & ~EFI_ERROR_MASK)); \
+	__efi_r; \
 	})
 #endif
 
 #ifndef EFI_EXIT2
 #define EFI_EXIT2(ret, val) ({ \
-	typeof(ret) _r = ret; \
-	if (EFI_ERROR(_r)) \
-		EFI_EXIT(_r); \
+	typeof(ret) __efi_r2 = ret; \
+	if (EFI_ERROR(__efi_r2)) \
+		EFI_EXIT(__efi_r2); \
 	else \
 		__EFI_PRINT("%sEFI: Exit: %s: %s (%u) = 0x%llx\n", __efi_nesting_dec(), \
-			__func__, efi_strerror((uintptr_t)_r), \
-			(u32)((uintptr_t) _r & ~EFI_ERROR_MASK), \
+			__func__, efi_strerror((uintptr_t)__efi_r2), \
+			(u32)((uintptr_t) __efi_r2 & ~EFI_ERROR_MASK), \
 			(u64)(uintptr_t)(val)); \
-	_r; \
+	__efi_r2; \
 	})
 #endif
 
-- 
2.47.3




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

* [PATCH master 3/4] fs: efivarfs: initialize dummy data written on variable creation
  2026-08-31 13:24 [PATCH master 1/4] common: boards: qemu: read the command line from the cmdline fw_cfg key Ahmad Fatoum
  2026-08-31 13:24 ` [PATCH master 2/4] efi: loader: fix EFI_EXIT2 tracing an uninitialized status Ahmad Fatoum
@ 2026-08-31 13:24 ` Ahmad Fatoum
  2026-08-31 13:24 ` [PATCH master 4/4] sandbox: actually build the assembly setjmp/longjmp/initjmp Ahmad Fatoum
  2 siblings, 0 replies; 4+ messages in thread
From: Ahmad Fatoum @ 2026-08-31 13:24 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Building with clang reports:

  error: variable 'dummydata' is uninitialized when passed as a
    const pointer argument here [-Werror,-Wuninitialized-const-pointer]

Fix this by initializing the variable.

Fixes: 46b5a6d6527f ("fs: efivars: implement write support")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 fs/efivarfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/efivarfs.c b/fs/efivarfs.c
index 1f53c06d66d3..b9f514c51cd9 100644
--- a/fs/efivarfs.c
+++ b/fs/efivarfs.c
@@ -58,7 +58,7 @@ static int efivars_create(struct device *dev, const char *pathname,
 	struct efivarfs_inode *inode;
 	efi_guid_t vendor;
 	efi_status_t efiret;
-	u8 dummydata;
+	u8 dummydata = 0;
 	char *name8;
 	s16 *name;
 	int ret;
-- 
2.47.3




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

* [PATCH master 4/4] sandbox: actually build the assembly setjmp/longjmp/initjmp
  2026-08-31 13:24 [PATCH master 1/4] common: boards: qemu: read the command line from the cmdline fw_cfg key Ahmad Fatoum
  2026-08-31 13:24 ` [PATCH master 2/4] efi: loader: fix EFI_EXIT2 tracing an uninitialized status Ahmad Fatoum
  2026-08-31 13:24 ` [PATCH master 3/4] fs: efivarfs: initialize dummy data written on variable creation Ahmad Fatoum
@ 2026-08-31 13:24 ` Ahmad Fatoum
  2 siblings, 0 replies; 4+ messages in thread
From: Ahmad Fatoum @ 2026-08-31 13:24 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

arch/sandbox/Makefile adds the host's um/ directory to pbl-y, but Kbuild
only consumes core-y from the arch Makefile, so the assembly
implementation selected by CONFIG_SANDBOX_SJLJ_ASM was lost.

Use core-y, so the assembly version overrides the weak C one.

Fixes: 48d0d0cc28ed ("kbuild: sync with Linux v6.17")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/sandbox/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
index 08e09c53f7ef..cd11083e4deb 100644
--- a/arch/sandbox/Makefile
+++ b/arch/sandbox/Makefile
@@ -25,7 +25,7 @@ HOST_DIR := arch/$(HEADER_ARCH)
 
 -include $(srctree)/$(HOST_DIR)/Makefile.um
 
-pbl-y += $(HOST_DIR)/um/
+core-y += $(HOST_DIR)/um/
 
 KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/include
 
-- 
2.47.3




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

end of thread, other threads:[~2026-08-31 13:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-31 13:24 [PATCH master 1/4] common: boards: qemu: read the command line from the cmdline fw_cfg key Ahmad Fatoum
2026-08-31 13:24 ` [PATCH master 2/4] efi: loader: fix EFI_EXIT2 tracing an uninitialized status Ahmad Fatoum
2026-08-31 13:24 ` [PATCH master 3/4] fs: efivarfs: initialize dummy data written on variable creation Ahmad Fatoum
2026-08-31 13:24 ` [PATCH master 4/4] sandbox: actually build the assembly setjmp/longjmp/initjmp Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox