diff options
author | Steve Capper <steve.capper@linaro.org> | 2013-04-19 10:49:31 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2013-04-25 12:45:52 -0400 |
commit | 4339e3f389081ea90e230a785bdbe10eccd02b71 (patch) | |
tree | cce5405ebcbdf63dd88da82e94b31afb606293a2 /arch | |
parent | f15a2a12d01573fcf9d2beb657f308845d55fc66 (diff) |
arm64: mm: Correct show_pte behaviour
show_pte makes use of the *_none_or_clear_bad style functions. If a
pgd, pud or pmd is identified as being bad, it will then be cleared.
As show_pte appears to be called from either the user or kernel
fault handlers this side effect can lead to unpredictable behaviour;
especially as TLB entries are not invalidated.
This patch removes the page table sanitisation from show_pte. If a
bad pgd, pud or pmd is encountered it is left unmodified.
Signed-off-by: Steve Capper <steve.capper@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm64/mm/fault.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index afadae6682ed..52638171d6fd 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c | |||
@@ -57,16 +57,16 @@ void show_pte(struct mm_struct *mm, unsigned long addr) | |||
57 | pmd_t *pmd; | 57 | pmd_t *pmd; |
58 | pte_t *pte; | 58 | pte_t *pte; |
59 | 59 | ||
60 | if (pgd_none_or_clear_bad(pgd)) | 60 | if (pgd_none(*pgd) || pgd_bad(*pgd)) |
61 | break; | 61 | break; |
62 | 62 | ||
63 | pud = pud_offset(pgd, addr); | 63 | pud = pud_offset(pgd, addr); |
64 | if (pud_none_or_clear_bad(pud)) | 64 | if (pud_none(*pud) || pud_bad(*pud)) |
65 | break; | 65 | break; |
66 | 66 | ||
67 | pmd = pmd_offset(pud, addr); | 67 | pmd = pmd_offset(pud, addr); |
68 | printk(", *pmd=%016llx", pmd_val(*pmd)); | 68 | printk(", *pmd=%016llx", pmd_val(*pmd)); |
69 | if (pmd_none_or_clear_bad(pmd)) | 69 | if (pmd_none(*pmd) || pmd_bad(*pmd)) |
70 | break; | 70 | break; |
71 | 71 | ||
72 | pte = pte_offset_map(pmd, addr); | 72 | pte = pte_offset_map(pmd, addr); |