aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/fault.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-11-21 11:27:49 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-02-21 14:24:14 -0500
commit516295e5ab4bf986865cfff856d484ec678e3b0b (patch)
tree2125f49635462fca18ac6d36ebf7363d3cc6d521 /arch/arm/mm/fault.c
parentf60892d3e36dcdd0d9f30db05beae7a446a93f28 (diff)
ARM: pgtable: add pud-level code
Add pud_offset() et.al. between the pgd and pmd code in preparation of using pgtable-nopud.h rather than 4level-fixup.h. This incorporates a fix from Jamie Iles <jamie@jamieiles.com> for uaccess_with_memcpy.c. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/fault.c')
-rw-r--r--arch/arm/mm/fault.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index ef0e24f578ef..bc0e1d88fd3b 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -80,6 +80,7 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
80 addr, (long long)pgd_val(*pgd)); 80 addr, (long long)pgd_val(*pgd));
81 81
82 do { 82 do {
83 pud_t *pud;
83 pmd_t *pmd; 84 pmd_t *pmd;
84 pte_t *pte; 85 pte_t *pte;
85 86
@@ -91,7 +92,19 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
91 break; 92 break;
92 } 93 }
93 94
94 pmd = pmd_offset(pgd, addr); 95 pud = pud_offset(pgd, addr);
96 if (PTRS_PER_PUD != 1)
97 printk(", *pud=%08lx", pud_val(*pud));
98
99 if (pud_none(*pud))
100 break;
101
102 if (pud_bad(*pud)) {
103 printk("(bad)");
104 break;
105 }
106
107 pmd = pmd_offset(pud, addr);
95 if (PTRS_PER_PMD != 1) 108 if (PTRS_PER_PMD != 1)
96 printk(", *pmd=%08llx", (long long)pmd_val(*pmd)); 109 printk(", *pmd=%08llx", (long long)pmd_val(*pmd));
97 110
@@ -390,6 +403,7 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
390{ 403{
391 unsigned int index; 404 unsigned int index;
392 pgd_t *pgd, *pgd_k; 405 pgd_t *pgd, *pgd_k;
406 pud_t *pud, *pud_k;
393 pmd_t *pmd, *pmd_k; 407 pmd_t *pmd, *pmd_k;
394 408
395 if (addr < TASK_SIZE) 409 if (addr < TASK_SIZE)
@@ -408,12 +422,19 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
408 422
409 if (pgd_none(*pgd_k)) 423 if (pgd_none(*pgd_k))
410 goto bad_area; 424 goto bad_area;
411
412 if (!pgd_present(*pgd)) 425 if (!pgd_present(*pgd))
413 set_pgd(pgd, *pgd_k); 426 set_pgd(pgd, *pgd_k);
414 427
415 pmd_k = pmd_offset(pgd_k, addr); 428 pud = pud_offset(pgd, addr);
416 pmd = pmd_offset(pgd, addr); 429 pud_k = pud_offset(pgd_k, addr);
430
431 if (pud_none(*pud_k))
432 goto bad_area;
433 if (!pud_present(*pud))
434 set_pud(pud, *pud_k);
435
436 pmd = pmd_offset(pud, addr);
437 pmd_k = pmd_offset(pud_k, addr);
417 438
418 /* 439 /*
419 * On ARM one Linux PGD entry contains two hardware entries (see page 440 * On ARM one Linux PGD entry contains two hardware entries (see page