diff options
author | Javier Almansa Sobrino <javier.almansasobrino@arm.com> | 2022-12-01 17:20:45 +0000 |
---|---|---|
committer | Javier Almansa Sobrino <javier.almansasobrino@arm.com> | 2022-12-07 18:54:28 +0000 |
commit | dc0ca64e4b6c86090eee025293e7ae7f1fe1cf12 (patch) | |
tree | 1b3e9da1f17af2c595aa4254a2883c877c70913e /services/std_svc | |
parent | 10f4d1a2d053b0740644d704d7583666913e5092 (diff) | |
download | arm-trusted-firmware-dc0ca64e4b6c86090eee025293e7ae7f1fe1cf12.tar.gz |
fix(rmmd): add missing padding to RMM Boot Manifest and initialize it
This patch also:
* Enforces the check of RES0 fields on EL3-RMM boot interface
and manifest
* Fixes a couple of nits on the EL3-RMM Boot Interface
documentation.
Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Change-Id: Idb9e38f9fcda2ba0655646a1e2c4fdbabd5cdc40
Diffstat (limited to 'services/std_svc')
-rw-r--r-- | services/std_svc/rmmd/trp/trp_entry.S | 10 | ||||
-rw-r--r-- | services/std_svc/rmmd/trp/trp_main.c | 18 | ||||
-rw-r--r-- | services/std_svc/rmmd/trp/trp_private.h | 4 |
3 files changed, 32 insertions, 0 deletions
diff --git a/services/std_svc/rmmd/trp/trp_entry.S b/services/std_svc/rmmd/trp/trp_entry.S index 47c1df14d..ef3024daf 100644 --- a/services/std_svc/rmmd/trp/trp_entry.S +++ b/services/std_svc/rmmd/trp/trp_entry.S @@ -83,7 +83,17 @@ trp_head: mov x3, x23 bl trp_setup bl trp_main + b 1f + warm_boot: + mov x0, x20 + mov x1, x21 + mov x2, x22 + mov x3, x23 + bl trp_validate_warmboot_args + cbnz x0, trp_panic /* Failed to validate warmboot args */ + +1: mov_imm x0, RMM_BOOT_COMPLETE mov x1, xzr /* RMM_BOOT_SUCCESS */ smc #0 diff --git a/services/std_svc/rmmd/trp/trp_main.c b/services/std_svc/rmmd/trp/trp_main.c index 5a56af043..b0a1c0929 100644 --- a/services/std_svc/rmmd/trp/trp_main.c +++ b/services/std_svc/rmmd/trp/trp_main.c @@ -66,6 +66,24 @@ void trp_setup(uint64_t x0, trp_early_platform_setup((rmm_manifest_t *)trp_shared_region_start); } +int trp_validate_warmboot_args(uint64_t x0, uint64_t x1, + uint64_t x2, uint64_t x3) +{ + /* + * Validate boot parameters for warm boot + * + * According to the Boot Interface ABI v.0.1, the parameters + * received from EL3 during warm boot are: + * + * x0: CPUID (verified earlier so not used here) + * [x1:x3]: RES0 + */ + + (void)x0; + + return ((x1 | x2 | x3) == 0UL) ? 0 : E_RMM_BOOT_UNKNOWN; +} + /* Main function for TRP */ void trp_main(void) { diff --git a/services/std_svc/rmmd/trp/trp_private.h b/services/std_svc/rmmd/trp/trp_private.h index 945ae1c89..d8c69603b 100644 --- a/services/std_svc/rmmd/trp/trp_private.h +++ b/services/std_svc/rmmd/trp/trp_private.h @@ -53,5 +53,9 @@ void trp_setup(uint64_t x0, uint64_t x2, uint64_t x3); +/* Validate arguments for warm boot only */ +int trp_validate_warmboot_args(uint64_t x0, uint64_t x1, + uint64_t x2, uint64_t x3); + #endif /* __ASSEMBLER__ */ #endif /* TRP_PRIVATE_H */ |