From: David Hildenbrand Subject: x86-pgtable-support-__have_arch_pte_swp_exclusive-fix Looks like I ignored that 32bit uses a different (undocumented) swap layout and bit 3 falls into the swp type. We'll restrict this to x86-64 for now, just like for the other architectures. Link: https://lkml.kernel.org/r/d875c292-46b3-f281-65ae-71d0b0c6f592@redhat.com Signed-off-by: David Hildenbrand Signed-off-by: Andrew Morton --- arch/x86/include/asm/pgtable.h | 3 ++- arch/x86/include/asm/pgtable_64_types.h | 5 +++++ arch/x86/include/asm/pgtable_types.h | 5 ----- 3 files changed, 7 insertions(+), 6 deletions(-) --- a/arch/x86/include/asm/pgtable_64_types.h~x86-pgtable-support-__have_arch_pte_swp_exclusive-fix +++ a/arch/x86/include/asm/pgtable_64_types.h @@ -163,4 +163,9 @@ extern unsigned int ptrs_per_p4d; #define PGD_KERNEL_START ((PAGE_SIZE / 2) / sizeof(pgd_t)) +/* + * We borrow bit 3 to remember PG_anon_exclusive. + */ +#define _PAGE_SWP_EXCLUSIVE _PAGE_PWT + #endif /* _ASM_X86_PGTABLE_64_DEFS_H */ --- a/arch/x86/include/asm/pgtable.h~x86-pgtable-support-__have_arch_pte_swp_exclusive-fix +++ a/arch/x86/include/asm/pgtable.h @@ -1291,7 +1291,7 @@ static inline void update_mmu_cache_pud( unsigned long addr, pud_t *pud) { } - +#ifdef _PAGE_SWP_EXCLUSIVE #define __HAVE_ARCH_PTE_SWP_EXCLUSIVE static inline pte_t pte_swp_mkexclusive(pte_t pte) { @@ -1307,6 +1307,7 @@ static inline pte_t pte_swp_clear_exclus { return pte_clear_flags(pte, _PAGE_SWP_EXCLUSIVE); } +#endif /* _PAGE_SWP_EXCLUSIVE */ #ifdef CONFIG_HAVE_ARCH_SOFT_DIRTY static inline pte_t pte_swp_mksoft_dirty(pte_t pte) --- a/arch/x86/include/asm/pgtable_types.h~x86-pgtable-support-__have_arch_pte_swp_exclusive-fix +++ a/arch/x86/include/asm/pgtable_types.h @@ -84,11 +84,6 @@ #endif /* - * We borrow bit 3 to remember PG_anon_exclusive. - */ -#define _PAGE_SWP_EXCLUSIVE _PAGE_PWT - -/* * Tracking soft dirty bit when a page goes to a swap is tricky. * We need a bit which can be stored in pte _and_ not conflict * with swap entry format. On x86 bits 1-4 are *not* involved _