]> www.infradead.org Git - users/dwmw2/linux.git/commit
s390/mm: Simplify noexec page protection handling
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 9 Dec 2024 09:45:18 +0000 (10:45 +0100)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Tue, 17 Dec 2024 11:46:13 +0000 (12:46 +0100)
commitf8107a8be0b2e92798ded4aff45e3a94b763ce61
treed5cca1d91bc96a014f9dfba925d8028e1100f2e4
parentdb449b147cef0a210c61dc8840424456fbe45cc8
s390/mm: Simplify noexec page protection handling

By default page protection definitions like PAGE_RX have the _PAGE_NOEXEC
bit set. For older machines without the instruction execution protection
facility this bit is not allowed to be used in page table entries, and
therefore must be removed.

This is done at a couple of page table walkers, but also at some but not
all page table modification functions like ptep_modify_prot_commit(). Avoid
all of this and change the page, segment and region3 protection definitions
so that the noexec bit is masked out automatically if the instruction
execution-protection facility is not available. This is similar to what
also various other architectures do which had to solve the same problem.

Reviewed-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
arch/s390/boot/boot.h
arch/s390/boot/startup.c
arch/s390/boot/vmem.c
arch/s390/include/asm/pgtable.h
arch/s390/kernel/setup.c
arch/s390/mm/init.c
arch/s390/mm/mmap.c
arch/s390/mm/pageattr.c
arch/s390/mm/pgtable.c
arch/s390/mm/vmem.c