diff options
author | Peter Zijlstra <peterz@infradead.org> | 2020-01-31 13:45:40 +0100 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2020-02-10 10:57:48 +0100 |
commit | 518a6b58243aff43361c1f027697dfe5a89cbc4f (patch) | |
tree | a6f9e65e96f699ffdc91a6ed0d5d0643f2c6a5e7 /arch/m68k | |
parent | 0e071ee6815692a3b241bbe9a9a29f7cdec023ed (diff) |
m68k: mm: Fully initialize the page-table allocator
Also iterate the PMD tables to populate the PTE table allocator. This
also fully replaces the previous zero_pgtable hack.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Will Deacon <will@kernel.org>
Acked-by: Greg Ungerer <gerg@linux-m68k.org>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Tested-by: Greg Ungerer <gerg@linux-m68k.org>
Link: https://lore.kernel.org/r/20200131125403.938797587@infradead.org
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/mm/init.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c index 3e3a74a5b215..b88d510d4fe3 100644 --- a/arch/m68k/mm/init.c +++ b/arch/m68k/mm/init.c @@ -120,7 +120,7 @@ void free_initmem(void) static inline void init_pointer_tables(void) { #if defined(CONFIG_MMU) && !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE) - int i; + int i, j; /* insert pointer tables allocated so far into the tablelist */ init_pointer_table(kernel_pg_dir, TABLE_PGD); @@ -133,6 +133,17 @@ static inline void init_pointer_tables(void) pmd_dir = (pmd_t *)pgd_page_vaddr(kernel_pg_dir[i]); init_pointer_table(pmd_dir, TABLE_PMD); + + for (j = 0; j < PTRS_PER_PMD; j++) { + pmd_t *pmd = &pmd_dir[j]; + pte_t *pte_dir; + + if (!pmd_present(*pmd)) + continue; + + pte_dir = (pte_t *)__pmd_page(*pmd); + init_pointer_table(pte_dir, TABLE_PTE); + } } #endif } |