powerpc/book3s: Use config independent helpers for page table walk

Even when we have HugeTLB and THP disabled, kernel linear map can still be
mapped with hugepages. This is only an issue with radix translation because hash
MMU doesn't map kernel linear range in linux page table and other kernel
map areas are not mapped using hugepage.

Add config independent helpers and put WARN_ON() when we don't expect things
to be mapped via hugepages.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
Aneesh Kumar K.V
2019-05-14 11:33:00 +05:30
committed by Michael Ellerman
parent 259a948c4b
commit d6eacedd1f
9 changed files with 102 additions and 33 deletions

View File

@@ -3098,7 +3098,7 @@ static void show_pte(unsigned long addr)
printf("pgd @ 0x%px\n", pgdir);
if (pgd_huge(*pgdp)) {
if (pgd_is_leaf(*pgdp)) {
format_pte(pgdp, pgd_val(*pgdp));
return;
}
@@ -3111,7 +3111,7 @@ static void show_pte(unsigned long addr)
return;
}
if (pud_huge(*pudp)) {
if (pud_is_leaf(*pudp)) {
format_pte(pudp, pud_val(*pudp));
return;
}
@@ -3125,7 +3125,7 @@ static void show_pte(unsigned long addr)
return;
}
if (pmd_huge(*pmdp)) {
if (pmd_is_leaf(*pmdp)) {
format_pte(pmdp, pmd_val(*pmdp));
return;
}