summaryrefslogtreecommitdiff
path: root/arch/s390/boot/kaslr.c
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.ibm.com>2024-11-29 01:49:26 +0100
committerAlexander Gordeev <agordeev@linux.ibm.com>2025-01-26 17:23:58 +0100
commite70452c4ba2ce1e24a3fdc18bd623edb7b56013c (patch)
tree72239d6f7726adff0b6887076026c99628882826 /arch/s390/boot/kaslr.c
parent26701574cee6777f867f89b4a5c667817e1ee0dd (diff)
downloadlinux-e70452c4ba2ce1e24a3fdc18bd623edb7b56013c.tar.gz
linux-e70452c4ba2ce1e24a3fdc18bd623edb7b56013c.tar.bz2
linux-e70452c4ba2ce1e24a3fdc18bd623edb7b56013c.zip
s390/mm: Allow large pages for KASAN shadow mapping
Commit c98d2ecae08f ("s390/mm: Uncouple physical vs virtual address spaces") introduced a large_allowed() helper that restricts which mapping modes can use large pages. This change unintentionally prevented KASAN shadow mappings from using large pages, despite there being no reason to avoid them. In fact, large pages are preferred for performance. Since commit d8073dc6bc04 ("s390/mm: Allow large pages only for aligned physical addresses"), both can_large_pud() and can_large_pmd() call _pa() to check if large page physical addresses are aligned. However, _pa() has a side effect: it allocates memory in POPULATE_KASAN_MAP_SHADOW mode. Rename large_allowed() to large_page_mapping_allowed() and add POPULATE_KASAN_MAP_SHADOW to the allowed list to restore large page mappings for KASAN shadows. While large_page_mapping_allowed() isn't strictly necessary with current mapping modes since disallowed modes either don't map anything or fail alignment and size checks, keep it for clarity. Rename _pa() to resolve_pa_may_alloc() for clarity and to emphasize existing side effect. Rework can_large_pud()/can_large_pmd() to take the side effect into consideration and actually return physical address instead of just checking conditions. Fixes: c98d2ecae08f ("s390/mm: Uncouple physical vs virtual address spaces") Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'arch/s390/boot/kaslr.c')
0 files changed, 0 insertions, 0 deletions