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>
This commit is contained in:

committed by
David S. Miller

parent
9167bd9634
commit
5637bc5048
@@ -299,6 +299,7 @@ static void flush_signal_insns(unsigned long address)
|
||||
unsigned long pstate, paddr;
|
||||
pte_t *ptep, pte;
|
||||
pgd_t *pgdp;
|
||||
p4d_t *p4dp;
|
||||
pud_t *pudp;
|
||||
pmd_t *pmdp;
|
||||
|
||||
@@ -318,7 +319,10 @@ static void flush_signal_insns(unsigned long address)
|
||||
pgdp = pgd_offset(current->mm, address);
|
||||
if (pgd_none(*pgdp))
|
||||
goto out_irqs_on;
|
||||
pudp = pud_offset(pgdp, address);
|
||||
p4dp = p4d_offset(pgdp, address);
|
||||
if (p4d_none(*p4dp))
|
||||
goto out_irqs_on;
|
||||
pudp = pud_offset(p4dp, address);
|
||||
if (pud_none(*pudp))
|
||||
goto out_irqs_on;
|
||||
pmdp = pmd_offset(pudp, address);
|
||||
|
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user