linux-stable/arch/sh
David Hildenbrand cca10df102 sh/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE
Let's support __HAVE_ARCH_PTE_SWP_EXCLUSIVE by using bit 6 in the PTE,
reducing the swap type in the !CONFIG_X2TLB case to 5 bits.  Generic MM
currently only uses 5 bits for the type (MAX_SWAPFILES_SHIFT), so the
stolen bit is effectively unused.

Interrestingly, the swap type in the !CONFIG_X2TLB case could currently
overlap with the _PAGE_PRESENT bit, because there is a sneaky shift by 1
in __pte_to_swp_entry() and __swp_entry_to_pte().  Bit 0-7 in the
architecture specific swap PTE would get shifted to bit 1-8 in the PTE. 
As generic MM uses 5 bits only, this didn't matter so far.

While at it, mask the type in __swp_entry().

Link: https://lkml.kernel.org/r/20230113171026.582290-21-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-02-02 22:33:10 -08:00
..
boards mmc: sh_mmcif: move platform_data header to proper location 2022-04-26 14:05:21 +02:00
boot mmc: sh_mmcif: move platform_data header to proper location 2022-04-26 14:05:21 +02:00
cchips treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
configs USB/Thunderbolt driver changes for 6.2-rc1 2022-12-16 03:22:53 -08:00
drivers treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
include sh/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE 2023-02-02 22:33:10 -08:00
kernel sh: define RUNTIME_DISCARD_EXIT 2023-01-31 16:44:09 -08:00
lib sh: propage the calling conventions change down to csum_partial_copy_generic() 2020-08-20 15:45:18 -04:00
math-emu sh: fix READ/WRITE redefinition warnings 2021-10-27 16:51:32 -04:00
mm arch: mm: rename FORCE_MAX_ZONEORDER to ARCH_FORCE_MAX_ORDER 2022-09-11 20:25:56 -07:00
tools sh: Remove SH5-based Cayman platform 2020-08-14 22:05:06 -04:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig mm: Rename GUP_GET_PTE_LOW_HIGH 2022-12-15 10:37:27 -08:00
Kconfig.cpu docs: sh: convert register-banks.txt to ReST 2020-06-19 14:10:13 -06:00
Kconfig.debug sh: fix kconfig unmet dependency warning for FRAME_POINTER 2021-10-27 16:51:01 -04:00
Makefile kbuild: remove head-y syntax 2022-10-02 18:06:03 +09:00