Commit bd79d663 authored by Vasily Gorbik's avatar Vasily Gorbik Committed by Martin Schwidefsky

s390/decompressor: trim the kernel image up to 1M

Move head64.S main kernel entry point "startup_continue" to 0x100000 and
trim everything which is below 1M during build. So, that the decompressor
would unpack the main kernel image, move it to 0x100000 and jump to
startup_continue.
Reviewed-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 00f2fb57
...@@ -24,7 +24,7 @@ LDFLAGS_vmlinux := --oformat $(LD_BFD) -e startup -T ...@@ -24,7 +24,7 @@ LDFLAGS_vmlinux := --oformat $(LD_BFD) -e startup -T
$(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS) $(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS)
$(call if_changed,ld) $(call if_changed,ld)
TRIM_HEAD_SIZE := 0x11000 TRIM_HEAD_SIZE := 0x100000
sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\)$$/\#define SZ\2 (0x\1 - $(TRIM_HEAD_SIZE))/p' sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\)$$/\#define SZ\2 (0x\1 - $(TRIM_HEAD_SIZE))/p'
......
...@@ -23,7 +23,7 @@ ENTRY(startup_continue) ...@@ -23,7 +23,7 @@ ENTRY(startup_continue)
aghi %r15,-160 aghi %r15,-160
brasl %r14,decompress_kernel brasl %r14,decompress_kernel
# Set up registers for memory mover. We move the decompressed image to # Set up registers for memory mover. We move the decompressed image to
# 0x11000, where startup_continue of the decompressed image is supposed # 0x100000, where startup_continue of the decompressed image is supposed
# to be. # to be.
lgr %r4,%r2 lgr %r4,%r2
lg %r2,.Loffset-.LPG1(%r13) lg %r2,.Loffset-.LPG1(%r13)
...@@ -33,7 +33,7 @@ ENTRY(startup_continue) ...@@ -33,7 +33,7 @@ ENTRY(startup_continue)
la %r1,0x200 la %r1,0x200
mvc 0(mover_end-mover,%r1),mover-.LPG1(%r13) mvc 0(mover_end-mover,%r1),mover-.LPG1(%r13)
# When the memory mover is done we pass control to # When the memory mover is done we pass control to
# arch/s390/kernel/head64.S:startup_continue which lives at 0x11000 in # arch/s390/kernel/head64.S:startup_continue which lives at 0x100000 in
# the decompressed image. # the decompressed image.
lgr %r6,%r2 lgr %r6,%r2
br %r1 br %r1
...@@ -47,6 +47,6 @@ mover_end: ...@@ -47,6 +47,6 @@ mover_end:
.Lstack: .Lstack:
.quad 0x8000 + (1<<(PAGE_SHIFT+THREAD_SIZE_ORDER)) .quad 0x8000 + (1<<(PAGE_SHIFT+THREAD_SIZE_ORDER))
.Loffset: .Loffset:
.quad 0x11000 .quad 0x100000
.Lmvsize: .Lmvsize:
.quad SZ__bss_start .quad SZ__bss_start
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <asm/page.h> #include <asm/page.h>
__HEAD __HEAD
.org 0x100000 - 0x11000 # head.o ends at 0x11000
ENTRY(startup_continue) ENTRY(startup_continue)
tm __LC_STFLE_FAC_LIST+5,0x80 # LPP available ? tm __LC_STFLE_FAC_LIST+5,0x80 # LPP available ?
jz 0f jz 0f
...@@ -88,7 +89,6 @@ ENTRY(startup_continue) ...@@ -88,7 +89,6 @@ ENTRY(startup_continue)
ENTRY(_ehead) ENTRY(_ehead)
.org 0x100000 - 0x11000 # head.o ends at 0x11000
# #
# startup-code, running in absolute addressing mode # startup-code, running in absolute addressing mode
# #
......
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