From 6e47b1876128f50143bc403da85786ccb0dbd1d3 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Mon, 14 Jul 2008 09:58:55 +0200 Subject: [PATCH] --- yaml --- r: 98963 b: refs/heads/master c: 761cdf6aacdb76f819050f4938cdab1f4cdcb945 h: refs/heads/master i: 98961: afabbb64d2cd0d573c1b3783d44897e88daae77c 98959: a8bfc1e12f48e6b4df0f15af2bc6d724343d3520 v: v3 --- [refs] | 2 +- trunk/arch/s390/kernel/early.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 339cf1c171b2..a5fa30fc65d6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 63506c41986c4af9d4fd6f3490e98e335f3dc8f5 +refs/heads/master: 761cdf6aacdb76f819050f4938cdab1f4cdcb945 diff --git a/trunk/arch/s390/kernel/early.c b/trunk/arch/s390/kernel/early.c index d0e09684b9ce..b2226e41f067 100644 --- a/trunk/arch/s390/kernel/early.c +++ b/trunk/arch/s390/kernel/early.c @@ -380,6 +380,23 @@ static __init void detect_machine_facilities(void) #endif } +static __init void rescue_initrd(void) +{ +#ifdef CONFIG_BLK_DEV_INITRD + /* + * Move the initrd right behind the bss section in case it starts + * within the bss section. So we don't overwrite it when the bss + * section gets cleared. + */ + if (!INITRD_START || !INITRD_SIZE) + return; + if (INITRD_START >= (unsigned long) __bss_stop) + return; + memmove(__bss_stop, (void *) INITRD_START, INITRD_SIZE); + INITRD_START = (unsigned long) __bss_stop; +#endif +} + /* * Save ipl parameters, clear bss memory, initialize storage keys * and create a kernel NSS at startup if the SAVESYS= parm is defined @@ -389,6 +406,7 @@ void __init startup_init(void) unsigned long long memsize; ipl_save_parameters(); + rescue_initrd(); clear_bss_section(); init_kernel_storage_key(); lockdep_init();