s390/vmem: Support 2G page splitting for KASAN shadow freeing
authorVasily Gorbik <gor@linux.ibm.com>
Fri, 28 Nov 2025 22:01:05 +0000 (23:01 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Sun, 7 Dec 2025 15:15:19 +0000 (16:15 +0100)
commit6a35d02fec5a1e2ab6c0c94ccc5b0c57a580b098
treeb52b25e9b8bfc537485330acd65b05777766f8b1
parent1442bb87b878f889442c7e8e83d9125e31ef5072
s390/vmem: Support 2G page splitting for KASAN shadow freeing

Export split_pud_page() so it can be used from the vmem code and teach
modify_pud_table() to split PUD-sized mappings when only a subrange
needs to be removed.

If the range to be removed covers a full PUD-sized mapping, keep the
existing behavior: clear the PUD entry and free the backing large page
(for non-direct mappings). Otherwise, split the PUD-mapped page into
PMD mappings and let the walker handle the smaller ranges.

This is needed for KASAN early shadow removal support: memory hotplug
freeing the KASAN early shadow is the only expected caller that will
try to free 2G PUD-mapped regions of non-direct mappings.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/page.h
arch/s390/mm/pageattr.c
arch/s390/mm/vmem.c