powerpc-pgtable-support-__have_arch_pte_swp_exclusive-for-book3s.patch removed from -mm tree
The quilt patch titled
Subject: powerpc/pgtable: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE for book3s
has been removed from the -mm tree. Its filename was
powerpc-pgtable-support-__have_arch_pte_swp_exclusive-for-book3s.patch
This patch was dropped because it was merged into mm-stable
------------------------------------------------------
From: David Hildenbrand <[email protected]>
Subject: powerpc/pgtable: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE for book3s
Right now, the last 5 bits (0x1f) of the swap entry are used for the type and the bit before that (0x20) is used for _PAGE_SWP_SOFT_DIRTY. We cannot use 0x40, as that collides with _RPAGE_RSV1 -- contained in _PAGE_HPTEFLAGS. The next candidate would be _RPAGE_SW3 (0x200) -- which is used for _PAGE_SOFT_DIRTY for !swp ptes.
So let's just use _PAGE_SOFT_DIRTY for _PAGE_SWP_SOFT_DIRTY (to make it easier to grasp) and use 0x20 now for _PAGE_SWP_EXCLUSIVE.
---
arch/powerpc/include/asm/book3s/64/pgtable.h | 21 ++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
arch/powerpc/include/asm/book3s/64/pgtable.h renamed from arch/powerpc/include/asm/book3s/64/pgtable.h~powerpc-pgtable-support-__have_arch_pte_swp_exclusive-for-book3s +20 -1
@@ -752,6 +752,7 @@ static inline pte_t pte_modify(pte_t pte*/ \BUILD_BUG_ON (_PAGE_HPTEFLAGS &SWP_TYPE_MASK ); \BUILD_BUG_ON (_PAGE_HPTEFLAGS & _PAGE_SWP_SOFT_DIRTY); \ +BUILD_BUG_ON (_PAGE_HPTEFLAGS & _PAGE_SWP_EXCLUSIVE); \ } while (0)#define SWP_TYPE_BITS 5
@@ -772,11 +773,13 @@ static inline pte_t pte_modify(pte_t pte#define __swp_entry_to_pmd (x) (pte_pmd(__swp_entry_to_pte(x)))#ifdef CONFIG_MEM_SOFT_DIRTY -#define _PAGE_SWP_SOFT_DIRTY _PAGE_NON_IDEMPOTENT +#define _PAGE_SWP_SOFT_DIRTY _PAGE_SOFT_DIRTY#else #define _PAGE_SWP_SOFT_DIRTY 0UL#endif /* CONFIG_MEM_SOFT_DIRTY */ +#define _PAGE_SWP_EXCLUSIVE _PAGE_NON_IDEMPOTENT +#ifdef CONFIG_HAVE_ARCH_SOFT_DIRTY static inline pte_t pte_swp_mksoft_dirty (pte_t pte) {
@@ -794,6 +797,22 @@ static inline pte_t pte_swp_clear_soft_d }#endif /* CONFIG_HAVE_ARCH_SOFT_DIRTY */ +#define __HAVE_ARCH_PTE_SWP_EXCLUSIVE +static inline pte_t pte_swp_mkexclusive (pte_t pte) +{ +return __pte_raw (pte_raw (pte) |cpu_to_be64 (_PAGE_SWP_EXCLUSIVE)); +} + +static inline int pte_swp_exclusive (pte_t pte) +{ +return !!(pte_raw (pte) &cpu_to_be64 (_PAGE_SWP_EXCLUSIVE)); +} + +static inline pte_t pte_swp_clear_exclusive (pte_t pte) +{ +return __pte_raw (pte_raw (pte) &cpu_to_be64 (~_PAGE_SWP_EXCLUSIVE)); +} +static inline bool check_pte_access (unsigned long access,unsigned long ptev) {/*
_
Patches currently in -mm which might be from [email protected] are