* [PATCH 1/1] efi_loader: superfluous efi_restore_gd after EFI_CALL
@ 2024-04-19 9:59 Heinrich Schuchardt
2024-04-19 13:25 ` Ilias Apalodimas
0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2024-04-19 9:59 UTC (permalink / raw)
To: Ilias Apalodimas; +Cc: AKASHI Takahiro, u-boot, Heinrich Schuchardt
EFI_CALL() invokes __efi_entry_check() which executes set_gd(efi_gd).
There is no need to execute set_gd(efi_gd) again via efi_restore_gd().
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
cmd/bootefi.c | 1 -
cmd/efidebug.c | 2 --
lib/efi_loader/efi_helper.c | 2 --
3 files changed, 5 deletions(-)
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 578dbb19a7e..c1454ffb948 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -107,7 +107,6 @@ static int do_efi_selftest(void)
/* Execute the test */
ret = EFI_CALL(efi_selftest(&image_obj->header, &systab));
- efi_restore_gd();
free(loaded_image_info->load_options);
efi_free_pool(test_device_path);
efi_free_pool(test_image_path);
diff --git a/cmd/efidebug.c b/cmd/efidebug.c
index 32c64711b6c..30def6b6831 100644
--- a/cmd/efidebug.c
+++ b/cmd/efidebug.c
@@ -1466,8 +1466,6 @@ static __maybe_unused int do_efi_test_bootmgr(struct cmd_tbl *cmdtp, int flag,
if (ret && exit_data)
efi_free_pool(exit_data);
- efi_restore_gd();
-
free(load_options);
return CMD_RET_SUCCESS;
}
diff --git a/lib/efi_loader/efi_helper.c b/lib/efi_loader/efi_helper.c
index 58761fae784..88c3586787e 100644
--- a/lib/efi_loader/efi_helper.c
+++ b/lib/efi_loader/efi_helper.c
@@ -544,8 +544,6 @@ efi_status_t do_bootefi_exec(efi_handle_t handle, void *load_options)
}
}
- efi_restore_gd();
-
out:
free(load_options);
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] efi_loader: superfluous efi_restore_gd after EFI_CALL
2024-04-19 9:59 [PATCH 1/1] efi_loader: superfluous efi_restore_gd after EFI_CALL Heinrich Schuchardt
@ 2024-04-19 13:25 ` Ilias Apalodimas
0 siblings, 0 replies; 2+ messages in thread
From: Ilias Apalodimas @ 2024-04-19 13:25 UTC (permalink / raw)
To: Heinrich Schuchardt; +Cc: AKASHI Takahiro, u-boot
On Fri, 19 Apr 2024 at 12:59, Heinrich Schuchardt
<heinrich.schuchardt@canonical.com> wrote:
>
> EFI_CALL() invokes __efi_entry_check() which executes set_gd(efi_gd).
> There is no need to execute set_gd(efi_gd) again via efi_restore_gd().
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
> cmd/bootefi.c | 1 -
> cmd/efidebug.c | 2 --
> lib/efi_loader/efi_helper.c | 2 --
> 3 files changed, 5 deletions(-)
>
> diff --git a/cmd/bootefi.c b/cmd/bootefi.c
> index 578dbb19a7e..c1454ffb948 100644
> --- a/cmd/bootefi.c
> +++ b/cmd/bootefi.c
> @@ -107,7 +107,6 @@ static int do_efi_selftest(void)
>
> /* Execute the test */
> ret = EFI_CALL(efi_selftest(&image_obj->header, &systab));
> - efi_restore_gd();
> free(loaded_image_info->load_options);
> efi_free_pool(test_device_path);
> efi_free_pool(test_image_path);
> diff --git a/cmd/efidebug.c b/cmd/efidebug.c
> index 32c64711b6c..30def6b6831 100644
> --- a/cmd/efidebug.c
> +++ b/cmd/efidebug.c
> @@ -1466,8 +1466,6 @@ static __maybe_unused int do_efi_test_bootmgr(struct cmd_tbl *cmdtp, int flag,
> if (ret && exit_data)
> efi_free_pool(exit_data);
>
> - efi_restore_gd();
> -
> free(load_options);
> return CMD_RET_SUCCESS;
> }
> diff --git a/lib/efi_loader/efi_helper.c b/lib/efi_loader/efi_helper.c
> index 58761fae784..88c3586787e 100644
> --- a/lib/efi_loader/efi_helper.c
> +++ b/lib/efi_loader/efi_helper.c
> @@ -544,8 +544,6 @@ efi_status_t do_bootefi_exec(efi_handle_t handle, void *load_options)
> }
> }
>
> - efi_restore_gd();
> -
> out:
> free(load_options);
>
> --
> 2.43.0
>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-04-19 13:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-19 9:59 [PATCH 1/1] efi_loader: superfluous efi_restore_gd after EFI_CALL Heinrich Schuchardt
2024-04-19 13:25 ` Ilias Apalodimas
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.