diff options
author | Mike Rapoport <rppt@linux.ibm.com> | 2019-11-24 10:57:20 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-01-30 11:14:28 +0100 |
commit | 5637bc5048340456176fcd4c8986edc1ac1acbe1 (patch) | |
tree | 166c9b855d298204f44de91e93c22e5091a6b930 /arch/sparc/kernel/smp_64.c | |
parent | 9167bd96346473de5b61124f4589949fdf3026cf (diff) | |
download | linux-5637bc5048340456176fcd4c8986edc1ac1acbe1.tar.gz linux-5637bc5048340456176fcd4c8986edc1ac1acbe1.tar.bz2 linux-5637bc5048340456176fcd4c8986edc1ac1acbe1.zip |
sparc64: add support for folded p4d page tables
Implement primitives necessary for the 4th level folding, add walks of p4d
level where appropriate and replace 5level-fixup.h with pgtable-nop4d.h.
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/smp_64.c')
-rw-r--r-- | arch/sparc/kernel/smp_64.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c index a8275fea4b70..eb9455798338 100644 --- a/arch/sparc/kernel/smp_64.c +++ b/arch/sparc/kernel/smp_64.c @@ -1621,6 +1621,7 @@ static int __init pcpu_cpu_distance(unsigned int from, unsigned int to) static void __init pcpu_populate_pte(unsigned long addr) { pgd_t *pgd = pgd_offset_k(addr); + p4d_t *p4d; pud_t *pud; pmd_t *pmd; @@ -1633,7 +1634,17 @@ static void __init pcpu_populate_pte(unsigned long addr) pgd_populate(&init_mm, pgd, new); } - pud = pud_offset(pgd, addr); + p4d = p4d_offset(pgd, addr); + if (p4d_none(*p4d)) { + pud_t *new; + + new = memblock_alloc_from(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE); + if (!new) + goto err_alloc; + p4d_populate(&init_mm, p4d, new); + } + + pud = pud_offset(p4d, addr); if (pud_none(*pud)) { pmd_t *new; |