[uml-devel] [patch 23/39] remap_file_pages protection support: fix try_to_unmap_one for VM_NONUNIFORM vma's

DORMANTno replies

From: <hidden>
Date: 2005-08-12 18:49:14
Also in: lkml

From: Paolo 'Blaisorblade' Giarrusso <redacted>

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 <redacted>
---

 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help