Skip to content

Commit

Permalink
s390: get rid of the first mb of uncompressed image
Browse files Browse the repository at this point in the history
Instead of generating uncompressed kernel image starting at 0, filling
first mb with zeros (with ".org 0x100000") and then trimming it off
from vmlinux.bin before compression, simply generate a kernel image
starting from 0x100000.

Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Vasily Gorbik authored and Martin Schwidefsky committed Jul 2, 2018
1 parent 8e533fd commit 183ab05
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
15 changes: 4 additions & 11 deletions arch/s390/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,12 @@ LDFLAGS_vmlinux := --oformat $(LD_BFD) -e startup -T
$(obj)/vmlinux: $(obj)/vmlinux.lds $(objtree)/arch/s390/boot/startup.a $(OBJECTS)
$(call if_changed,ld)

TRIM_HEAD_SIZE := 0x100000

sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\)$$/\#define SZ\2 (0x\1 - $(TRIM_HEAD_SIZE))/p'
# extract required uncompressed vmlinux symbols and adjust them to reflect offsets inside vmlinux.bin
sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\)$$/\#define SZ\2 (0x\1 - 0x100000)/p'

quiet_cmd_sizes = GEN $@
cmd_sizes = $(NM) $< | sed -n $(sed-sizes) > $@

quiet_cmd_trim_head = TRIM $@
cmd_trim_head = tail -c +$$(($(TRIM_HEAD_SIZE) + 1)) $< > $@

$(obj)/sizes.h: vmlinux
$(call if_changed,sizes)

Expand All @@ -42,13 +38,10 @@ $(obj)/head.o: $(obj)/sizes.h
CFLAGS_misc.o += -I$(objtree)/$(obj)
$(obj)/misc.o: $(obj)/sizes.h

OBJCOPYFLAGS_vmlinux.bin.full := -R .comment -S
$(obj)/vmlinux.bin.full: vmlinux
OBJCOPYFLAGS_vmlinux.bin := -R .comment -S
$(obj)/vmlinux.bin: vmlinux
$(call if_changed,objcopy)

$(obj)/vmlinux.bin: $(obj)/vmlinux.bin.full
$(call if_changed,trim_head)

vmlinux.bin.all-y := $(obj)/vmlinux.bin

suffix-$(CONFIG_KERNEL_GZIP) := .gz
Expand Down
1 change: 0 additions & 1 deletion arch/s390/kernel/head64.S
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <asm/page.h>

__HEAD
.org 0x100000
ENTRY(startup_continue)
tm __LC_STFLE_FAC_LIST+5,0x80 # LPP available ?
jz 0f
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ PHDRS {

SECTIONS
{
. = 0x00000000;
. = 0x100000;
.text : {
/* Text and read-only data */
HEAD_TEXT
Expand Down

0 comments on commit 183ab05

Please sign in to comment.