Commit 06c0dd72 authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Martin Schwidefsky

[S390] fix boot failures with compressed kernels

Fix two bugs with the kernel image compression:
1) reset the bss section of the compressed vmlinux
2) clear the high half of the registers for 64 bit early enough
   for the decompression step
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 7b26d82f
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
/* Symbols defined by linker scripts */ /* Symbols defined by linker scripts */
extern char input_data[]; extern char input_data[];
extern int input_len; extern int input_len;
extern int _text; extern char _text, _end;
extern int _end; extern char _bss, _ebss;
static void error(char *m); static void error(char *m);
...@@ -129,12 +129,12 @@ unsigned long decompress_kernel(void) ...@@ -129,12 +129,12 @@ unsigned long decompress_kernel(void)
unsigned long output_addr; unsigned long output_addr;
unsigned char *output; unsigned char *output;
check_ipl_parmblock((void *) 0, (unsigned long) output + SZ__bss_start);
memset(&_bss, 0, &_ebss - &_bss);
free_mem_ptr = (unsigned long)&_end; free_mem_ptr = (unsigned long)&_end;
free_mem_end_ptr = free_mem_ptr + HEAP_SIZE; free_mem_end_ptr = free_mem_ptr + HEAP_SIZE;
output = (unsigned char *) ((free_mem_end_ptr + 4095UL) & -4096UL); output = (unsigned char *) ((free_mem_end_ptr + 4095UL) & -4096UL);
check_ipl_parmblock((void *) 0, (unsigned long) output + SZ__bss_start);
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
/* /*
* Move the initrd right behind the end of the decompressed * Move the initrd right behind the end of the decompressed
......
...@@ -517,7 +517,10 @@ startup: ...@@ -517,7 +517,10 @@ startup:
lhi %r1,2 # mode 2 = esame (dump) lhi %r1,2 # mode 2 = esame (dump)
sigp %r1,%r0,0x12 # switch to esame mode sigp %r1,%r0,0x12 # switch to esame mode
sam64 # switch to 64 bit mode sam64 # switch to 64 bit mode
larl %r13,4f
lmh %r0,%r15,0(%r13) # clear high-order half
jg startup_continue jg startup_continue
4: .fill 16,4,0x0
#else #else
mvi __LC_AR_MODE_ID,0 # set ESA flag (mode 0) mvi __LC_AR_MODE_ID,0 # set ESA flag (mode 0)
l %r13,4f-.LPG0(%r13) l %r13,4f-.LPG0(%r13)
......
...@@ -21,7 +21,6 @@ startup_continue: ...@@ -21,7 +21,6 @@ startup_continue:
larl %r1,sched_clock_base_cc larl %r1,sched_clock_base_cc
mvc 0(8,%r1),__LC_LAST_UPDATE_CLOCK mvc 0(8,%r1),__LC_LAST_UPDATE_CLOCK
larl %r13,.LPG1 # get base larl %r13,.LPG1 # get base
lmh %r0,%r15,.Lzero64-.LPG1(%r13) # clear high-order half
lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
lg %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area lg %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area
# move IPL device to lowcore # move IPL device to lowcore
...@@ -67,7 +66,6 @@ startup_continue: ...@@ -67,7 +66,6 @@ startup_continue:
.L4malign:.quad 0xffffffffffc00000 .L4malign:.quad 0xffffffffffc00000
.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8 .Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8
.Lnop: .long 0x07000700 .Lnop: .long 0x07000700
.Lzero64:.fill 16,4,0x0
.Lparmaddr: .Lparmaddr:
.quad PARMAREA .quad PARMAREA
.align 64 .align 64
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment