linux/arch
Gerald Schaefer f934f6be76 s390/mm: Introduce region-third and segment table swap entries
Introduce region-third (PUD) and segment table (PMD) swap entries, and
make hugetlbfs RSTE <-> PTE conversion code aware of them, so that they
can be used for hugetlbfs PTE_MARKER entries. Future work could also
build on this to enable THP_SWAP and THP_MIGRATION for s390.

Similar to PTE swap entries, bits 0-51 can be used to store the swap
offset, but bits 57-61 cannot be used for swap type because that overlaps
with the INVALID and TABLE TYPE bits. PMD/PUD swap entries must be invalid,
and have a correct table type so that pud_folded() check still works.

Bits 53-57 can be used for swap type, but those include the PROTECT bit.
So unlike swap PTEs, the PROTECT bit cannot be used to mark the swap entry.
Use the "Common-Segment/Region" bit 59 instead for that.

Also remove the !MACHINE_HAS_NX check in __set_huge_pte_at(). Otherwise,
that would clear the _SEGMENT_ENTRY_NOEXEC bit also for swap entries, where
it is used for encoding the swap type. The architecture only requires this
bit to be 0 for PTEs, with !MACHINE_HAS_NX, not for segment or region-third
entries. And the check is also redundant, because after __pte_to_rste()
conversion, for non-swap PTEs it would only be set if it was already set in
the PTE, which should never be the case for !MACHINE_HAS_NX.

This is a prerequisite for hugetlbfs PTE_MARKER support on s390, which
is needed to fix a regression introduced with commit 8a13897fb0
("mm: userfaultfd: support UFFDIO_POISON for hugetlbfs"). That commit
depends on the availability of swap entries for hugetlbfs, which were
not available for s390 so far.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2024-11-27 12:55:21 +01:00
..
alpha sanitize xattr and io_uring interactions with it, 2024-11-18 12:44:25 -08:00
arc move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
arm Performance events changes for v6.13: 2024-11-19 13:34:06 -08:00
arm64 Performance events changes for v6.13: 2024-11-19 13:34:06 -08:00
csky mm: make arch_get_unmapped_area() take vm_flags by default 2024-09-09 16:39:13 -07:00
hexagon hexagon: vdso: Fix build failure 2024-09-23 08:17:50 -07:00
loongarch 10 hotfixes, 7 of which are cc:stable. All singletons, please see the 2024-11-16 16:00:38 -08:00
m68k m68k updates for v6.13 2024-11-18 18:00:18 -08:00
microblaze sanitize xattr and io_uring interactions with it, 2024-11-18 12:44:25 -08:00
mips just cleanups and fixes 2024-11-18 17:48:39 -08:00
nios2 move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
openrisc
parisc sanitize xattr and io_uring interactions with it, 2024-11-18 12:44:25 -08:00
powerpc Performance events changes for v6.13: 2024-11-19 13:34:06 -08:00
riscv Scheduler changes for v6.13: 2024-11-19 14:16:06 -08:00
s390 s390/mm: Introduce region-third and segment table swap entries 2024-11-27 12:55:21 +01:00
sh sanitize xattr and io_uring interactions with it, 2024-11-18 12:44:25 -08:00
sparc sanitize xattr and io_uring interactions with it, 2024-11-18 12:44:25 -08:00
um move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
x86 Scheduler changes for v6.13: 2024-11-19 14:16:06 -08:00
xtensa sanitize xattr and io_uring interactions with it, 2024-11-18 12:44:25 -08:00
.gitignore
Kconfig Performance events changes for v6.13: 2024-11-19 13:34:06 -08:00