s390/mem_detect: limit memory detection loop to "mem=" parameter
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Tue, 30 Apr 2013 08:34:04 +0000 (10:34 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 2 May 2013 13:50:26 +0000 (15:50 +0200)
commitdf1bd59c5cc247d1d02588ff0a4e86a0cc5f9733
tree619ab3b2ef639ebbcd102961c8710b852cd9adfc
parent67b5c3eeb4814bceb9a7e17fecb14ef59d511812
s390/mem_detect: limit memory detection loop to "mem=" parameter

The current memory detection loop will detect all present memory of
a machine. This is true even if the user specified the "mem=" parameter
on the kernel command line.
This can be a problem since the memory detection may cause a fully
populated host page table for the guest, even for those parts of the
memory that the guest will never use afterwards.

So fix this and only detect memory up to a user supplied "mem=" limit
if specified.

Reported-by: Michael Johanssen <johanssn@de.ibm.com>
Reviewed-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/setup.h
arch/s390/kernel/crash_dump.c
arch/s390/kernel/early.c
arch/s390/kernel/setup.c
arch/s390/mm/mem_detect.c
drivers/s390/char/zcore.c