Mark a page with _PAGE_NEWPROT on pte_mkold() to get it remapped not-readable
on the host when it is not marked as accessed, to be able to emulate correctly
the accessed bit.
This patch, as said in the comment for the previous one (fixing this for
pte_mkclean()) should be merged only after benchmarking, since the additional
costs for the read faults are very big (a lot bigger than on the host).
Possibly, increasing the timeout for scanning pages and marking them as
accessed could be useful for us.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@...>
linux-2.6.git-paolo/include/asm-um/pgtable.h | 3 +++
1 files changed, 3 insertions(+)
diff -puN include/asm-um/pgtable.h~uml-fix-tlb-flushing-accessed include/asm-um/pgtable.h
--- linux-2.6.git/include/asm-um/pgtable.h~uml-fix-tlb-flushing-accessed 2005-07-28 20:53:57.000000000 +0200
+++ linux-2.6.git-paolo/include/asm-um/pgtable.h 2005-07-28 20:53:57.000000000 +0200
@@ -268,6 +268,9 @@ static inline pte_t pte_mkclean(pte_t pt
static inline pte_t pte_mkold(pte_t pte)
+ /* We want that next flush makes this page again not-readable, so we'll
+ * mark it as accessed again */
+ pte_set_bits(pte, _PAGE_NEWPROT);