[Concept,02/20] efi: app: Avoid switching exception levels on ARM

Message ID 20250828020732.981415-3-sjg@u-boot.org
State New
Headers
Series efi: App and devicetree improvements |

Commit Message

Simon Glass Aug. 28, 2025, 2:07 a.m. UTC
  From: Simon Glass <sjg@chromium.org>

The EFI app runs under the environment provided to it and is not allowed
to change the exception level. Remove this call for the app.

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

 lib/efi_client/app_run.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

diff --git a/lib/efi_client/app_run.c b/lib/efi_client/app_run.c
index d2519985c87..03cc29778d8 100644
--- a/lib/efi_client/app_run.c
+++ b/lib/efi_client/app_run.c
@@ -31,7 +31,8 @@  static efi_status_t do_bootefi_exec(efi_handle_t handle, void *load_options)
 	efi_status_t ret;
 
 	/* On ARM switch from EL3 or secure mode to EL2 or non-secure mode */
-	switch_to_non_secure_mode();
+	if (!IS_ENABLED(CONFIG_EFI_APP))
+		switch_to_non_secure_mode();
 
 	/* TODO(sjg@chromium.org): Set watchdog */