From: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
When unmapping linear but non uniform VMA's in try_to_unmap_one, we must
encode the prots in the PTE.
However, we shouldn't use the generic set_nonlinear_pte() function as it
allows for nonlinear offsets, on which we should instead BUG() in this code
path.
Additionally, add a missing TLB flush in both locations. However, there'is
some excess of flushes in these functions.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
---
linux-2.6.git-paolo/mm/rmap.c | 5 +++++
1 files changed, 5 insertions(+)
diff -puN mm/rmap.c~rfp-fix-unmap-linear mm/rmap.c
--- linux-2.6.git/mm/rmap.c~rfp-fix-unmap-linear 2005-08-11
23:07:12.000000000 +0200
+++ linux-2.6.git-paolo/mm/rmap.c 2005-08-11 23:07:12.000000000 +0200
@@ -543,6 +543,10 @@ static int try_to_unmap_one(struct page
flush_cache_page(vma, address, page_to_pfn(page));
pteval = ptep_clear_flush(vma, address, pte);
+ /* If nonlinear, store the file page offset in the pte. */
+ set_nonlinear_pte(pteval, pte, vma, mm, page, address);
+ flush_tlb_page(vma, address);
+
/* Move the dirty bit to the physical page now the pte is gone. */
if (pte_dirty(pteval))
set_page_dirty(page);
@@ -661,6 +665,7 @@ static void try_to_unmap_cluster(unsigne
/* If nonlinear, store the file page offset in the pte. */
set_nonlinear_pte(pteval, pte, vma, mm, page, address);
+ flush_tlb_page(vma, address);
/* Move the dirty bit to the physical page now the pte is gone.
*/
if (pte_dirty(pteval))
_
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel