linux/arch/s390/mm
Heiko Carstens 33123ff9cb s390/mm: Simplify crst_table_upgrade()
In case of an upgrade from four to five level page tables, and a failing
pgd allocation, the exit path of crst_table_upgrade() would incorrectly
dereference the p4d NULL pointer via pagetable_dtor().

Address this by reworking crst_table_upgrade(), which basically is a
revert of [1]. Take into account that GFP_KERNEL order-2 allocation
failures are very unlikely. Therefore keep the code as simple as
possible:

In case of an upgrade from three to five levels, and an allocation
failure of the fifth page table level, keep the upgrade to four levels
instead of reverting back to three levels. This allows to keep error
handling minimal.

[1] commit 31932757c6 ("s390/mm: optimize page table upgrade routine")

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2026-09-01 12:44:48 +02:00
..
cmm.c s390: Remove cond_resched() calls 2026-08-05 15:16:54 +02:00
dump_pagetables.c s390 updates for 6.19 merge window 2025-12-02 16:37:00 -08:00
extable.c s390: Add support for DCACHE_WORD_ACCESS (again) 2026-07-30 00:29:11 +02:00
extmem.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fault.c s390/mm: Add __context_unsafe() attribute to do_secure_storage_access() 2026-08-11 16:42:18 +02:00
gmap_helpers.c mm.git review status for linus..mm-stable 2026-08-27 09:17:06 -07:00
hugetlbpage.c s390/mm: Use set_pmd() / set_pud() for hugetlb pagetable entries 2026-07-08 17:03:28 +02:00
init.c dma-mapping updates for Linux 7.3: 2026-08-24 11:35:46 -07:00
maccess.c s390/maccess: Use proper PTE accessors for copying old memory 2026-07-30 00:29:09 +02:00
Makefile s390: Enable CONTEXT_ANALYSIS for various directories 2026-08-11 16:42:18 +02:00
mmap.c s390/mm: Fix type mismatch in get_align_mask(). 2026-07-08 17:02:47 +02:00
page-states.c KVM: s390: KVM page table management functions: allocation 2026-02-04 17:00:09 +01:00
pageattr.c s390: Remove cond_resched() calls 2026-08-05 15:16:54 +02:00
pfault.c s390/pfault: Fix virtual vs physical address confusion 2026-02-25 17:00:25 +01:00
pgalloc.c s390/mm: Simplify crst_table_upgrade() 2026-09-01 12:44:48 +02:00
pgtable.c KVM: S390: Remove PGSTE code from linux/s390 mm 2026-02-04 17:00:10 +01:00
physaddr.c s390/mm: provide simple ARCH_HAS_DEBUG_VIRTUAL support 2024-03-13 09:23:49 +01:00
vmem.c s390/mm: use free_reserved_pages() in vmem_free_pages() 2026-08-04 19:18:41 -07:00