All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] efi: arm64: abort boot on pending SError
@ 2016-07-01 15:01 ` Ard Biesheuvel
  0 siblings, 0 replies; 16+ messages in thread
From: Ard Biesheuvel @ 2016-07-01 15:01 UTC (permalink / raw)
  To: linux-efi-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	matt-mF/unelCI9GS6iBeEJttW/XRex20P6io,
	catalin.marinas-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
	leif.lindholm-QSEj5FYQhm4dnm+yROfE0A
  Cc: Ard Biesheuvel

It is the firmware's job to clear any pending SErrors before entering
the kernel. On UEFI, we can fail gracefully rather than panic during
early boot, so check for this condition in the stub.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
 drivers/firmware/efi/libstub/arm64-stub.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/efi/libstub/arm64-stub.c b/drivers/firmware/efi/libstub/arm64-stub.c
index eae693eb3e91..c7e7396de876 100644
--- a/drivers/firmware/efi/libstub/arm64-stub.c
+++ b/drivers/firmware/efi/libstub/arm64-stub.c
@@ -20,7 +20,14 @@ extern bool __nokaslr;
 
 efi_status_t check_platform_features(efi_system_table_t *sys_table_arg)
 {
-	u64 tg;
+	u64 tg, isr;
+
+	/* check for a pending SError */
+	asm ("mrs %0, isr_el1" : "=r"(isr));
+	if (isr & BIT(8)) {
+		pr_efi_err(sys_table_arg, "Pending SError detected -- aborting\n");
+		return EFI_LOAD_ERROR;
+	}
 
 	/* UEFI mandates support for 4 KB granularity, no need to check */
 	if (IS_ENABLED(CONFIG_ARM64_4K_PAGES))
-- 
2.7.4

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

end of thread, other threads:[~2016-07-02 10:14 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-01 15:01 [PATCH 1/2] efi: arm64: abort boot on pending SError Ard Biesheuvel
2016-07-01 15:01 ` Ard Biesheuvel
     [not found] ` <1467385291-9880-1-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-07-01 15:01   ` [PATCH 2/2] arm64: document that pending SErrors are not allowed at kernel entry Ard Biesheuvel
2016-07-01 15:01     ` Ard Biesheuvel
     [not found]     ` <1467385291-9880-2-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-07-01 15:25       ` Mark Rutland
2016-07-01 15:25         ` Mark Rutland
2016-07-01 15:34         ` Ard Biesheuvel
2016-07-01 15:34           ` Ard Biesheuvel
2016-07-01 15:22   ` [PATCH 1/2] efi: arm64: abort boot on pending SError Mark Rutland
2016-07-01 15:22     ` Mark Rutland
2016-07-01 15:31     ` Ard Biesheuvel
2016-07-01 15:31       ` Ard Biesheuvel
     [not found]       ` <CAKv+Gu9Pk6xbUUMisAMhd4rpoYHA+wjzrZGkyEUXPdx_TaniVQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-07-01 15:46         ` Mark Rutland
2016-07-01 15:46           ` Mark Rutland
2016-07-02 10:14           ` Ard Biesheuvel
2016-07-02 10:14             ` Ard Biesheuvel

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.