All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] cmd/bootefi.c:285:3: error: ‘loaded_image_info’ undeclared
@ 2017-09-20 18:42 Heinrich Schuchardt
  2017-09-20 19:14 ` [U-Boot] [PATCH 1/1] efi_selftest: enable CONFIG_CMD_BOOTEFI_SELFTEST Heinrich Schuchardt
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Heinrich Schuchardt @ 2017-09-20 18:42 UTC (permalink / raw)
  To: u-boot

Hello Rob, hello Alex,

when I try to compile efi-next I get

  CC      cmd/bootefi.o
cmd/bootefi.c: In function ‘do_bootefi’:
cmd/bootefi.c:285:3: error: ‘loaded_image_info’ undeclared (first use in
this function)
   loaded_image_info.device_handle = bootefi_device_path;
   ^~~~~~~~~~~~~~~~~
cmd/bootefi.c:285:3: note: each undeclared identifier is reported only
once for each function it appears in
scripts/Makefile.build:280: recipe for target 'cmd/bootefi.o' failed
make[3]: *** [cmd/bootefi.o] Error 1
Makefile:1279: recipe for target 'cmd' failed

when compiling with CONFIG_CMD_BOOTEFI_SELFTEST=y.

I guess we should enable this option in qemu-x86_defconfig to make such
errors visible in Travis CI.

This seems to be the problematic patch:
ad503ffe9c6: efi_loader: refactor boot device and loaded_image handling

Best regards

Heinrich

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

* [U-Boot] [PATCH 1/1] efi_selftest: enable CONFIG_CMD_BOOTEFI_SELFTEST
  2017-09-20 18:42 [U-Boot] cmd/bootefi.c:285:3: error: ‘loaded_image_info’ undeclared Heinrich Schuchardt
@ 2017-09-20 19:14 ` Heinrich Schuchardt
  2017-09-25  2:13   ` Simon Glass
  2017-09-20 19:46 ` [U-Boot] [PATCH 1/1] efi_loader: reenable selftest Heinrich Schuchardt
  2017-09-20 20:29 ` [U-Boot] cmd/bootefi.c:285:3: error: ‘loaded_image_info’ undeclared Rob Clark
  2 siblings, 1 reply; 9+ messages in thread
From: Heinrich Schuchardt @ 2017-09-20 19:14 UTC (permalink / raw)
  To: u-boot

The EFI selftest has been broken by a patch on efi-next.
We should enable CONFIG_CMD_BOOTEFI_SELFTEST on
qemu-x86_defconfig and qemu-x86_64_defconfig by default
to catch this type of problem in the Travis CI tests.

These systems typically have abundant memory so that
enabling this option should not pose a problem.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 configs/qemu-x86_64_defconfig | 1 +
 configs/qemu-x86_defconfig    | 1 +
 2 files changed, 2 insertions(+)

diff --git a/configs/qemu-x86_64_defconfig b/configs/qemu-x86_64_defconfig
index 67e9a45fbc..c12d530b83 100644
--- a/configs/qemu-x86_64_defconfig
+++ b/configs/qemu-x86_64_defconfig
@@ -64,3 +64,4 @@ CONFIG_USB_KEYBOARD=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_111=y
 CONFIG_CONSOLE_SCROLL_LINES=5
+CONFIG_CMD_BOOTEFI_SELFTEST=y
diff --git a/configs/qemu-x86_defconfig b/configs/qemu-x86_defconfig
index 7ce97ff091..d84e1d7dc9 100644
--- a/configs/qemu-x86_defconfig
+++ b/configs/qemu-x86_defconfig
@@ -44,3 +44,4 @@ CONFIG_USB_KEYBOARD=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_111=y
 CONFIG_CONSOLE_SCROLL_LINES=5
+CONFIG_CMD_BOOTEFI_SELFTEST=y
-- 
2.14.1

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

* [U-Boot] [PATCH 1/1] efi_loader: reenable selftest
  2017-09-20 18:42 [U-Boot] cmd/bootefi.c:285:3: error: ‘loaded_image_info’ undeclared Heinrich Schuchardt
  2017-09-20 19:14 ` [U-Boot] [PATCH 1/1] efi_selftest: enable CONFIG_CMD_BOOTEFI_SELFTEST Heinrich Schuchardt
@ 2017-09-20 19:46 ` Heinrich Schuchardt
  2017-09-20 20:31   ` Rob Clark
  2017-09-20 20:29 ` [U-Boot] cmd/bootefi.c:285:3: error: ‘loaded_image_info’ undeclared Rob Clark
  2 siblings, 1 reply; 9+ messages in thread
From: Heinrich Schuchardt @ 2017-09-20 19:46 UTC (permalink / raw)
  To: u-boot

ad503ffe9c6 efi_loader: refactor boot device and loaded_image handling
leads to an error when building with CONFIG_CMD_BOOTEFI_SELFTEST=y
This patch fixes the problem.

Fixes: ad503ffe9c6 efi_loader: refactor boot device and loaded_image handling
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 cmd/bootefi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 1e2dbcc4a4..9460747f96 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -273,6 +273,8 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #endif
 #ifdef CONFIG_CMD_BOOTEFI_SELFTEST
 	if (!strcmp(argv[1], "selftest")) {
+		struct efi_loaded_image loaded_image_info = {};
+
 		/*
 		 * gd lives in a fixed register which may get clobbered while we
 		 * execute the payload. So save it here and restore it on every
-- 
2.14.1

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

* [U-Boot] cmd/bootefi.c:285:3: error: ‘loaded_image_info’ undeclared
  2017-09-20 18:42 [U-Boot] cmd/bootefi.c:285:3: error: ‘loaded_image_info’ undeclared Heinrich Schuchardt
  2017-09-20 19:14 ` [U-Boot] [PATCH 1/1] efi_selftest: enable CONFIG_CMD_BOOTEFI_SELFTEST Heinrich Schuchardt
  2017-09-20 19:46 ` [U-Boot] [PATCH 1/1] efi_loader: reenable selftest Heinrich Schuchardt
@ 2017-09-20 20:29 ` Rob Clark
  2 siblings, 0 replies; 9+ messages in thread
From: Rob Clark @ 2017-09-20 20:29 UTC (permalink / raw)
  To: u-boot

On Wed, Sep 20, 2017 at 2:42 PM, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> Hello Rob, hello Alex,
>
> when I try to compile efi-next I get
>
>   CC      cmd/bootefi.o
> cmd/bootefi.c: In function ‘do_bootefi’:
> cmd/bootefi.c:285:3: error: ‘loaded_image_info’ undeclared (first use in
> this function)
>    loaded_image_info.device_handle = bootefi_device_path;
>    ^~~~~~~~~~~~~~~~~
> cmd/bootefi.c:285:3: note: each undeclared identifier is reported only
> once for each function it appears in
> scripts/Makefile.build:280: recipe for target 'cmd/bootefi.o' failed
> make[3]: *** [cmd/bootefi.o] Error 1
> Makefile:1279: recipe for target 'cmd' failed
>
> when compiling with CONFIG_CMD_BOOTEFI_SELFTEST=y.
>
> I guess we should enable this option in qemu-x86_defconfig to make such
> errors visible in Travis CI.
>
> This seems to be the problematic patch:
> ad503ffe9c6: efi_loader: refactor boot device and loaded_image handling
>

The rebased version of this patch fixed this.  It looks like the
original patch was applied.  What you want is approximately:


#ifdef CONFIG_CMD_BOOTEFI_SELFTEST
if (!strcmp(argv[1], "selftest")) {
+ struct efi_loaded_image loaded_image_info = {};
+ struct efi_object loaded_image_info_obj = {};
+
+ efi_setup_loaded_image(&loaded_image_info, &loaded_image_info_obj,
+ bootefi_device_path, bootefi_image_path);
+
/*
* gd lives in a fixed register which may get clobbered while we
* execute the payload. So save it here and restore it on every

See: https://github.com/robclark/u-boot/commit/c17f3a0fbcedf1b5e38e671c277dbd2187d30c19


BR,
-R

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

* [U-Boot] [PATCH 1/1] efi_loader: reenable selftest
  2017-09-20 19:46 ` [U-Boot] [PATCH 1/1] efi_loader: reenable selftest Heinrich Schuchardt
@ 2017-09-20 20:31   ` Rob Clark
  2017-09-20 20:54     ` [U-Boot] [PATCH v2 " Heinrich Schuchardt
  0 siblings, 1 reply; 9+ messages in thread
From: Rob Clark @ 2017-09-20 20:31 UTC (permalink / raw)
  To: u-boot

On Wed, Sep 20, 2017 at 3:46 PM, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> ad503ffe9c6 efi_loader: refactor boot device and loaded_image handling
> leads to an error when building with CONFIG_CMD_BOOTEFI_SELFTEST=y
> This patch fixes the problem.
>
> Fixes: ad503ffe9c6 efi_loader: refactor boot device and loaded_image handling
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  cmd/bootefi.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/cmd/bootefi.c b/cmd/bootefi.c
> index 1e2dbcc4a4..9460747f96 100644
> --- a/cmd/bootefi.c
> +++ b/cmd/bootefi.c
> @@ -273,6 +273,8 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>  #endif
>  #ifdef CONFIG_CMD_BOOTEFI_SELFTEST
>         if (!strcmp(argv[1], "selftest")) {
> +               struct efi_loaded_image loaded_image_info = {};
> +
>                 /*
>                  * gd lives in a fixed register which may get clobbered while we
>                  * execute the payload. So save it here and restore it on every
> --
> 2.14.1
>

I'm not sure this is complete enough (or at least will run into
problems if you add more tests) since loaded_image_info won't be
populated completely.  You want a efi_setup_loaded_image() call:

        efi_setup_loaded_image(&loaded_image_info, &loaded_image_info_obj,
                       bootefi_device_path, bootefi_image_path);


BR,
-R

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

* [U-Boot] [PATCH v2 1/1] efi_loader: reenable selftest
  2017-09-20 20:31   ` Rob Clark
@ 2017-09-20 20:54     ` Heinrich Schuchardt
  2017-09-20 21:06       ` Rob Clark
  2017-09-25  2:13       ` Simon Glass
  0 siblings, 2 replies; 9+ messages in thread
From: Heinrich Schuchardt @ 2017-09-20 20:54 UTC (permalink / raw)
  To: u-boot

ad503ffe9c6 efi_loader: refactor boot device and loaded_image handling
leads to an error when building with CONFIG_CMD_BOOTEFI_SELFTEST=y
This patch fixes the problem.

Fixes: ad503ffe9c6 efi_loader: refactor boot device and loaded_image handling
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
v2
	completely initialize loaded_image_info
---
 cmd/bootefi.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 1e2dbcc4a4..e0a657323f 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -273,6 +273,12 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #endif
 #ifdef CONFIG_CMD_BOOTEFI_SELFTEST
 	if (!strcmp(argv[1], "selftest")) {
+		struct efi_loaded_image loaded_image_info = {};
+		struct efi_object loaded_image_info_obj = {};
+
+		efi_setup_loaded_image(&loaded_image_info,
+				       &loaded_image_info_obj,
+				       bootefi_device_path, bootefi_image_path);
 		/*
 		 * gd lives in a fixed register which may get clobbered while we
 		 * execute the payload. So save it here and restore it on every
@@ -282,8 +288,6 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		/* Initialize and populate EFI object list */
 		if (!efi_obj_list_initalized)
 			efi_init_obj_list();
-		loaded_image_info.device_handle = bootefi_device_path;
-		loaded_image_info.file_path = bootefi_image_path;
 		return efi_selftest(&loaded_image_info, &systab);
 	} else
 #endif
-- 
2.14.1

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

* [U-Boot] [PATCH v2 1/1] efi_loader: reenable selftest
  2017-09-20 20:54     ` [U-Boot] [PATCH v2 " Heinrich Schuchardt
@ 2017-09-20 21:06       ` Rob Clark
  2017-09-25  2:13       ` Simon Glass
  1 sibling, 0 replies; 9+ messages in thread
From: Rob Clark @ 2017-09-20 21:06 UTC (permalink / raw)
  To: u-boot

On Wed, Sep 20, 2017 at 4:54 PM, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> ad503ffe9c6 efi_loader: refactor boot device and loaded_image handling
> leads to an error when building with CONFIG_CMD_BOOTEFI_SELFTEST=y
> This patch fixes the problem.
>
> Fixes: ad503ffe9c6 efi_loader: refactor boot device and loaded_image handling
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> v2
>         completely initialize loaded_image_info


lgtm, thanks

Reviewed-by: Rob Clark <robdclark@gmail.com>

> ---
>  cmd/bootefi.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/cmd/bootefi.c b/cmd/bootefi.c
> index 1e2dbcc4a4..e0a657323f 100644
> --- a/cmd/bootefi.c
> +++ b/cmd/bootefi.c
> @@ -273,6 +273,12 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>  #endif
>  #ifdef CONFIG_CMD_BOOTEFI_SELFTEST
>         if (!strcmp(argv[1], "selftest")) {
> +               struct efi_loaded_image loaded_image_info = {};
> +               struct efi_object loaded_image_info_obj = {};
> +
> +               efi_setup_loaded_image(&loaded_image_info,
> +                                      &loaded_image_info_obj,
> +                                      bootefi_device_path, bootefi_image_path);
>                 /*
>                  * gd lives in a fixed register which may get clobbered while we
>                  * execute the payload. So save it here and restore it on every
> @@ -282,8 +288,6 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>                 /* Initialize and populate EFI object list */
>                 if (!efi_obj_list_initalized)
>                         efi_init_obj_list();
> -               loaded_image_info.device_handle = bootefi_device_path;
> -               loaded_image_info.file_path = bootefi_image_path;
>                 return efi_selftest(&loaded_image_info, &systab);
>         } else
>  #endif
> --
> 2.14.1
>

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

* [U-Boot] [PATCH 1/1] efi_selftest: enable CONFIG_CMD_BOOTEFI_SELFTEST
  2017-09-20 19:14 ` [U-Boot] [PATCH 1/1] efi_selftest: enable CONFIG_CMD_BOOTEFI_SELFTEST Heinrich Schuchardt
@ 2017-09-25  2:13   ` Simon Glass
  0 siblings, 0 replies; 9+ messages in thread
From: Simon Glass @ 2017-09-25  2:13 UTC (permalink / raw)
  To: u-boot

On 20 September 2017 at 13:14, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> The EFI selftest has been broken by a patch on efi-next.
> We should enable CONFIG_CMD_BOOTEFI_SELFTEST on
> qemu-x86_defconfig and qemu-x86_64_defconfig by default
> to catch this type of problem in the Travis CI tests.
>
> These systems typically have abundant memory so that
> enabling this option should not pose a problem.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  configs/qemu-x86_64_defconfig | 1 +
>  configs/qemu-x86_defconfig    | 1 +
>  2 files changed, 2 insertions(+)

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

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

* [U-Boot] [PATCH v2 1/1] efi_loader: reenable selftest
  2017-09-20 20:54     ` [U-Boot] [PATCH v2 " Heinrich Schuchardt
  2017-09-20 21:06       ` Rob Clark
@ 2017-09-25  2:13       ` Simon Glass
  1 sibling, 0 replies; 9+ messages in thread
From: Simon Glass @ 2017-09-25  2:13 UTC (permalink / raw)
  To: u-boot

On 20 September 2017 at 14:54, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> ad503ffe9c6 efi_loader: refactor boot device and loaded_image handling
> leads to an error when building with CONFIG_CMD_BOOTEFI_SELFTEST=y
> This patch fixes the problem.
>
> Fixes: ad503ffe9c6 efi_loader: refactor boot device and loaded_image handling
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> v2
>         completely initialize loaded_image_info
> ---
>  cmd/bootefi.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

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

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

end of thread, other threads:[~2017-09-25  2:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-20 18:42 [U-Boot] cmd/bootefi.c:285:3: error: ‘loaded_image_info’ undeclared Heinrich Schuchardt
2017-09-20 19:14 ` [U-Boot] [PATCH 1/1] efi_selftest: enable CONFIG_CMD_BOOTEFI_SELFTEST Heinrich Schuchardt
2017-09-25  2:13   ` Simon Glass
2017-09-20 19:46 ` [U-Boot] [PATCH 1/1] efi_loader: reenable selftest Heinrich Schuchardt
2017-09-20 20:31   ` Rob Clark
2017-09-20 20:54     ` [U-Boot] [PATCH v2 " Heinrich Schuchardt
2017-09-20 21:06       ` Rob Clark
2017-09-25  2:13       ` Simon Glass
2017-09-20 20:29 ` [U-Boot] cmd/bootefi.c:285:3: error: ‘loaded_image_info’ undeclared Rob Clark

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.