Skip to content

Commit 420f48f

Browse files
Vasily Gorbikhcahca
authored andcommitted
s390/setup: avoid reserving memory above identity mapping
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: [email protected] Fixes: 73045a0 ("s390: unify identity mapping limits handling") Reported-by: Gerald Schaefer <[email protected]> Reviewed-by: Heiko Carstens <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent fa55b7d commit 420f48f

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

arch/s390/kernel/setup.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -637,14 +637,6 @@ static struct notifier_block kdump_mem_nb = {
637637

638638
#endif
639639

640-
/*
641-
* Make sure that the area above identity mapping is protected
642-
*/
643-
static void __init reserve_above_ident_map(void)
644-
{
645-
memblock_reserve(ident_map_size, ULONG_MAX);
646-
}
647-
648640
/*
649641
* Reserve memory for kdump kernel to be loaded with kexec
650642
*/
@@ -999,11 +991,11 @@ void __init setup_arch(char **cmdline_p)
999991
setup_control_program_code();
1000992

1001993
/* Do some memory reservations *before* memory is added to memblock */
1002-
reserve_above_ident_map();
1003994
reserve_kernel();
1004995
reserve_initrd();
1005996
reserve_certificate_list();
1006997
reserve_mem_detect_info();
998+
memblock_set_current_limit(ident_map_size);
1007999
memblock_allow_resize();
10081000

10091001
/* Get information about *all* installed memory */

0 commit comments

Comments
 (0)