s390/setup: avoid reserving memory above identity mapping
authorVasily Gorbik <gor@linux.ibm.com>
Thu, 14 Oct 2021 11:33:45 +0000 (13:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Nov 2021 08:48:44 +0000 (09:48 +0100)
commita4c7fe4409c5474bf6ed4681749bd63a8be9afd3
tree678163ea5bd0df6fb73dabb47351f0aab985e447
parentf07220f7d56844b5ebb85076acbb7ba99f32be38
s390/setup: avoid reserving memory above identity mapping

commit 420f48f636b98fd685f44a3acc4c0a7c0840910d upstream.

Such reserved memory region, if not cleaned up later causes problems when
memblock_free_all() is called to release free pages to the buddy allocator
and those reserved regions are carried over to reserve_bootmem_region()
which marks the pages as PageReserved.

Instead use memblock_set_current_limit() to make sure memblock allocations
do not go over identity mapping (which could happen when "mem=" option
is used or during kdump).

Cc: stable@vger.kernel.org
Fixes: 73045a08cf55 ("s390: unify identity mapping limits handling")
Reported-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/kernel/setup.c