]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
s390/mm: Consider KMSAN modules metadata for paging levels
authorVasily Gorbik <gor@linux.ibm.com>
Tue, 10 Dec 2024 11:35:34 +0000 (12:35 +0100)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Sun, 15 Dec 2024 22:35:09 +0000 (23:35 +0100)
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 <hca@linux.ibm.com>
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
arch/s390/boot/startup.c

index abe6e6c0ab9861ede764bc24c9cd0fd5c9f41ac2..6087d38c7235122a0d77d4c77d3ca96c2409c8bd 100644 (file)
@@ -234,6 +234,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);
 }