Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f15b9000 authored by Richard Weinberger's avatar Richard Weinberger
Browse files

um: Implement a custom pte_same() function



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.

CC: stable@kernel.org
Analyzed-by: default avatarHugh Dickins <hughd@google.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 62179d47
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -273,6 +273,12 @@ static inline void set_pte(pte_t *pteptr, pte_t pteval)
}
#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)

#define __HAVE_ARCH_PTE_SAME
static inline int pte_same(pte_t pte_a, pte_t pte_b)
{
	return !((pte_val(pte_a) ^ pte_val(pte_b)) & ~_PAGE_NEWPAGE);
}

/*
 * Conversion functions: convert a page and protection to a page entry,
 * and a page entry and page directory to the page they refer to.