From 9f9dddddd41a0fc932994f292799a0eee2ff2dbd Mon Sep 17 00:00:00 2001 From: Mikhail Zaslonko Date: Mon, 24 Mar 2025 17:38:51 +0100 Subject: [PATCH] zdump: Drop build_arch for s390 DASD dumps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The build_arch field in s390 DASD dump header has originally been used to indicate whether the dump tool has been built on s390 or s390x system. Since no other architectures but s390x are supported for Linux on z, do not process build_arch attribute. Bail out if any build architecture other than ARCH_64 has been detected in s390_ext or s390mv_ext DASD dump header. Remove build architecture line from 'zgetdump -i' output: Build arch.........: s390x (64 bit) The man file for zgetdump is updated accordingly. Signed-off-by: Mikhail Zaslonko Reviewed-by: Alexander Egorenkov Signed-off-by: Jan Höppner --- zdump/df_s390.c | 2 -- zdump/dfi.c | 18 ------------------ zdump/dfi.h | 3 --- zdump/dfi_s390.c | 2 ++ zdump/dfi_s390mv_ext.c | 2 ++ zdump/dfo_s390.c | 2 -- zdump/zgetdump.8 | 3 --- 7 files changed, 4 insertions(+), 28 deletions(-) diff --git a/zdump/df_s390.c b/zdump/df_s390.c index bc614e63..f0c7075a 100644 --- a/zdump/df_s390.c +++ b/zdump/df_s390.c @@ -92,8 +92,6 @@ void df_s390_hdr_add(struct df_s390_hdr *hdr) dfi_attr_version_set(hdr->version); if (hdr->cpu_id) dfi_attr_cpu_id_set(hdr->cpu_id); - if (hdr->build_arch) - dfi_attr_build_arch_set(DFI_ARCH_64); if (hdr->mem_size_real) dfi_attr_mem_size_real_set(hdr->mem_size_real); if (hdr->real_cpu_cnt) diff --git a/zdump/dfi.c b/zdump/dfi.c index 3c46d899..56a9086d 100644 --- a/zdump/dfi.c +++ b/zdump/dfi.c @@ -67,7 +67,6 @@ struct attr { struct timeval *time_end; u64 *cpu_id; u64 *mem_size_real; - enum dfi_arch *build_arch; unsigned int *vol_nr; u32 *real_cpu_cnt; struct new_utsname *utsname; @@ -129,9 +128,6 @@ void dfi_info_print(void) } if (l.attr.vol_nr) STDERR(" Volume number......: %u\n", *l.attr.vol_nr); - if (l.attr.build_arch) - STDERR(" Build arch.........: %s\n", - dfi_arch_str(*l.attr.build_arch)); STDERR(" System arch........: %s\n", dfi_arch_str(DFI_ARCH_64)); if (l.cpus.cnt) STDERR(" CPU count (online).: %u\n", l.cpus.cnt); @@ -434,20 +430,6 @@ u32 *dfi_attr_zlib_entsize(void) return l.attr.zlib_entsize; } -/* - * Attribute: Build architecture - */ -void dfi_attr_build_arch_set(enum dfi_arch build_arch) -{ - l.attr.build_arch = zg_alloc(sizeof(*l.attr.build_arch)); - *l.attr.build_arch = build_arch; -} - -enum dfi_arch *dfi_attr_build_arch(void) -{ - return l.attr.build_arch; -} - /* * Attribute: Real CPU count */ diff --git a/zdump/dfi.h b/zdump/dfi.h index 2440e476..ddbc597e 100644 --- a/zdump/dfi.h +++ b/zdump/dfi.h @@ -181,9 +181,6 @@ unsigned int *dfi_attr_vol_nr(void); void dfi_attr_version_set(unsigned int dfi_version); unsigned int *dfi_attr_dfi_version(void); -void dfi_attr_build_arch_set(enum dfi_arch build_arch); -enum dfi_arch *dfi_attr_build_arch(void); - void dfi_attr_real_cpu_cnt_set(u32 real_cpu_cnt); u32 *dfi_attr_real_cpu_cnt(void); diff --git a/zdump/dfi_s390.c b/zdump/dfi_s390.c index 9d777de6..6ddad1db 100644 --- a/zdump/dfi_s390.c +++ b/zdump/dfi_s390.c @@ -200,6 +200,8 @@ static int read_s390_hdr(void) return -ENODEV; if (l.hdr.arch != DF_S390_ARCH_64) ERR_EXIT("Dump architecture is not supported!"); + if (l.hdr.build_arch && l.hdr.build_arch != DF_S390_ARCH_64) + ERR_EXIT("Dump-tool build architecture is not supported!"); if (l.hdr.cpu_cnt > DF_S390_CPU_MAX) return -ENODEV; if (l.hdr.zlib_version_s390 && l.hdr.version != 2) diff --git a/zdump/dfi_s390mv_ext.c b/zdump/dfi_s390mv_ext.c index 80b0d565..4e539275 100644 --- a/zdump/dfi_s390mv_ext.c +++ b/zdump/dfi_s390mv_ext.c @@ -503,6 +503,8 @@ static int dfi_s390mv_ext_init(void) zg_exit(1); if (l.hdr.arch != DF_S390_ARCH_64) ERR_EXIT("Dump architecture is not supported!"); + if (l.hdr.build_arch && l.hdr.build_arch != DF_S390_ARCH_64) + ERR_EXIT("Dump-tool build architecture is not supported!"); if (l.hdr.mem_size == 0) return -ENODEV; df_s390_hdr_add(&l.hdr); diff --git a/zdump/dfo_s390.c b/zdump/dfo_s390.c index fc053535..e5224217 100644 --- a/zdump/dfo_s390.c +++ b/zdump/dfo_s390.c @@ -216,8 +216,6 @@ static void df_s390_dump_init(void) dh->mem_size = dh->mem_end + 1; dh->num_pages = dh->mem_size / PAGE_SIZE; dh->arch = DF_S390_ARCH_64; - if (dfi_attr_build_arch()) - dh->build_arch = DF_S390_ARCH_64; dh->cpu_cnt = dfi_cpu_cnt(); if (dfi_cpu_content() == DFI_CPU_CONTENT_NONE) dh->cpu_cnt = 0; diff --git a/zdump/zgetdump.8 b/zdump/zgetdump.8 index a1b1973a..86f37d62 100644 --- a/zdump/zgetdump.8 +++ b/zdump/zgetdump.8 @@ -252,9 +252,6 @@ The kernel release of the Linux system. .BR "UTS kernel version" The kernel version of the Linux system. .TP -.BR "Build arch" -Architecture (s390 or s390x) on which the dump tool was built. -.TP .BR "System arch" Architecture of the Linux system (currently only s390x is possible). .TP