xtensa/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE
authorDavid Hildenbrand <david@redhat.com>
Fri, 13 Jan 2023 17:10:25 +0000 (18:10 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 3 Feb 2023 06:33:11 +0000 (22:33 -0800)
commitf5c3fe300c5b40ff9af5ce2c9dd9897e91ce5735
tree361214b118d6b89ec73e790b985128cb18a41570
parent93c0eac40d4e3ce4d5a3c6e0dc74eceaf8f63e0d
xtensa/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE

Let's support __HAVE_ARCH_PTE_SWP_EXCLUSIVE by using bit 1.  This bit
should be safe to use for our usecase.

Most importantly, we can still distinguish swap PTEs from PAGE_NONE PTEs
(see pte_present()) and don't use one of the two reserved attribute masks
(1101 and 1111).  Attribute mask 1100 and 1110 now identify swap PTEs.

While at it, remove SWP_TYPE_BITS (not really helpful as it's not used in
the actual swap macros) and mask the type in __swp_entry().

Link: https://lkml.kernel.org/r/20230113171026.582290-26-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/xtensa/include/asm/pgtable.h