diff mbox series

[3/3] efi_selftest: restore gd before do_reset()

Message ID 20200910110048.21446-4-xypron.glpk@gmx.de
State Accepted, archived
Commit 5bf12a78599d4a311265c174496233aa15ed4252
Delegated to: Heinrich Schuchardt
Headers show
Series efi_loader: save global data pointer on RISC-V | expand

Commit Message

Heinrich Schuchardt Sept. 10, 2020, 11 a.m. UTC
Before calling do_reset() in the EFI selftest we must restore the global
data pointer.

Fixes: fa63753f86cc ("efi_selftest: substitute ResetSystem() by do_reset()")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 lib/efi_selftest/efi_selftest.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--
2.28.0
diff mbox series

Patch

diff --git a/lib/efi_selftest/efi_selftest.c b/lib/efi_selftest/efi_selftest.c
index 6eec8ae2a7..165fa265f2 100644
--- a/lib/efi_selftest/efi_selftest.c
+++ b/lib/efi_selftest/efi_selftest.c
@@ -311,11 +311,13 @@  efi_status_t EFIAPI efi_selftest(efi_handle_t image_handle,
 	efi_st_printf("Preparing for reset. Press any key...\n");
 	efi_st_get_key();

-	if (IS_ENABLED(CONFIG_EFI_HAVE_RUNTIME_RESET))
+	if (IS_ENABLED(CONFIG_EFI_HAVE_RUNTIME_RESET)) {
 		runtime->reset_system(EFI_RESET_WARM, EFI_NOT_READY,
 				      sizeof(reset_message), reset_message);
-	else
+	} else {
+		efi_restore_gd();
 		do_reset(NULL, 0, 0, NULL);
+	}

 	efi_st_printf("\n");
 	efi_st_error("Reset failed\n");