From 0d33649e3e2a21def73327522b9861b4619fc5c2 Mon Sep 17 00:00:00 2001 From: Olivier Deprez Date: Wed, 16 Nov 2022 16:46:23 +0100 Subject: [PATCH] feat(spmd): fail safe if SPM fails to initialize The spmd_setup function is made fail safe in that a failure in the SPMC manifest parsing, SPMD or SPMC initialization returns a success code to the standard services initialization routine (std_svc_setup). This permits continuing the boot process and initialize services beyond the SPMD to succeed for the system to operate in the normal world. It operates in a degraded mode for the secure world. Signed-off-by: Olivier Deprez Change-Id: Ida0ac91c17925279a79f112d190f9ad038f518e7 --- services/std_svc/spmd/spmd_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/services/std_svc/spmd/spmd_main.c b/services/std_svc/spmd/spmd_main.c index 3c207ad97..e85109dfa 100644 --- a/services/std_svc/spmd/spmd_main.c +++ b/services/std_svc/spmd/spmd_main.c @@ -513,15 +513,15 @@ int spmd_setup(void) rc = spmc_setup(); if (rc != 0) { - ERROR("SPMC initialisation failed 0x%x.\n", rc); + WARN("SPMC initialisation failed 0x%x.\n", rc); } - return rc; + return 0; } spmc_ep_info = bl31_plat_get_next_image_ep_info(SECURE); if (spmc_ep_info == NULL) { WARN("No SPM Core image provided by BL2 boot loader.\n"); - return -EINVAL; + return 0; } /* Under no circumstances will this parameter be 0 */ @@ -533,8 +533,8 @@ int spmd_setup(void) */ spmc_manifest = (void *)spmc_ep_info->args.arg0; if (spmc_manifest == NULL) { - ERROR("Invalid or absent SPM Core manifest.\n"); - return -EINVAL; + WARN("Invalid or absent SPM Core manifest.\n"); + return 0; } /* Load manifest, init SPMC */ @@ -543,7 +543,7 @@ int spmd_setup(void) WARN("Booting device without SPM initialization.\n"); } - return rc; + return 0; } /******************************************************************************* -- 2.39.5