Commit fdd5f9e6 authored by Manish Pandey's avatar Manish Pandey
Browse files

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: default avatarManish Pandey <manish.pandey2@arm.com>
Change-Id: I06cd39dbefaf492682d9bbb0c82b950dd31fb416
parent 99c447f4
...@@ -128,7 +128,13 @@ int plat_spm_core_manifest_load(spmc_manifest_attribute_t *manifest, ...@@ -128,7 +128,13 @@ int plat_spm_core_manifest_load(spmc_manifest_attribute_t *manifest,
*/ */
pm_base = (uintptr_t)pm_addr; pm_base = (uintptr_t)pm_addr;
pm_base_align = page_align(pm_base, UP); 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 */ /* Check space within the page at least maps the FDT header */
if (mapped_size < sizeof(struct fdt_header)) { if (mapped_size < sizeof(struct fdt_header)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment