aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/fault-armv.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mm/fault-armv.c')
-rw-r--r--arch/arm/mm/fault-armv.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c
index fbfa26058442..a8ec97b4752e 100644
--- a/arch/arm/mm/fault-armv.c
+++ b/arch/arm/mm/fault-armv.c
@@ -37,7 +37,7 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address)
37 pgd_t *pgd; 37 pgd_t *pgd;
38 pmd_t *pmd; 38 pmd_t *pmd;
39 pte_t *pte, entry; 39 pte_t *pte, entry;
40 int ret = 0; 40 int ret;
41 41
42 pgd = pgd_offset(vma->vm_mm, address); 42 pgd = pgd_offset(vma->vm_mm, address);
43 if (pgd_none(*pgd)) 43 if (pgd_none(*pgd))
@@ -55,15 +55,19 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address)
55 entry = *pte; 55 entry = *pte;
56 56
57 /* 57 /*
58 * If this page is present, it's actually being shared.
59 */
60 ret = pte_present(entry);
61
62 /*
58 * If this page isn't present, or is already setup to 63 * If this page isn't present, or is already setup to
59 * fault (ie, is old), we can safely ignore any issues. 64 * fault (ie, is old), we can safely ignore any issues.
60 */ 65 */
61 if (pte_present(entry) && pte_val(entry) & shared_pte_mask) { 66 if (ret && pte_val(entry) & shared_pte_mask) {
62 flush_cache_page(vma, address, pte_pfn(entry)); 67 flush_cache_page(vma, address, pte_pfn(entry));
63 pte_val(entry) &= ~shared_pte_mask; 68 pte_val(entry) &= ~shared_pte_mask;
64 set_pte_at(vma->vm_mm, address, pte, entry); 69 set_pte_at(vma->vm_mm, address, pte, entry);
65 flush_tlb_page(vma, address); 70 flush_tlb_page(vma, address);
66 ret = 1;
67 } 71 }
68 pte_unmap(pte); 72 pte_unmap(pte);
69 return ret; 73 return ret;