Skip to content

Commit 06c0dd7

Browse files
Martin SchwidefskyMartin Schwidefsky
authored andcommitted
[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: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 7b26d82 commit 06c0dd7

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎arch/s390/boot/compressed/misc.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
/* Symbols defined by linker scripts */
2525
extern char input_data[];
2626
extern int input_len;
27-
extern int _text;
28-
extern int _end;
27+
extern char _text, _end;
28+
extern char _bss, _ebss;
2929

3030
static void error(char *m);
3131

@@ -129,12 +129,12 @@ unsigned long decompress_kernel(void)
129129
unsigned long output_addr;
130130
unsigned char *output;
131131

132+
check_ipl_parmblock((void *) 0, (unsigned long) output + SZ__bss_start);
133+
memset(&_bss, 0, &_ebss - &_bss);
132134
free_mem_ptr = (unsigned long)&_end;
133135
free_mem_end_ptr = free_mem_ptr + HEAP_SIZE;
134136
output = (unsigned char *) ((free_mem_end_ptr + 4095UL) & -4096UL);
135137

136-
check_ipl_parmblock((void *) 0, (unsigned long) output + SZ__bss_start);
137-
138138
#ifdef CONFIG_BLK_DEV_INITRD
139139
/*
140140
* Move the initrd right behind the end of the decompressed

‎arch/s390/kernel/head.S‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,10 @@ startup:
517517
lhi %r1,2 # mode 2 = esame (dump)
518518
sigp %r1,%r0,0x12 # switch to esame mode
519519
sam64 # switch to 64 bit mode
520+
larl %r13,4f
521+
lmh %r0,%r15,0(%r13) # clear high-order half
520522
jg startup_continue
523+
4: .fill 16,4,0x0
521524
#else
522525
mvi __LC_AR_MODE_ID,0 # set ESA flag (mode 0)
523526
l %r13,4f-.LPG0(%r13)

‎arch/s390/kernel/head64.S‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ startup_continue:
2121
larl %r1,sched_clock_base_cc
2222
mvc 0(8,%r1),__LC_LAST_UPDATE_CLOCK
2323
larl %r13,.LPG1 # get base
24-
lmh %r0,%r15,.Lzero64-.LPG1(%r13) # clear high-order half
2524
lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
2625
lg %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area
2726
# move IPL device to lowcore
@@ -67,7 +66,6 @@ startup_continue:
6766
.L4malign:.quad 0xffffffffffc00000
6867
.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8
6968
.Lnop: .long 0x07000700
70-
.Lzero64:.fill 16,4,0x0
7169
.Lparmaddr:
7270
.quad PARMAREA
7371
.align 64

0 commit comments

Comments
 (0)