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/mm/fault_64.c | |
parent | 9167bd96346473de5b61124f4589949fdf3026cf (diff) | |
download | linux-stable-5637bc5048340456176fcd4c8986edc1ac1acbe1.tar.gz linux-stable-5637bc5048340456176fcd4c8986edc1ac1acbe1.tar.bz2 linux-stable-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/mm/fault_64.c')
-rw-r--r-- | arch/sparc/mm/fault_64.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/sparc/mm/fault_64.c b/arch/sparc/mm/fault_64.c index 2371fb6b97e4..8b7ddbd14b65 100644 --- a/arch/sparc/mm/fault_64.c +++ b/arch/sparc/mm/fault_64.c @@ -80,6 +80,7 @@ static void __kprobes bad_kernel_pc(struct pt_regs *regs, unsigned long vaddr) static unsigned int get_user_insn(unsigned long tpc) { pgd_t *pgdp = pgd_offset(current->mm, tpc); + p4d_t *p4dp; pud_t *pudp; pmd_t *pmdp; pte_t *ptep, pte; @@ -88,7 +89,10 @@ static unsigned int get_user_insn(unsigned long tpc) if (pgd_none(*pgdp) || unlikely(pgd_bad(*pgdp))) goto out; - pudp = pud_offset(pgdp, tpc); + p4dp = p4d_offset(pgdp, tpc); + if (p4d_none(*p4dp) || unlikely(p4d_bad(*p4dp))) + goto out; + pudp = pud_offset(p4dp, tpc); if (pud_none(*pudp) || unlikely(pud_bad(*pudp))) goto out; |