s390/boot: always align vmalloc area on segment boundary
authorAlexander Gordeev <agordeev@linux.ibm.com>
Sun, 16 Jul 2023 08:56:00 +0000 (10:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Feb 2024 20:14:16 +0000 (20:14 +0000)
commit05a8ba5c1e5922018d54b28d136ade2d21f76db6
tree8fded5db0ab3636ec3623665820ca00cc3931c3f
parent6996d43b14486f4a6655b10edc541ada1b580b4b
s390/boot: always align vmalloc area on segment boundary

[ Upstream commit 65f8780e2d70257200547b5a7654974aa7c37ce1 ]

The size of vmalloc area depends from various factors
on boot and could be set to:

1. Default size as determined by VMALLOC_DEFAULT_SIZE macro;
2. One half of the virtual address space not occupied by
   modules and fixed mappings;
3. The size provided by user with vmalloc= kernel command
   line parameter;

In cases [1] and [2] the vmalloc area base address is aligned
on Region3 table type boundary, while in case [3] in might get
aligned on page boundary.

Limit the waste of page tables and always align vmalloc area
size and base address on segment boundary.

Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/s390/boot/ipl_parm.c
arch/s390/boot/startup.c