[Skiboot] [PATCH v4 01/18] libstb/secureboot: use platform.terminate instead of hard abort

Eric Richter erichte at linux.ibm.com
Tue May 12 07:31:35 AEST 2020


Halting the boot via an abort() call will cause the BMC to keep
restarting the machine indefinitely. Ending via platform.terminate()
should be cleaner and prevent needless bootloops.

This patch also exposes secureboot_enforce() for future secvar use to
cease the boot.

Signed-off-by: Eric Richter <erichte at linux.ibm.com>
---
 libstb/secureboot.c | 5 ++---
 libstb/secureboot.h | 1 +
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libstb/secureboot.c b/libstb/secureboot.c
index c8697216..2a4b975e 100644
--- a/libstb/secureboot.c
+++ b/libstb/secureboot.c
@@ -27,7 +27,7 @@ static struct {
 	{ IBM_SECUREBOOT_V2, "ibm,secureboot-v2" },
 };
 
-static void secureboot_enforce(void)
+void secureboot_enforce(void)
 {
 	/* Sanity check */
 	if (!secure_mode)
@@ -39,8 +39,7 @@ static void secureboot_enforce(void)
 	 * extra info to BMC other than just abort.  Terminate Immediate
 	 * Attention ? (TI)
 	 */
-	prlog(PR_EMERG, "secure mode enforced, aborting.\n");
-	abort();
+	platform.terminate("secure mode enforced, aborting.\n");
 }
 
 bool secureboot_is_compatible(struct dt_node *node, int *version, const char **compat)
diff --git a/libstb/secureboot.h b/libstb/secureboot.h
index 0792dd5a..721b28de 100644
--- a/libstb/secureboot.h
+++ b/libstb/secureboot.h
@@ -15,6 +15,7 @@ enum secureboot_version {
 	IBM_SECUREBOOT_V2,
 };
 
+void secureboot_enforce(void);
 bool secureboot_is_compatible(struct dt_node *node, int *version, const char **compat);
 void secureboot_init(void);
 
-- 
2.21.1



More information about the Skiboot mailing list