s390/boot: avoid page tables memory in kaslr
authorVasily Gorbik <gor@linux.ibm.com>
Fri, 27 Jan 2023 16:08:29 +0000 (17:08 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 6 Feb 2023 10:13:55 +0000 (11:13 +0100)
commit8382c963249dafcbe809dea307c2de16d5645579
tree688302288abea53f10fdf777f7510a31b4d70ea2
parent3615d01114047ffce3a0942c21e6402c7b49bb3f
s390/boot: avoid page tables memory in kaslr

If kernel is build without KASAN support there is a chance that kernel
image is going to be positioned by KASLR code to overlap with identity
mapping page tables.

When kernel is build with KASAN support enabled memory which
is potentially going to be used for page tables and KASAN
shadow mapping is accounted for in KASLR with the use of
kasan_estimate_memory_needs(). Split this function and introduce
vmem_estimate_memory_needs() to cover decompressor's vmem identity
mapping page tables.

Fixes: bb1520d581a3 ("s390/mm: start kernel with DAT enabled")
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>
arch/s390/boot/boot.h
arch/s390/boot/kaslr.c
arch/s390/boot/vmem.c
arch/s390/include/asm/kasan.h