arm/arm64: Use pgd_alloc() to allocate mmu_idmap
Until commit 031755db ("arm: enable vmalloc"), the idmap was allocated using pgd_alloc(). After that commit, all the page table allocator functions were switched to using the page allocator, but pgd_alloc() was left unchanged and became unused, with the idmap now being allocated with alloc_page(). For arm64, the pgd table size varies based on the page size, which is configured by the user. For arm, it will always contain 4 entries (it translates bits 31:30 of the input address). To keep things simple and consistent with the other functions and across both architectures, modify pgd_alloc() to use alloc_page() instead of memalign like the rest of the page table allocator functions and use it to allocate the idmap. Note that when the idmap is created, alloc_ops->memalign is memalign_pages() which allocates memory with page granularity. Using memalign() as before would still have allocated a full page. Signed-off-by:Alexandru Elisei <alexandru.elisei@arm.com>
Loading
Please register or sign in to comment