diff options
-rw-r--r-- | arch/s390/kernel/early.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index d0e09684b9ce..b2226e41f067 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c | |||
@@ -380,6 +380,23 @@ static __init void detect_machine_facilities(void) | |||
380 | #endif | 380 | #endif |
381 | } | 381 | } |
382 | 382 | ||
383 | static __init void rescue_initrd(void) | ||
384 | { | ||
385 | #ifdef CONFIG_BLK_DEV_INITRD | ||
386 | /* | ||
387 | * Move the initrd right behind the bss section in case it starts | ||
388 | * within the bss section. So we don't overwrite it when the bss | ||
389 | * section gets cleared. | ||
390 | */ | ||
391 | if (!INITRD_START || !INITRD_SIZE) | ||
392 | return; | ||
393 | if (INITRD_START >= (unsigned long) __bss_stop) | ||
394 | return; | ||
395 | memmove(__bss_stop, (void *) INITRD_START, INITRD_SIZE); | ||
396 | INITRD_START = (unsigned long) __bss_stop; | ||
397 | #endif | ||
398 | } | ||
399 | |||
383 | /* | 400 | /* |
384 | * Save ipl parameters, clear bss memory, initialize storage keys | 401 | * Save ipl parameters, clear bss memory, initialize storage keys |
385 | * and create a kernel NSS at startup if the SAVESYS= parm is defined | 402 | * and create a kernel NSS at startup if the SAVESYS= parm is defined |
@@ -389,6 +406,7 @@ void __init startup_init(void) | |||
389 | unsigned long long memsize; | 406 | unsigned long long memsize; |
390 | 407 | ||
391 | ipl_save_parameters(); | 408 | ipl_save_parameters(); |
409 | rescue_initrd(); | ||
392 | clear_bss_section(); | 410 | clear_bss_section(); |
393 | init_kernel_storage_key(); | 411 | init_kernel_storage_key(); |
394 | lockdep_init(); | 412 | lockdep_init(); |