From 4905975f817b89c98d8539b6cc69ebfe353ea57e Mon Sep 17 00:00:00 2001 From: Mikhail Zaslonko Date: Fri, 24 Feb 2023 17:32:11 +0100 Subject: [PATCH] zipl/boot: Adjust Makefile, loaders layout and a linker script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use a separate linker script eckd2dump_sv.lds for single volume dumper with compression support. The new dump tool with zlib compression support now has a size of 8 pages. Since DASD stand alone dump requires a block size of 4K, we are not affected by the stage 2 size limitations and can load the dumper to stage 2 as before. We just need to move the HEAP section for ECKD dumper in the layout definitions up to 0xb000 address. Also expand the stack by unused 0x400 bytes. Signed-off-by: Mikhail Zaslonko Reviewed-by: Alexander Egorenkov Signed-off-by: Jan Höppner --- include/boot/loaders_layout.h | 3 ++ zipl/boot/Makefile | 7 ++-- zipl/boot/eckd2dump_sv.lds.S | 76 +++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 zipl/boot/eckd2dump_sv.lds.S diff --git a/include/boot/loaders_layout.h b/include/boot/loaders_layout.h index 7ab8e52a..0f07ca4e 100644 --- a/include/boot/loaders_layout.h +++ b/include/boot/loaders_layout.h @@ -22,9 +22,12 @@ #define STAGE2_DESC _AC(0x78, UL) #define STAGE2_ENTRY _AC(0x2018, UL) #define STAGE2_HEAP_ADDRESS _AC(0x6000, UL) +#define ECKD2DUMP_SV_HEAP_ADDRESS _AC(0xb000, UL) #define STAGE2_HEAP_SIZE _AC(0x3000, UL) #define STAGE2_STACK_ADDRESS _AC(0xe400, UL) #define STAGE2_STACK_SIZE _AC(0x1c00, UL) +#define ECKD2DUMP_SV_STACK_ADDRESS _AC(0xe000, UL) +#define ECKD2DUMP_SV_STACK_SIZE _AC(0x2000, UL) #define STAGE2_MAX_SIZE _AC(0x3000, UL) #define STAGE3_ENTRY _AC(0xa000, UL) diff --git a/zipl/boot/Makefile b/zipl/boot/Makefile index 499fb537..2ea129bf 100644 --- a/zipl/boot/Makefile +++ b/zipl/boot/Makefile @@ -56,8 +56,9 @@ eckd1b.exec fba1b.exec: \ stage1b.lds eckd2dump_sv.exec: \ - head.o stage2dump.o cio.o eckd2dump.o eckd2dump_sv.o \ - libc.o ebcdic.o sclp.o entry.o stage2.lds + head.o stage2dump.o cio.o eckd2dump.o eckd2dump_sv.o eckd2dump_zlib.o \ + zlib/deflate.o zlib/deftree.o zlib/dfltcc.o zlib/dfltcc_deflate.o \ + libc.o ebcdic.o sclp.o entry.o eckd2dump_sv.lds eckd2dump_mv.exec: \ head.o stage2dump.o cio.o eckd2dump.o eckd2dump_mv.o \ libc.o ebcdic.o sclp.o entry.o stage2.lds @@ -88,6 +89,6 @@ stage3.exec: head.o stage3.o kdump3.o libc.o ebcdic.o ebcdic_conv.o sclp.o \ clean: - rm -f -- *.o *.exec *.bin *.lds .*.lds.d .loaders *.debug + rm -f -- ./**/*.o *.o *.exec *.bin *.lds .*.lds.d .loaders *.debug .PHONY: all clean diff --git a/zipl/boot/eckd2dump_sv.lds.S b/zipl/boot/eckd2dump_sv.lds.S new file mode 100644 index 00000000..0518d24d --- /dev/null +++ b/zipl/boot/eckd2dump_sv.lds.S @@ -0,0 +1,76 @@ +/* + * Memory layout of stage 2 for single volume dasd + * dump tool with compression support + * =============================================== + * + * General memory layout + * --------------------- + * + * 0x0000-0x1fff Lowcore + * 0x2000-0x9fff Sections (load): head, text, data, rodata, rodata.str + * 0xa000-0xafff Sections: bss + * 0xb000-0xdfff Memory allocation (heap) + * 0xe000-0xffff Stack + * + * Special memory locations + * ------------------------ + * + * 0x78 Stage 2 description parameters + * 0x2018 Stage 2 entry point + * 0x9ff8 Max mem dump parameter + */ + +#include "boot/loaders_layout.h" + +SECTIONS +{ + . = STAGE2_DESC; + __stage2_desc = .; + + . = STAGE2_LOAD_ADDRESS; + .stage2.head : { *(.stage2.head) } + . = STAGE2_ENTRY; + .text.start : { + *(.text.start) + } + .text : { *(.text) } + __ex_table_start = .; + .ex_table : { *(.ex_table) } + __ex_table_stop = .; + .rodata : {*(.rodata) } + .data : { *(.data) } + __stage2_params = .; + + . = 0x9ff0; + .stage2dump.tail : { *(.stage2dump.tail) } + + . = 0xa000; + __bss_start = .; + .bss : { *(.bss) } + __bss_stop = .; + + . = ECKD2DUMP_SV_HEAP_ADDRESS; + __heap_start = .; + .heap : { + . += STAGE2_HEAP_SIZE; + ASSERT(__heap_stop - __heap_start == STAGE2_HEAP_SIZE, + "Heap section doesn't conform to the described memory layout"); + } + __heap_stop = .; + + . = ECKD2DUMP_SV_STACK_ADDRESS; + __stack_start = .; + .stack : { + . += ECKD2DUMP_SV_STACK_SIZE; + ASSERT(__stack_end - __stack_start == ECKD2DUMP_SV_STACK_SIZE, + "Stack section doesn't conform to the described memory layout"); + } + __stack_end = .; + + /* Sections to be discarded */ + /DISCARD/ : { + *(.eh_frame) + *(.interp) + *(.note.GNU-stack) + } +}