All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/1] efi_loader: remove efi_exit_caches()
@ 2018-09-23 12:33 Heinrich Schuchardt
  2018-11-15  5:34 ` Jonathan Gray
  0 siblings, 1 reply; 27+ messages in thread
From: Heinrich Schuchardt @ 2018-09-23 12:33 UTC (permalink / raw)
  To: u-boot

Since GRUB patch d0c070179d4d ("arm/efi: Switch to arm64 linux loader",
2018-07-09) we do not need a workaround for GRUB on 32bit ARM anymore.

So let's eliminate function efi_exit_caches().

This will require Linux distributions to update grub-efi-arm to the GRUB
git HEAD (a tag containing the aforementioned GRUB patch is not available
yet).

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 lib/efi_loader/efi_boottime.c | 28 ----------------------------
 1 file changed, 28 deletions(-)

diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 2496608981..97eb19cd14 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -26,14 +26,6 @@ LIST_HEAD(efi_obj_list);
 /* List of all events */
 LIST_HEAD(efi_events);
 
-/*
- * If we're running on nasty systems (32bit ARM booting into non-EFI Linux)
- * we need to do trickery with caches. Since we don't want to break the EFI
- * aware boot path, only apply hacks when loading exiting directly (breaking
- * direct Linux EFI booting along the way - oh well).
- */
-static bool efi_is_direct_boot = true;
-
 #ifdef CONFIG_ARM
 /*
  * The "gd" pointer lives in a register on ARM and AArch64 that we declare
@@ -1686,8 +1678,6 @@ static efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
 
 	EFI_ENTRY("%p, %p, %p", image_handle, exit_data_size, exit_data);
 
-	efi_is_direct_boot = false;
-
 	/* call the image! */
 	if (setjmp(&image_obj->exit_jmp)) {
 		/*
@@ -1795,21 +1785,6 @@ static efi_status_t EFIAPI efi_unload_image(efi_handle_t image_handle)
 	return EFI_EXIT(EFI_SUCCESS);
 }
 
-/**
- * efi_exit_caches() - fix up caches for EFI payloads if necessary
- */
-static void efi_exit_caches(void)
-{
-#if defined(CONFIG_ARM) && !defined(CONFIG_ARM64)
-	/*
-	 * Grub on 32bit ARM needs to have caches disabled before jumping into
-	 * a zImage, but does not know of all cache layers. Give it a hand.
-	 */
-	if (efi_is_direct_boot)
-		cleanup_before_linux();
-#endif
-}
-
 /**
  * efi_exit_boot_services() - stop all boot services
  * @image_handle: handle of the loaded image
@@ -1863,9 +1838,6 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
 
 	board_quiesce_devices();
 
-	/* Fix up caches for EFI payloads if necessary */
-	efi_exit_caches();
-
 	/* This stops all lingering devices */
 	bootm_disable_interrupts();
 
-- 
2.19.0

^ permalink raw reply related	[flat|nested] 27+ messages in thread
* [U-Boot] [PATCH 1/1] efi_loader: remove efi_exit_caches()
@ 2019-07-19 18:25 Heinrich Schuchardt
  2019-07-19 19:06 ` Peter Robinson
  2019-07-19 23:59 ` Jonathan Gray
  0 siblings, 2 replies; 27+ messages in thread
From: Heinrich Schuchardt @ 2019-07-19 18:25 UTC (permalink / raw)
  To: u-boot

In GRUB before 2.04 a bug existed which did not allow booting some ARM32
boards if U-Boot did not disable caches, cf.
https://lists.linaro.org/pipermail/cross-distro/2019-July/000933.html

In ExitBootServices() we were disabling the caches by calling
cleanup_before_linux(). This workaround is not needed anymore.

The UEFI spec requires that caches are enabled but architecturally defined
caches should be disabled. But this requirement has to be fulfilled when
invoking StartImage() and not after calling ExitBootServices(). So there is
no reason for calling cleanup_before_linux() here.

Since commit f69d63fae281 ("efi_loader: use efi_start_image() for
bootefi"), i.e. v2019.04, we have not been calling efi_exit_caches()
anymore which in turn would call cleanup_before_linux().

Remove the obsolete function efi_exit_caches().

Suggested-by: Alexander Graf <agraf@csgraf.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 lib/efi_loader/efi_boottime.c | 28 ----------------------------
 1 file changed, 28 deletions(-)

diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 4f6e8d1679..f84ee24416 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -39,14 +39,6 @@ LIST_HEAD(efi_register_notify_events);
 /* Handle of the currently executing image */
 static efi_handle_t current_image;

-/*
- * If we're running on nasty systems (32bit ARM booting into non-EFI Linux)
- * we need to do trickery with caches. Since we don't want to break the EFI
- * aware boot path, only apply hacks when loading exiting directly (breaking
- * direct Linux EFI booting along the way - oh well).
- */
-static bool efi_is_direct_boot = true;
-
 #ifdef CONFIG_ARM
 /*
  * The "gd" pointer lives in a register on ARM and AArch64 that we declare
@@ -1906,21 +1898,6 @@ error:
 	return EFI_EXIT(ret);
 }

-/**
- * efi_exit_caches() - fix up caches for EFI payloads if necessary
- */
-static void efi_exit_caches(void)
-{
-#if defined(CONFIG_ARM) && !defined(CONFIG_ARM64)
-	/*
-	 * Grub on 32bit ARM needs to have caches disabled before jumping into
-	 * a zImage, but does not know of all cache layers. Give it a hand.
-	 */
-	if (efi_is_direct_boot)
-		cleanup_before_linux();
-#endif
-}
-
 /**
  * efi_exit_boot_services() - stop all boot services
  * @image_handle: handle of the loaded image
@@ -1990,9 +1967,6 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
 	/* Patch out unsupported runtime function */
 	efi_runtime_detach();

-	/* Fix up caches for EFI payloads if necessary */
-	efi_exit_caches();
-
 	/* This stops all lingering devices */
 	bootm_disable_interrupts();

@@ -2893,8 +2867,6 @@ efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
 	if (ret != EFI_SUCCESS)
 		return EFI_EXIT(EFI_INVALID_PARAMETER);

-	efi_is_direct_boot = false;
-
 	image_obj->exit_data_size = exit_data_size;
 	image_obj->exit_data = exit_data;

--
2.20.1

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

end of thread, other threads:[~2019-07-23  6:18 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-23 12:33 [U-Boot] [PATCH 1/1] efi_loader: remove efi_exit_caches() Heinrich Schuchardt
2018-11-15  5:34 ` Jonathan Gray
2018-11-15 20:23   ` Alexander Graf
2018-11-24 11:33     ` Emmanuel Vadot
2019-07-19 18:25 Heinrich Schuchardt
2019-07-19 19:06 ` Peter Robinson
2019-07-20  4:31   ` Heinrich Schuchardt
2019-07-20 10:22     ` Peter Robinson
2019-07-20 16:19       ` Heinrich Schuchardt
2019-07-21  9:46         ` Peter Robinson
2019-07-21 19:42           ` Heinrich Schuchardt
2019-07-22 15:10             ` Peter Robinson
2019-07-22 13:36           ` Tom Rini
2019-07-22 15:15             ` Peter Robinson
2019-07-22 21:49               ` Pablo Sebastián Greco
2019-07-22 21:53               ` Pablo Sebastián Greco
2019-07-22 18:51             ` Heinrich Schuchardt
2019-07-22 19:02               ` Tom Rini
2019-07-22 19:07                 ` Heinrich Schuchardt
2019-07-22 19:16                   ` Tom Rini
2019-07-22 19:29             ` Mark Kettenis
2019-07-22 22:12               ` Tom Rini
2019-07-19 23:59 ` Jonathan Gray
2019-07-20  4:19   ` Heinrich Schuchardt
2019-07-20 11:23   ` Heinrich Schuchardt
2019-07-22 18:59     ` Mark Kettenis
2019-07-23  6:18       ` Heinrich Schuchardt

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.