powerpc/mm: Make page table size a variable
Radix and hash MMU models support different page table sizes. Make the #defines a variable so that existing code can work with variable sizes. Slice related code is only used by hash, so use hash constants there. We will replicate some of the boundary conditions with resepct to TASK_SIZE using radix values too. Right now we do boundary condition check using hash constants. Swapper pgdir size is initialized in asm code. We select the max pgd size to keep it simple. For now we select hash pgdir. When adding radix we will switch that to radix pgdir which is 64K. BUILD_BUG_ON check which is removed is already done in hugepage_init() using MAYBE_BUILD_BUG_ON(). Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:

committed by
Michael Ellerman

parent
13f829a5a1
commit
dd1842a2a4
@@ -870,6 +870,18 @@ static void __init htab_initialize(void)
|
||||
|
||||
void __init early_init_mmu(void)
|
||||
{
|
||||
/*
|
||||
* initialize page table size
|
||||
*/
|
||||
__pte_index_size = H_PTE_INDEX_SIZE;
|
||||
__pmd_index_size = H_PMD_INDEX_SIZE;
|
||||
__pud_index_size = H_PUD_INDEX_SIZE;
|
||||
__pgd_index_size = H_PGD_INDEX_SIZE;
|
||||
__pmd_cache_index = H_PMD_CACHE_INDEX;
|
||||
__pte_table_size = H_PTE_TABLE_SIZE;
|
||||
__pmd_table_size = H_PMD_TABLE_SIZE;
|
||||
__pud_table_size = H_PUD_TABLE_SIZE;
|
||||
__pgd_table_size = H_PGD_TABLE_SIZE;
|
||||
/* Initialize the MMU Hash table and create the linear mapping
|
||||
* of memory. Has to be done before SLB initialization as this is
|
||||
* currently where the page size encoding is obtained.
|
||||
|
Reference in New Issue
Block a user