linux/arch/s390/mm
Christophe Leroy a5e8131a03 arm64, powerpc, riscv, s390, x86: ptdump: refactor CONFIG_DEBUG_WX
All architectures using the core ptdump functionality also implement
CONFIG_DEBUG_WX, and they all do it more or less the same way, with a
function called debug_checkwx() that is called by mark_rodata_ro(), which
is a substitute to ptdump_check_wx() when CONFIG_DEBUG_WX is set and a
no-op otherwise.

Refactor by centrally defining debug_checkwx() in linux/ptdump.h and call
debug_checkwx() immediately after calling mark_rodata_ro() instead of
calling it at the end of every mark_rodata_ro().

On x86_32, mark_rodata_ro() first checks __supported_pte_mask has _PAGE_NX
before calling debug_checkwx().  Now the check is inside the callee
ptdump_walk_pgd_level_checkwx().

On powerpc_64, mark_rodata_ro() bails out early before calling
ptdump_check_wx() when the MMU doesn't have KERNEL_RO feature.  The check
is now also done in ptdump_check_wx() as it is called outside
mark_rodata_ro().

Link: https://lkml.kernel.org/r/a59b102d7964261d31ead0316a9f18628e4e7a8e.1706610398.git.christophe.leroy@csgroup.eu
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: "Aneesh Kumar K.V (IBM)" <aneesh.kumar@kernel.org>
Cc: Borislav Petkov (AMD) <bp@alien8.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: Greg KH <greg@kroah.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: "Naveen N. Rao" <naveen.n.rao@linux.ibm.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Phong Tran <tranmanphong@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Steven Price <steven.price@arm.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-02-22 10:24:47 -08:00
..
cmm.c S390: Remove now superfluous sentinel elem from ctl_table arrays 2023-10-10 15:22:02 -07:00
dump_pagetables.c arm64, powerpc, riscv, s390, x86: ptdump: refactor CONFIG_DEBUG_WX 2024-02-22 10:24:47 -08:00
extable.c s390: add support for DCACHE_WORD_ACCESS 2023-10-16 13:04:09 +02:00
extmem.c s390/extmem: improve reporting of -ERANGE error 2023-07-24 12:12:24 +02:00
fault.c s390/mm,fault: remove not needed tsk variable 2024-01-11 18:22:58 +01:00
gmap.c KVM: s390: vsie: fix race during shadow creation 2023-12-21 11:40:18 +01:00
hugetlbpage.c mm: hugetlb: add huge page size param to set_huge_pte_at() 2023-09-29 17:20:47 -07:00
init.c arm64, powerpc, riscv, s390, x86: ptdump: refactor CONFIG_DEBUG_WX 2024-02-22 10:24:47 -08:00
maccess.c s390/ctlreg: rename ctl_reg.h to ctlreg.h 2023-09-19 13:26:56 +02:00
Makefile s390/mm: move pfault code to own C file 2023-07-29 14:57:18 +02:00
mmap.c mm: move 'mmap_min_addr' logic from callers into vm_unmapped_area() 2023-04-21 14:52:05 -07:00
page-states.c s390/cmma: rework no-dat handling 2023-11-05 22:34:58 +01:00
pageattr.c s390/ctlreg: add struct ctlreg 2023-09-19 13:26:56 +02:00
pfault.c s390/pfault: use consistent comment style 2023-07-29 14:57:18 +02:00
pgalloc.c s390/mm: make pte_free_tlb() similar to pXd_free_tlb() 2023-11-05 22:34:58 +01:00
pgtable.c mm: convert mm_counter() to take a folio 2024-02-21 16:00:03 -08:00
vmem.c s390/mm: allocate vmemmap pages from self-contained memory range 2024-02-21 16:00:02 -08:00