diff options
author | Manish Pandey <manish.pandey2@arm.com> | 2020-07-09 00:39:16 +0100 |
---|---|---|
committer | Manish Pandey <manish.pandey2@arm.com> | 2020-07-13 23:00:07 +0100 |
commit | fdd5f9e6d6172f012b216d6af609fd528dd25836 (patch) | |
tree | e10e9c6a84cdc94b6541fe45100e71d7785d553f /plat | |
parent | 99c447f4406c8ae66b6cab2341ef0c8e8d9751d2 (diff) | |
download | trusted-firmware-a-fdd5f9e6d6172f012b216d6af609fd528dd25836.tar.gz |
SPMD: fix boundary check if manifest is page aligned
while mapping SPMC manifest page in the SPMD translation regime the
mapped size was resolved to zero if SPMC manifest base address is PAGE
aligned, causing SPMD to abort.
To fix the problem change mapped size to PAGE_SIZE if manifest base is
PAGE aligned.
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I06cd39dbefaf492682d9bbb0c82b950dd31fb416
Diffstat (limited to 'plat')
-rw-r--r-- | plat/common/plat_spmd_manifest.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plat/common/plat_spmd_manifest.c b/plat/common/plat_spmd_manifest.c index 455b9808bb..e65980bc81 100644 --- a/plat/common/plat_spmd_manifest.c +++ b/plat/common/plat_spmd_manifest.c @@ -128,7 +128,13 @@ int plat_spm_core_manifest_load(spmc_manifest_attribute_t *manifest, */ pm_base = (uintptr_t)pm_addr; pm_base_align = page_align(pm_base, UP); - mapped_size = pm_base_align - pm_base; + + if (pm_base == pm_base_align) { + /* Page aligned */ + mapped_size = PAGE_SIZE; + } else { + mapped_size = pm_base_align - pm_base; + } /* Check space within the page at least maps the FDT header */ if (mapped_size < sizeof(struct fdt_header)) { |