ARM: Fix the way the space for the page tables is allocated.
The page tables need to be aligned to a 16KB boundary and are 16KB in size. The CBMEM allocator only guarantees 512 byte alignment, so to make sure things are where they're supposed to be, the code was allocating extra space and then adjusting the pointer upwards. Unfortunately, it was adding the size of the table to the pointer first, then aligning it. Since it allocated twice the space of the table, this had the effect of moving past the first table size region of bytes, and then aligning upwards, pushing the end of the table out of the space allocated for it. You can get away with this if you push things you don't care about off the end, and it happened to be the case that we were allocating a color map we weren't using at the start of the next part of cbmem. BUG=None TEST=Built and booted on Snow BRANCH=None Change-Id: I13e28e015a3acf0dbb627aa5eff5f99bf4211ce6 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: https://gerrit.chromium.org/gerrit/55636 Commit-Queue: Stefan Reinauer <reinauer@google.com> Reviewed-by: Stefan Reinauer <reinauer@google.com> Tested-by: Stefan Reinauer <reinauer@google.com>
This commit is contained in:
parent
3128756e83
commit
30820605f0
1 changed files with 5 additions and 4 deletions
|
|
@ -118,11 +118,12 @@ void mmu_init(void)
|
|||
* programmer's guide)
|
||||
*
|
||||
* FIXME: TLB needs to be aligned to 16KB, but cbmem_add() aligns to
|
||||
* 512 bytes. So add double the space in cbmem and fix-up the pointer.
|
||||
* 512 bytes. So allocate some extra space in cbmem and fix-up the
|
||||
* pointer.
|
||||
*/
|
||||
ttb_size = L1_TLB_ENTRIES * sizeof(unsigned long);
|
||||
ttb_addr = (uintptr_t)cbmem_add(CBMEM_ID_GDT, ttb_size * 2);
|
||||
ttb_addr = ALIGN(ttb_addr + ttb_size, ttb_size);
|
||||
ttb_size = L1_TLB_ENTRIES * sizeof(uint32_t);
|
||||
ttb_addr = (uintptr_t)cbmem_add(CBMEM_ID_GDT, ttb_size + 16*KiB);
|
||||
ttb_addr = ALIGN(ttb_addr, 16*KiB);
|
||||
printk(BIOS_DEBUG, "Translation table is @ 0x%08x\n", ttb_addr);
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue