From: Vasily Gorbik Date: Tue, 10 Dec 2024 11:35:34 +0000 (+0100) Subject: s390/mm: Consider KMSAN modules metadata for paging levels X-Git-Tag: v6.12.7~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=532d40c321fb857755cbd1f136fa14b6a923d476;p=thirdparty%2Fkernel%2Fstable.git s390/mm: Consider KMSAN modules metadata for paging levels [ Upstream commit 282da38b465395c930687974627c24f47ddce5ff ] The calculation determining whether to use three- or four-level paging didn't account for KMSAN modules metadata. Include this metadata in the virtual memory size calculation to ensure correct paging mode selection and avoiding potentially unnecessary physical memory size limitations. Fixes: 65ca73f9fb36 ("s390/mm: define KMSAN metadata for vmalloc and modules") Acked-by: Heiko Carstens Reviewed-by: Alexander Gordeev Reviewed-by: Ilya Leoshkevich Signed-off-by: Vasily Gorbik Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin --- diff --git a/arch/s390/boot/startup.c b/arch/s390/boot/startup.c index c8f149ad77e58..c2ee0745f59ed 100644 --- a/arch/s390/boot/startup.c +++ b/arch/s390/boot/startup.c @@ -231,6 +231,8 @@ static unsigned long get_vmem_size(unsigned long identity_size, vsize = round_up(SZ_2G + max_mappable, rte_size) + round_up(vmemmap_size, rte_size) + FIXMAP_SIZE + MODULES_LEN + KASLR_LEN; + if (IS_ENABLED(CONFIG_KMSAN)) + vsize += MODULES_LEN * 2; return size_add(vsize, vmalloc_size); }