aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2014-10-28 13:16:28 -0700
committerBen Hutchings <ben@decadent.org.uk>2014-12-14 16:23:52 +0000
commitbfcd39f007a988a6e7df35e1e144f46aae7a9188 (patch)
tree023a84404d0a03a32ffbe694c1c41659308bf4dc /mm
parent8e489bc711592f85edf3d2c8f3e62b989f5a418b (diff)
downloadkernel_samsung_smdk4412-bfcd39f007a988a6e7df35e1e144f46aae7a9188.zip
kernel_samsung_smdk4412-bfcd39f007a988a6e7df35e1e144f46aae7a9188.tar.gz
kernel_samsung_smdk4412-bfcd39f007a988a6e7df35e1e144f46aae7a9188.tar.bz2
zap_pte_range: update addr when forcing flush after TLB batching faiure
commit ce9ec37bddb633404a0c23e1acb181a264e7f7f2 upstream. When unmapping a range of pages in zap_pte_range, the page being unmapped is added to an mmu_gather_batch structure for asynchronous freeing. If we run out of space in the batch structure before the range has been completely unmapped, then we break out of the loop, force a TLB flush and free the pages that we have batched so far. If there are further pages to unmap, then we resume the loop where we left off. Unfortunately, we forget to update addr when we break out of the loop, which causes us to truncate the range being invalidated as the end address is exclusive. When we re-enter the loop at the same address, the page has already been freed and the pte_present test will fail, meaning that we do not reconsider the address for invalidation. This patch fixes the problem by incrementing addr by the PAGE_SIZE before breaking out of the loop on batch failure. Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> [bwh: Backported to 3.2: adjust context; add braces] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'mm')
-rw-r--r--mm/memory.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 483e665..5a7f314 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1178,8 +1178,10 @@ again:
if (unlikely(page_mapcount(page) < 0))
print_bad_pte(vma, addr, ptent, page);
force_flush = !__tlb_remove_page(tlb, page);
- if (force_flush)
+ if (force_flush) {
+ addr += PAGE_SIZE;
break;
+ }
continue;
}
/*