diff --git a/include/dump/s390_dump.h b/include/dump/s390_dump.h index 86959295..1832d684 100644 --- a/include/dump/s390_dump.h +++ b/include/dump/s390_dump.h @@ -40,7 +40,8 @@ enum df_s390_arch { */ struct stage2dump_parm_tail { char reserved[6]; - uint16_t mvdump_force; + uint8_t no_compress; + uint8_t mvdump_force; uint64_t mem_upper_limit; } __packed; diff --git a/zipl/boot/stage2dump.c b/zipl/boot/stage2dump.c index 98f18835..c3a16755 100644 --- a/zipl/boot/stage2dump.c +++ b/zipl/boot/stage2dump.c @@ -225,7 +225,12 @@ static void df_s390_dump_init(void) dh->tod = get_tod_clock(); dh->volnr = 0; dh->zlib_version_s390 = 0; - if (test_facility(DFLTCC_FACILITY)) { + /* + * Ignore compression if --no-compress attribute has been specified + * or DFLTCC facility not available. + */ + if (test_facility(DFLTCC_FACILITY) && + parm_tail.no_compress == 0) { dh->zlib_version_s390 = 1; /* Indicate interlnal Zlib version */ dh->zlib_entry_size = DUMP_SEGM_ZLIB_ENTSIZE; } @@ -458,6 +463,8 @@ void __noreturn start(void) df_s390_dump_init(); printf("zIPL v%s dump tool (64 bit)", RELEASE_STRING); printf("Dumping 64 bit OS"); + if (parm_tail.no_compress) + printf("Dump compression prevented by the --no-compress attribute"); mem_and_cpu_init(); store_status(); dt_dump_mem(); diff --git a/zipl/include/install.h b/zipl/include/install.h index 69fb1a3c..69d53133 100644 --- a/zipl/include/install.h +++ b/zipl/include/install.h @@ -120,8 +120,8 @@ int install_tapeloader(const char* device, const char* image, const char* parmline, const char* ramdisk, address_t image_addr, address_t parm_addr, address_t initrd_addr); -int install_dump(const char* device, struct job_target_data* target, - uint64_t mem); +int install_dump(const char *device, struct job_target_data *target, + uint64_t mem, bool no_compress); int install_mvdump(char* const device[], struct job_target_data* target, int device_count, uint64_t mem, uint8_t force); diff --git a/zipl/include/job.h b/zipl/include/job.h index 7e0eb2ff..6bb16b6e 100644 --- a/zipl/include/job.h +++ b/zipl/include/job.h @@ -72,6 +72,7 @@ struct job_dump_data { struct job_common_ipl_data common; char* device; uint64_t mem; + bool no_compress; }; struct job_mvdump_data { @@ -87,7 +88,6 @@ struct job_ipl_tape_data { char* device; }; - union job_menu_entry_data { struct job_ipl_data ipl; struct job_dump_data dump; diff --git a/zipl/man/zipl.8.in b/zipl/man/zipl.8.in index 463bd117..472617dd 100644 --- a/zipl/man/zipl.8.in +++ b/zipl/man/zipl.8.in @@ -290,6 +290,12 @@ This option has been removed, use --dumpto instead. .BR "\-\-ldipl-dump" Install a List-directed dump record instead of a CCW-type dump. +.TP +.BR "\-\-no-compress" +Do not use zlib compression for a CCW-type dump. +Zlib compression is used by default for CCW-type single-volume DASD standalone +dump when the DFLTCC facility is available on the system. + .TP .BR "\-M " " or " "--mvdump=" Install a multi-volume dump record on each device associated with one of the diff --git a/zipl/src/boot.c b/zipl/src/boot.c index bbe51eb6..01879d48 100644 --- a/zipl/src/boot.c +++ b/zipl/src/boot.c @@ -535,7 +535,7 @@ boot_get_eckd_dump_stage2(void **data, size_t *size, if (buffer == NULL) return -1; memcpy(buffer, DATA_ADDR(eckd2dump_sv), DATA_SIZE(eckd2dump_sv)); - /* Write mem size to end of dump record */ + /* Write mem size and no-compression indicator to end of dump record */ offset = DATA_SIZE(eckd2dump_sv) - sizeof(struct stage2dump_parm_tail); memcpy(VOID_ADD(buffer, offset), stage2dump_parms, sizeof(struct stage2dump_parm_tail)); diff --git a/zipl/src/install.c b/zipl/src/install.c index 447cb739..2a29ce78 100644 --- a/zipl/src/install.c +++ b/zipl/src/install.c @@ -1040,7 +1040,8 @@ install_dump_tape(int fd, const struct stage2dump_parm_tail *stage2dump_parms) int -install_dump(const char* device, struct job_target_data* target, uint64_t mem) +install_dump(const char *device, struct job_target_data *target, uint64_t mem, + bool no_compress) { struct stage2dump_parm_tail stage2dump_parms = {0}; struct disk_info* info; @@ -1050,6 +1051,7 @@ install_dump(const char* device, struct job_target_data* target, uint64_t mem) int rc; stage2dump_parms.mem_upper_limit = mem; + stage2dump_parms.no_compress = no_compress; fd = misc_open_exclusive(device); if (fd == -1) { error_text("Could not open dump device '%s'", device); diff --git a/zipl/src/job.c b/zipl/src/job.c index f0af943f..e0b90d04 100644 --- a/zipl/src/job.c +++ b/zipl/src/job.c @@ -50,6 +50,7 @@ static struct option options[] = { { "parmfile", required_argument, NULL, 'p'}, { "parameters", required_argument, NULL, 'P'}, { "dumpto", required_argument, NULL, 'd'}, + { "no-compress", no_argument, NULL, 0xb1}, { "dumptofs", required_argument, NULL, 'D'}, { "mvdump", required_argument, NULL, 'M'}, { "segment", required_argument, NULL, 's'}, @@ -93,6 +94,7 @@ struct command_line { int add_files; int dry_run; int force; + int no_compress; int is_secure; int is_ldipl_dump; enum scan_section_type type; @@ -289,6 +291,9 @@ get_command_line(int argc, char* argv[], struct command_line* line) case 0xb0: cmdline.is_ldipl_dump = 1; break; + case 0xb1: + cmdline.no_compress = 1; + break; case 1: /* Non-option is interpreted as section name */ if (cmdline.section != NULL) { @@ -1984,6 +1989,7 @@ job_get(int argc, char* argv[], struct job_data** data) job->noninteractive = cmdline.noninteractive; job->verbose = cmdline.verbose; job->add_files = cmdline.add_files; + job->data.dump.no_compress = cmdline.no_compress; job->data.mvdump.force = cmdline.force; job->dry_run = cmdline.dry_run; job->is_secure = SECURE_BOOT_UNDEFINED; diff --git a/zipl/src/zipl.c b/zipl/src/zipl.c index 0d8f6897..7ec492a8 100644 --- a/zipl/src/zipl.c +++ b/zipl/src/zipl.c @@ -73,6 +73,7 @@ static const char* usage_text[] = { "-d, --dumpto DUMPDEV[,SIZE] Install a system dump record on tape device", " or disk partition DUMPDEV", " --ldipl-dump Install a List-directed dump", +" --no-compress Do not use zlib compression for DASD dump", "-M, --mvdump DEVLIST[,SIZE] Install a multi-volume dump record on each", " disk partition listed in file DEVLIST", "-f, --force Disable sanity check while producing a", @@ -176,7 +177,7 @@ main(int argc, char* argv[]) (disk_is_tape(job->data.dump.device) || !disk_is_scsi(job->data.dump.device, &job->target))) { rc = install_dump(job->data.dump.device, &job->target, - job->data.dump.mem); + job->data.dump.mem, job->data.dump.no_compress); break; } /* Dump to a raw SCSI partition */