aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2012-04-14 11:29:30 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-01 03:12:55 -0400
commita044b505aa0048922b5276a2ac653ef62605beb0 (patch)
tree8e6590f76c87ef4cac033c690be863b4fb31cbff
parentec58eb2b33386d25c4f68b42a9bf9893ddc6db1a (diff)
um: Implement a custom pte_same() function
commit f15b9000eb1d09bbaa4b0a6b2089d7e1f64e84b3 upstream. UML uses the _PAGE_NEWPAGE flag to mark pages which are not jet installed on the host side using mmap(). pte_same() has to ignore this flag, otherwise unuse_pte_range() is unable to unuse the page because two identical page tables entries with different _PAGE_NEWPAGE flags would not match and swapoff() would never return. Analyzed-by: Hugh Dickins <hughd@google.com> Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/um/include/asm/pgtable.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/um/include/asm/pgtable.h b/arch/um/include/asm/pgtable.h
index ad1764d7ae2..aa365c55ecf 100644
--- a/arch/um/include/asm/pgtable.h
+++ b/arch/um/include/asm/pgtable.h
@@ -271,6 +271,12 @@ static inline void set_pte(pte_t *pteptr, pte_t pteval)
271} 271}
272#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) 272#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
273 273
274#define __HAVE_ARCH_PTE_SAME
275static inline int pte_same(pte_t pte_a, pte_t pte_b)
276{
277 return !((pte_val(pte_a) ^ pte_val(pte_b)) & ~_PAGE_NEWPAGE);
278}
279
274/* 280/*
275 * Conversion functions: convert a page and protection to a page entry, 281 * Conversion functions: convert a page and protection to a page entry,
276 * and a page entry and page directory to the page they refer to. 282 * and a page entry and page directory to the page they refer to.