diff options
author | Jens Wiklander <jens.wiklander@linaro.org> | 2014-12-10 16:08:26 +0100 |
---|---|---|
committer | Jens Wiklander <jens.wiklander@linaro.org> | 2014-12-18 10:05:46 +0100 |
commit | 6f9449b89e55a4772f400ef4dad2e0220d6a7940 (patch) | |
tree | 5493dc8cff07d96b261d21f2b7341aa313198237 /core/arch/arm32 | |
parent | 6d7d944a14e97f8e1b946418936592f69bf19406 (diff) |
arm32: remove memmap_notinit bookkeeping
Removes the bookkeeping of whether memory map has been initialized or
not using the memmap_notinit variable. Memory map is always initialized
before any core_va2pa() or core_pa2va() is performed so the bookkeeping
doesn't do much good.
The variable was updated with caches disabled while other CPUs might have
caches enabled. This can result in unexpected problems.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (Juno)
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
Diffstat (limited to 'core/arch/arm32')
-rw-r--r-- | core/arch/arm32/mm/core_mmu.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/core/arch/arm32/mm/core_mmu.c b/core/arch/arm32/mm/core_mmu.c index fadb6fe..dfdea5c 100644 --- a/core/arch/arm32/mm/core_mmu.c +++ b/core/arch/arm32/mm/core_mmu.c @@ -68,9 +68,6 @@ static struct map_area *map_tee_ram = (void *)1; /* not in BSS */ static struct map_area *map_ta_ram = (void *)1; /* not in BSS */ static struct map_area *map_nsec_shm = (void *)1; /* not in BSS */ -/* bss is not init: def value must be non-zero */ -static bool memmap_notinit[CFG_TEE_CORE_NB_CORE] = { true, true }; - /* check if target buffer fits in a core default map area */ static bool pbuf_inside_map_area(unsigned long p, size_t l, struct map_area *map) @@ -364,8 +361,6 @@ void core_init_mmu_regs(void) write_ttbr0(ttb_pa | TEE_MMU_DEFAULT_ATTRS); write_ttbr1(ttb_pa | TEE_MMU_DEFAULT_ATTRS); - - memmap_notinit[get_core_pos()] = false; } /* routines to retreive shared mem configuration */ @@ -428,24 +423,11 @@ bool core_vbuf_is(uint32_t attr, const void *vbuf, size_t len) return core_pbuf_is(attr, (tee_paddr_t)p, len); } -/* - * Return true is MMU is initialized for current core - * Note that this is for DEBUG only, to help preventing - * use of pa2va va2pa before mmu table is setup ! - */ -static bool is_coremap_init(void) -{ - return !memmap_notinit[get_core_pos()]; -} - /* core_va2pa - teecore exported service */ int core_va2pa_helper(void *va, paddr_t *pa) { struct map_area *map; - if (!is_coremap_init()) - return -1; - map = find_map_by_va(va); if (map == NULL) return -1; @@ -460,9 +442,6 @@ int core_pa2va_helper(paddr_t pa, void **va) { struct map_area *map; - if (!is_coremap_init()) - return -1; - map = find_map_by_pa((unsigned long)pa); if (map == NULL) return -1; |