From d50349b0c397407458ea8c57aee765d158e6f9ee Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 24 Apr 2012 02:37:07 -0400 Subject: um: add TIF_NOTIFY_RESUME Signed-off-by: Al Viro --- arch/um/include/asm/thread_info.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/um/include/asm') diff --git a/arch/um/include/asm/thread_info.h b/arch/um/include/asm/thread_info.h index 200c4ab1240c..6d85ebb860fd 100644 --- a/arch/um/include/asm/thread_info.h +++ b/arch/um/include/asm/thread_info.h @@ -71,6 +71,7 @@ static inline struct thread_info *current_thread_info(void) #define TIF_MEMDIE 5 /* is terminating due to OOM killer */ #define TIF_SYSCALL_AUDIT 6 #define TIF_RESTORE_SIGMASK 7 +#define TIF_NOTIFY_RESUME 8 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) -- cgit v1.2.3 From c6802f4370510fa8674674f11c5578ee057d1d63 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 21 May 2012 14:22:25 -0400 Subject: um: bury unused _TIF_RESTORE_SIGMASK Signed-off-by: Al Viro --- arch/um/include/asm/thread_info.h | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/um/include/asm') diff --git a/arch/um/include/asm/thread_info.h b/arch/um/include/asm/thread_info.h index 6d85ebb860fd..c04e5ab68f56 100644 --- a/arch/um/include/asm/thread_info.h +++ b/arch/um/include/asm/thread_info.h @@ -79,6 +79,5 @@ static inline struct thread_info *current_thread_info(void) #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) #define _TIF_MEMDIE (1 << TIF_MEMDIE) #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) -#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) #endif -- cgit v1.2.3 From f15b9000eb1d09bbaa4b0a6b2089d7e1f64e84b3 Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Sat, 14 Apr 2012 17:29:30 +0200 Subject: 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: Hugh Dickins Signed-off-by: Richard Weinberger --- arch/um/include/asm/pgtable.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/um/include/asm') diff --git a/arch/um/include/asm/pgtable.h b/arch/um/include/asm/pgtable.h index 6a3f9845743e..294254e13a35 100644 --- a/arch/um/include/asm/pgtable.h +++ b/arch/um/include/asm/pgtable.h @@ -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. -- cgit v1.2.3 From 2b76ebaa728f8a3967c52aa189261c72fe56a6f1 Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Sat, 14 Apr 2012 17:46:01 +0200 Subject: um: Fix __swp_type() The current __swp_type() function uses a too small bitshift. Using more than one swap files causes bad pages because the type bits clash with other page flags. CC: stable@kernel.org Analyzed-by: Hugh Dickins Signed-off-by: Richard Weinberger --- arch/um/include/asm/pgtable.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/um/include/asm') diff --git a/arch/um/include/asm/pgtable.h b/arch/um/include/asm/pgtable.h index 294254e13a35..5888f1b83477 100644 --- a/arch/um/include/asm/pgtable.h +++ b/arch/um/include/asm/pgtable.h @@ -354,11 +354,11 @@ extern pte_t *virt_to_pte(struct mm_struct *mm, unsigned long addr); #define update_mmu_cache(vma,address,ptep) do ; while (0) /* Encode and de-code a swap entry */ -#define __swp_type(x) (((x).val >> 4) & 0x3f) +#define __swp_type(x) (((x).val >> 5) & 0x1f) #define __swp_offset(x) ((x).val >> 11) #define __swp_entry(type, offset) \ - ((swp_entry_t) { ((type) << 4) | ((offset) << 11) }) + ((swp_entry_t) { ((type) << 5) | ((offset) << 11) }) #define __pte_to_swp_entry(pte) \ ((swp_entry_t) { pte_val(pte_mkuptodate(pte)) }) #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) -- cgit v1.2.3