Skip to content

Commit

Permalink
core: initialize tee_pager_tbl_info early
Browse files Browse the repository at this point in the history
Initialize tee_pager_tbl_info early to support early address lookups in
MEM_AREA_TEE_RAM.

Reviewed-by: etienne carriere <[email protected]>
Tested-by: Jens Wiklander <[email protected]> (QEMU)
Signed-off-by: Jens Wiklander <[email protected]>
  • Loading branch information
jenswi-linaro committed Jul 7, 2016
1 parent fb4595a commit 2cdf0c8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
12 changes: 12 additions & 0 deletions core/arch/arm/kernel/generic_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,18 @@ static void init_runtime(unsigned long pageable_part)
memset(__bss_start, 0, __bss_end - __bss_start);

core_mmu_linear_map_end = (vaddr_t)__heap2_end;
/*
* This needs to be initialized early to support address lookup
* in MEM_AREA_TEE_RAM
*/
if (!core_mmu_find_table(CFG_TEE_RAM_START, UINT_MAX,
&tee_pager_tbl_info))
panic();
if (tee_pager_tbl_info.shift != SMALL_PAGE_SHIFT) {
EMSG("Unsupported page size in translation table %u",
BIT(tee_pager_tbl_info.shift));
panic();
}

thread_init_boot_thread();

Expand Down
9 changes: 0 additions & 9 deletions core/arch/arm/mm/tee_pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,15 +327,6 @@ bool tee_pager_add_core_area(vaddr_t base, size_t size, uint32_t flags,
else
panic();

if (!ti->num_entries) {
if (!core_mmu_find_table(base, UINT_MAX, ti))
return false;
if ((1 << ti->shift) != SMALL_PAGE_SIZE) {
DMSG("Unsupported page size in translation table %u",
1 << ti->shift);
return false;
}
}

tbl_va_size = (1 << ti->shift) * ti->num_entries;
if (!core_is_buffer_inside(base, size, ti->va_base, tbl_va_size)) {
Expand Down

0 comments on commit 2cdf0c8

Please sign in to comment.