Skip to content

Commit

Permalink
fix(extra_mem): Correct the bitmap_base for MMU systems
Browse files Browse the repository at this point in the history
In mmu-based systems, the vm_image_size is already encompassed in the
image_size.

Signed-off-by: Miguel Silva <[email protected]>
  • Loading branch information
miguelafsilva5 committed Nov 27, 2024
1 parent a7716bd commit 5e004e2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ static bool root_pool_set_up_bitmap(paddr_t load_addr, struct page_pool* root_po
if (root_pool->size <= bitmap_num_pages) {
return false;
}

#ifdef MEM_PROT_MMU
size_t bitmap_base = load_addr + image_size + vm_image_size + cpu_size;
#else
size_t bitmap_base = load_addr + image_size + cpu_size;
#endif

struct ppages bitmap_pp = mem_ppages_get(bitmap_base, bitmap_num_pages);
bitmap_t* root_bitmap = (bitmap_t*)mem_alloc_map(&cpu()->as, SEC_HYP_GLOBAL, &bitmap_pp,
Expand Down

0 comments on commit 5e004e2

Please sign in to comment.