summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2004-02-06 14:00:29 +1100
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2004-02-06 14:00:29 +1100
commitf74710a0bfb50dedac27e544faf8b7b418ff9008 (patch)
tree1a9fd2b57b358c4ed5f752a89ac801a47298eb26 /include
parentc380a04843bba969ea48a3b54b8e4fcaa7427297 (diff)
ppc32: Flush the Hash PTE in ptep_test_and_clear_young()
Without this, page aging is broken on ppc32
Diffstat (limited to 'include')
-rw-r--r--include/asm-ppc/pgtable.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h
index 0cf6aab40dfb..8ac2de22eadd 100644
--- a/include/asm-ppc/pgtable.h
+++ b/include/asm-ppc/pgtable.h
@@ -511,9 +511,21 @@ static inline void set_pte(pte_t *ptep, pte_t pte)
#endif
}
+extern void flush_hash_one_pte(pte_t *ptep);
+
+/*
+ * 2.6 calles this without flushing the TLB entry, this is wrong
+ * for our hash-based implementation, we fix that up here
+ */
static inline int ptep_test_and_clear_young(pte_t *ptep)
{
- return (pte_update(ptep, _PAGE_ACCESSED, 0) & _PAGE_ACCESSED) != 0;
+ unsigned long old;
+ old = (pte_update(ptep, _PAGE_ACCESSED, 0) & _PAGE_ACCESSED);
+#if _PAGE_HASHPTE != 0
+ if (old & _PAGE_HASHPTE)
+ flush_hash_one_pte(ptep);
+#endif
+ return old != 0;
}
static inline int ptep_test_and_clear_dirty(pte_t *ptep)