From ca2458a920418b111e3e6c2e15f8b01bc5b4f2d7 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Dec 12 2020 08:08:11 +0000 Subject: import kexec-tools-2.0.20-38.el8 --- diff --git a/.gitignore b/.gitignore index e7cea8f..b231ca3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ +SOURCES/1.6.8.tar.gz SOURCES/eppic_050615.tar.gz SOURCES/kexec-tools-2.0.20.tar.xz -SOURCES/makedumpfile-1.6.7.tar.gz diff --git a/.kexec-tools.metadata b/.kexec-tools.metadata index 431b034..553f89d 100644 --- a/.kexec-tools.metadata +++ b/.kexec-tools.metadata @@ -1,3 +1,3 @@ +7af5b92c69df9f63b9f02ad07a76a2a2581d4660 SOURCES/1.6.8.tar.gz a096c8e0892b559f40b01916aae240652f75b68a SOURCES/eppic_050615.tar.gz 5d9acd2e741d356d4a48fe4f2d63f66ba431051d SOURCES/kexec-tools-2.0.20.tar.xz -42941a0219d57d99909616778835e5d9ba890711 SOURCES/makedumpfile-1.6.7.tar.gz diff --git a/SOURCES/dracut-module-setup.sh b/SOURCES/dracut-module-setup.sh index 1c38c96..af5b4ef 100755 --- a/SOURCES/dracut-module-setup.sh +++ b/SOURCES/dracut-module-setup.sh @@ -244,14 +244,10 @@ kdump_setup_vlan() { local _netmac="$(kdump_get_mac_addr $_phydev)" local _kdumpdev - #Just support vlan over bond, it is not easy - #to support all other complex setup + #Just support vlan over bond and team if kdump_is_bridge "$_phydev"; then derror "Vlan over bridge is not supported!" exit 1 - elif kdump_is_team "$_phydev"; then - derror "Vlan over team is not supported!" - exit 1 elif kdump_is_bond "$_phydev"; then kdump_setup_bond "$_phydev" echo " vlan=$(kdump_setup_ifname $_netdev):$_phydev" > ${initdir}/etc/cmdline.d/43vlan.conf @@ -289,7 +285,7 @@ kdump_setup_netdev() { if [ -n "$_static" ]; then _proto=none elif is_ipv6_address $_srcaddr; then - _proto=either6 + _proto=auto6 else _proto=dhcp fi diff --git a/SOURCES/fadump-howto.txt b/SOURCES/fadump-howto.txt index c891e37..5360f3d 100644 --- a/SOURCES/fadump-howto.txt +++ b/SOURCES/fadump-howto.txt @@ -104,6 +104,11 @@ For the recommended value of X, see 'FADump Memory Requirements' section. # grubby --args="fadump=on crashkernel=6G" --update-kernel=/boot/vmlinuz-`uname -r` +By default, FADump reserved memory will be initialized as CMA area to make the +memory available through CMA allocator on the production kernel. We can opt out +of this, making reserved memory unavailable to production kernel, by booting the +linux kernel with 'fadump=nocma' instead of 'fadump=on'. + The term 'boot memory' means size of the low memory chunk that is required for a kernel to boot successfully when booted with restricted memory. By default, the boot memory size will be the larger of 5% of system RAM or 256MB. @@ -326,9 +331,14 @@ the original command line completely. How to disable FADump: -Remove "fadump=on" from kernel cmdline parameters: +Remove "fadump=on"/"fadump=nocma" from kernel cmdline parameters OR replace +it with "fadump=off" kernel cmdline parameter: # grubby --update-kernel=/boot/vmlinuz-`uname -r` --remove-args="fadump=on" +or + # grubby --update-kernel=/boot/vmlinuz-`uname -r` --remove-args="fadump=nocma" +OR + # grubby --update-kernel=/boot/vmlinuz-`uname -r` --args="fadump=off" If KDump is to be used as the dump capturing mechanism, update the crashkernel parameter (Else, remove "crashkernel=" parameter too, using grubby): diff --git a/SOURCES/kdump-lib-initramfs.sh b/SOURCES/kdump-lib-initramfs.sh index 1e62550..51fd49a 100755 --- a/SOURCES/kdump-lib-initramfs.sh +++ b/SOURCES/kdump-lib-initramfs.sh @@ -123,7 +123,7 @@ dump_fs() ddebug "_mp=$_mp _dev=$_dev _op=$_op" # If dump path have a corresponding device entry but not mounted, mount it. - if [ -n "$_dev" ] || [ "$_dev" == "rootfs" ]; then + if [ -n "$_dev" ] && [ "$_dev" != "rootfs" ]; then if ! is_mounted "$_mp"; then dinfo "dump target $_dev is not mounted, trying to mount..." mkdir -p $_mp @@ -215,7 +215,8 @@ dump_to_rootfs() { dinfo "Trying to bring up rootfs device" - systemctl start dracut-initqueue + systemctl is-failed dracut-initqueue || systemctl start dracut-initqueue + dinfo "Waiting for rootfs mount, will timeout after 90 seconds" systemctl start sysroot.mount diff --git a/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-Align-PMD_SECTION_MASK-with-PHYS_MASK.patch b/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-Align-PMD_SECTION_MASK-with-PHYS_MASK.patch deleted file mode 100644 index e165b7d..0000000 --- a/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-Align-PMD_SECTION_MASK-with-PHYS_MASK.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 7242ae4cb5288df626f464ced0a8b60fd669100b Mon Sep 17 00:00:00 2001 -From: Michal Suchanek -Date: Mon, 16 Mar 2020 19:39:58 +0100 -Subject: [PATCH 6/7] [PATCH] Align PMD_SECTION_MASK with PHYS_MASK - -Reportedly on some arm64 systems makedumpfile loops forever exhausting -all memory when filtering kernel core. It turns out the reason is it -cannot resolve some addresses because the PMD mask is wrong. When -physical address mask allows up to 48bits pmd mask should allow the -same. -I suppose you would need a system that needs physical addresses over 1TB -to be able to reproduce this. This may be either because you have a lot -of memory or because the firmware mapped some memory above 1TB for some -reason. - -Signed-off-by: Michal Suchanek ---- - arch/arm64.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/makedumpfile-1.6.7/arch/arm64.c b/makedumpfile-1.6.7/arch/arm64.c -index 43164cc..54d60b4 100644 ---- a/makedumpfile-1.6.7/arch/arm64.c -+++ b/makedumpfile-1.6.7/arch/arm64.c -@@ -81,7 +81,7 @@ static unsigned long kimage_voffset; - * Remove the highest order bits that are not a part of the - * physical address in a section - */ --#define PMD_SECTION_MASK ((1UL << 40) - 1) -+#define PMD_SECTION_MASK ((1UL << PHYS_MASK_SHIFT) - 1) - - #define PMD_TYPE_MASK 3 - #define PMD_TYPE_SECT 1 --- -2.7.5 - diff --git a/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-Avoid-false-positive-failure-in-mem_seciton-va.patch b/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-Avoid-false-positive-failure-in-mem_seciton-va.patch deleted file mode 100644 index 1033494..0000000 --- a/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-Avoid-false-positive-failure-in-mem_seciton-va.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 81b79c514ff6fc881f1df4cb04ecb2d7cb22badc Mon Sep 17 00:00:00 2001 -From: Kazuhito Hagio -Date: Wed, 19 Feb 2020 12:48:13 -0500 -Subject: [PATCH] [PATCH] Avoid false-positive failure in mem_seciton - validation - -Currently in get_mem_section(), we check whether SYMBOL(mem_section) -is a pointer to the array or a pointer to the pointer to the array -for some cases. - -However, with commit e113f1c974c8 ("[PATCH] cope with not-present -mem section") relaxing the check, there was a report that the function -failed because both of two validate_mem_section() calls return TRUE. - -Avoid the false-positive failure by not calling the second one if the -first one returns TRUE. - -Reported-by: Pingfan Liu -Acked-by: Thadeu Lima de Souza Cascardo -Signed-off-by: Kazuhito Hagio ---- - makedumpfile.c | 29 ++++++----------------------- - 1 file changed, 6 insertions(+), 23 deletions(-) - -diff --git a/makedumpfile-1.6.7/makedumpfile.c b/makedumpfile-1.6.7/makedumpfile.c -index f5860a1..4c4251e 100644 ---- a/makedumpfile-1.6.7/makedumpfile.c -+++ b/makedumpfile-1.6.7/makedumpfile.c -@@ -3472,7 +3472,6 @@ static int - get_mem_section(unsigned int mem_section_size, unsigned long *mem_maps, - unsigned int num_section) - { -- unsigned long mem_section_ptr; - int ret = FALSE; - unsigned long *mem_sec = NULL; - -@@ -3484,34 +3483,18 @@ get_mem_section(unsigned int mem_section_size, unsigned long *mem_maps, - ret = validate_mem_section(mem_sec, SYMBOL(mem_section), - mem_section_size, mem_maps, num_section); - -- if (is_sparsemem_extreme()) { -- int symbol_valid = ret; -- int pointer_valid; -- int mem_maps_size = sizeof(*mem_maps) * num_section; -- unsigned long *mem_maps_ex = NULL; -+ if (!ret && is_sparsemem_extreme()) { -+ unsigned long mem_section_ptr; -+ - if (!readmem(VADDR, SYMBOL(mem_section), &mem_section_ptr, - sizeof(mem_section_ptr))) - goto out; - -- if ((mem_maps_ex = malloc(mem_maps_size)) == NULL) { -- ERRMSG("Can't allocate memory for the mem_maps. %s\n", -- strerror(errno)); -- goto out; -- } -+ ret = validate_mem_section(mem_sec, mem_section_ptr, -+ mem_section_size, mem_maps, num_section); - -- pointer_valid = validate_mem_section(mem_sec, -- mem_section_ptr, -- mem_section_size, -- mem_maps_ex, -- num_section); -- if (pointer_valid) -- memcpy(mem_maps, mem_maps_ex, mem_maps_size); -- if (mem_maps_ex) -- free(mem_maps_ex); -- ret = symbol_valid ^ pointer_valid; -- if (!ret) { -+ if (!ret) - ERRMSG("Could not validate mem_section.\n"); -- } - } - out: - if (mem_sec != NULL) --- -2.7.5 - diff --git a/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-Fix-cd_header-offset-overflow-with-large-pfn.patch b/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-Fix-cd_header-offset-overflow-with-large-pfn.patch deleted file mode 100644 index 85b5048..0000000 --- a/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-Fix-cd_header-offset-overflow-with-large-pfn.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 6e4b2dfaed5e5e5c617e0e45f969c1f571c13e27 Mon Sep 17 00:00:00 2001 -From: Jialong Chen -Date: Mon, 23 Mar 2020 16:42:01 -0400 -Subject: [PATCH 7/7] [PATCH] Fix cd_header offset overflow with large pfn - -In function write_kdump_pages_and_bitmap_cyclic(), cd_header->offset is -calculated by the following formula: - - cd_header->offset - = (DISKDUMP_HEADER_BLOCKS + dh->sub_hdr_size + dh->bitmap_blocks) - * dh->block_size; - -However, the variables of the right side are only int and unsigned int, -so if dh->bitmap_blocks is very large, it causes an interger overflow. - -As a result, makedumpfile created a broken vmcore in a system with a -physical address range from 0x602770ecf000 to 0x6027ffffffff, and the -crash utility failed during session initialization, ending with the -error message "crash: vmlinux and vmcore do not match!". - -Signed-off-by: Jialong Chen -Signed-off-by: Kazuhito Hagio ---- - diskdump_mod.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/makedumpfile-1.6.7/diskdump_mod.h b/makedumpfile-1.6.7/diskdump_mod.h -index 2676817..3733953 100644 ---- a/makedumpfile-1.6.7/diskdump_mod.h -+++ b/makedumpfile-1.6.7/diskdump_mod.h -@@ -22,7 +22,7 @@ - #define DISK_DUMP_SIGNATURE "DISKDUMP" - #define KDUMP_SIGNATURE "KDUMP " - #define SIG_LEN (sizeof(DUMP_PARTITION_SIGNATURE) - 1) --#define DISKDUMP_HEADER_BLOCKS (1) -+#define DISKDUMP_HEADER_BLOCKS (1UL) - - /* - * These are all remnants of the old "diskdump" facility, --- -2.7.5 - diff --git a/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-Introduce-check-params-option.patch b/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-Introduce-check-params-option.patch deleted file mode 100644 index b83d083..0000000 --- a/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-Introduce-check-params-option.patch +++ /dev/null @@ -1,255 +0,0 @@ -From 989152e113bfcb4fbfbad6f3aed6f43be4455919 Mon Sep 17 00:00:00 2001 -From: Kazuhito Hagio -Date: Tue, 25 Feb 2020 16:04:55 -0500 -Subject: [PATCH 4/7] [PATCH] Introduce --check-params option - -Currently it's difficult to check whether a makedumpfile command-line -is valid or not without an actual panic. This is inefficient and if -a wrong configuration is not tested, you will miss the vmcore when an -actual panic occurs. - -In order for kdump facilities like kexec-tools to be able to check -the specified command-line parameters in advance, introduce the ---check-params option that only checks them and exits immediately. - -Signed-off-by: Kazuhito Hagio ---- - makedumpfile.8 | 5 ++++ - makedumpfile.c | 75 +++++++++++++++++++++++++++++++++++++++++++++------------- - makedumpfile.h | 2 ++ - print_info.c | 4 ++++ - 4 files changed, 69 insertions(+), 17 deletions(-) - -diff --git a/makedumpfile-1.6.7/makedumpfile.8 b/makedumpfile-1.6.7/makedumpfile.8 -index bf156a8..c5d4806 100644 ---- a/makedumpfile-1.6.7/makedumpfile.8 -+++ b/makedumpfile-1.6.7/makedumpfile.8 -@@ -632,6 +632,11 @@ Show help message and LZO/snappy support status (enabled/disabled). - \fB\-v\fR - Show the version of makedumpfile. - -+.TP -+\fB\-\-check-params\fR -+Only check whether the command-line parameters are valid or not, and exit. -+Preferable to be given as the first parameter. -+ - .SH ENVIRONMENT VARIABLES - - .TP 8 -diff --git a/makedumpfile-1.6.7/makedumpfile.c b/makedumpfile-1.6.7/makedumpfile.c -index 607e07f..f5860a1 100644 ---- a/makedumpfile-1.6.7/makedumpfile.c -+++ b/makedumpfile-1.6.7/makedumpfile.c -@@ -10972,12 +10972,6 @@ check_param_for_creating_dumpfile(int argc, char *argv[]) - if (info->flag_generate_vmcoreinfo || info->flag_rearrange) - return FALSE; - -- if ((message_level < MIN_MSG_LEVEL) -- || (MAX_MSG_LEVEL < message_level)) { -- message_level = DEFAULT_MSG_LEVEL; -- MSG("Message_level is invalid.\n"); -- return FALSE; -- } - if ((info->flag_compress && info->flag_elf_dumpfile) - || (info->flag_read_vmcoreinfo && info->name_vmlinux) - || (info->flag_read_vmcoreinfo && info->name_xen_syms)) -@@ -11007,6 +11001,11 @@ check_param_for_creating_dumpfile(int argc, char *argv[]) - if (info->flag_partial_dmesg && !info->flag_dmesg) - return FALSE; - -+ if (info->flag_excludevm && !info->working_dir) { -+ MSG("-%c requires --work-dir\n", OPT_EXCLUDE_UNUSED_VM); -+ return FALSE; -+ } -+ - if ((argc == optind + 2) && !info->flag_flatten - && !info->flag_split - && !info->flag_sadump_diskset) { -@@ -11402,6 +11401,23 @@ int show_mem_usage(void) - return TRUE; - } - -+static int set_message_level(char *str_ml) -+{ -+ int ml; -+ -+ ml = atoi(str_ml); -+ if ((ml < MIN_MSG_LEVEL) || (MAX_MSG_LEVEL < ml)) { -+ message_level = DEFAULT_MSG_LEVEL; -+ MSG("Message_level(%d) is invalid.\n", ml); -+ return FALSE; -+ } -+ -+ if (info->flag_check_params) -+ return TRUE; -+ -+ message_level = ml; -+ return TRUE; -+} - - static struct option longopts[] = { - {"split", no_argument, NULL, OPT_SPLIT}, -@@ -11423,6 +11439,7 @@ static struct option longopts[] = { - {"splitblock-size", required_argument, NULL, OPT_SPLITBLOCK_SIZE}, - {"work-dir", required_argument, NULL, OPT_WORKING_DIR}, - {"num-threads", required_argument, NULL, OPT_NUM_THREADS}, -+ {"check-params", no_argument, NULL, OPT_CHECK_PARAMS}, - {0, 0, 0, 0} - }; - -@@ -11521,7 +11538,8 @@ main(int argc, char *argv[]) - info->flag_compress = DUMP_DH_COMPRESSED_LZO; - break; - case OPT_MESSAGE_LEVEL: -- message_level = atoi(optarg); -+ if (!set_message_level(optarg)) -+ goto out; - break; - case OPT_DUMP_DMESG: - info->flag_dmesg = 1; -@@ -11584,6 +11602,10 @@ main(int argc, char *argv[]) - case OPT_NUM_THREADS: - info->num_threads = MAX(atoi(optarg), 0); - break; -+ case OPT_CHECK_PARAMS: -+ info->flag_check_params = TRUE; -+ message_level = DEFAULT_MSG_LEVEL; -+ break; - case '?': - MSG("Commandline parameter is invalid.\n"); - MSG("Try `makedumpfile --help' for more information.\n"); -@@ -11593,11 +11615,9 @@ main(int argc, char *argv[]) - if (flag_debug) - message_level |= ML_PRINT_DEBUG_MSG; - -- if (info->flag_excludevm && !info->working_dir) { -- ERRMSG("Error: -%c requires --work-dir\n", OPT_EXCLUDE_UNUSED_VM); -- ERRMSG("Try `makedumpfile --help' for more information\n"); -- return COMPLETED; -- } -+ if (info->flag_check_params) -+ /* suppress debugging messages */ -+ message_level = DEFAULT_MSG_LEVEL; - - if (info->flag_show_usage) { - print_usage(); -@@ -11628,6 +11648,9 @@ main(int argc, char *argv[]) - MSG("Try `makedumpfile --help' for more information.\n"); - goto out; - } -+ if (info->flag_check_params) -+ goto check_ok; -+ - if (!open_files_for_generating_vmcoreinfo()) - goto out; - -@@ -11651,6 +11674,9 @@ main(int argc, char *argv[]) - MSG("Try `makedumpfile --help' for more information.\n"); - goto out; - } -+ if (info->flag_check_params) -+ goto check_ok; -+ - if (!check_dump_file(info->name_dumpfile)) - goto out; - -@@ -11671,6 +11697,9 @@ main(int argc, char *argv[]) - MSG("Try `makedumpfile --help' for more information.\n"); - goto out; - } -+ if (info->flag_check_params) -+ goto check_ok; -+ - if (!check_dump_file(info->name_dumpfile)) - goto out; - -@@ -11684,6 +11713,9 @@ main(int argc, char *argv[]) - MSG("Try `makedumpfile --help' for more information.\n"); - goto out; - } -+ if (info->flag_check_params) -+ goto check_ok; -+ - if (!check_dump_file(info->name_dumpfile)) - goto out; - if (!dump_dmesg()) -@@ -11697,6 +11729,9 @@ main(int argc, char *argv[]) - MSG("Try `makedumpfile --help' for more information.\n"); - goto out; - } -+ if (info->flag_check_params) -+ goto check_ok; -+ - if (!populate_kernel_version()) - goto out; - -@@ -11715,6 +11750,9 @@ main(int argc, char *argv[]) - MSG("Try `makedumpfile --help' for more information.\n"); - goto out; - } -+ if (info->flag_check_params) -+ goto check_ok; -+ - if (info->flag_split) { - for (i = 0; i < info->num_dumpfile; i++) { - SPLITTING_FD_BITMAP(i) = -1; -@@ -11742,13 +11780,16 @@ main(int argc, char *argv[]) - MSG("The dumpfile is saved to %s.\n", info->name_dumpfile); - } - } -+check_ok: - retcd = COMPLETED; - out: -- MSG("\n"); -- if (retcd != COMPLETED) -- MSG("makedumpfile Failed.\n"); -- else if (!info->flag_mem_usage) -- MSG("makedumpfile Completed.\n"); -+ if (!info->flag_check_params) { -+ MSG("\n"); -+ if (retcd != COMPLETED) -+ MSG("makedumpfile Failed.\n"); -+ else if (!info->flag_mem_usage) -+ MSG("makedumpfile Completed.\n"); -+ } - - free_for_parallel(); - -diff --git a/makedumpfile-1.6.7/makedumpfile.h b/makedumpfile-1.6.7/makedumpfile.h -index 7217407..03fb4ce 100644 ---- a/makedumpfile-1.6.7/makedumpfile.h -+++ b/makedumpfile-1.6.7/makedumpfile.h -@@ -1301,6 +1301,7 @@ struct DumpInfo { - int flag_read_vmcoreinfo; /* flag of reading vmcoreinfo file */ - int flag_show_usage; /* flag of showing usage */ - int flag_show_version; /* flag of showing version */ -+ int flag_check_params; /* only check parameters */ - int flag_flatten; /* flag of outputting flattened - format to a standard out */ - int flag_rearrange; /* flag of creating dumpfile from -@@ -2362,6 +2363,7 @@ struct elf_prstatus { - #define OPT_WORKING_DIR OPT_START+15 - #define OPT_NUM_THREADS OPT_START+16 - #define OPT_PARTIAL_DMESG OPT_START+17 -+#define OPT_CHECK_PARAMS OPT_START+18 - - /* - * Function Prototype. -diff --git a/makedumpfile-1.6.7/print_info.c b/makedumpfile-1.6.7/print_info.c -index 0be12ea..e0c38b4 100644 ---- a/makedumpfile-1.6.7/print_info.c -+++ b/makedumpfile-1.6.7/print_info.c -@@ -321,6 +321,10 @@ print_usage(void) - MSG(" [-v]:\n"); - MSG(" Show the version of makedumpfile.\n"); - MSG("\n"); -+ MSG(" [--check-params]:\n"); -+ MSG(" Only check whether the command-line parameters are valid or not, and exit.\n"); -+ MSG(" Preferable to be given as the first parameter.\n"); -+ MSG("\n"); - MSG(" VMLINUX:\n"); - MSG(" This is a pathname to the first kernel's vmlinux.\n"); - MSG(" This file must have the debug information of the first kernel to analyze\n"); --- -2.7.5 - diff --git a/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-Makefile-Fix-build-errors-in-static-build.patch b/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-Makefile-Fix-build-errors-in-static-build.patch deleted file mode 100644 index f2f2153..0000000 --- a/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-Makefile-Fix-build-errors-in-static-build.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 12250baa02584dc713cdb1a12fb366f643fdc8b3 Mon Sep 17 00:00:00 2001 -From: Kazuhito Hagio -Date: Mon, 9 Mar 2020 17:17:31 -0400 -Subject: [PATCH 5/7] [PATCH] Makefile: Fix build errors in static build - -When building makedumpfile statically (without LINKTYPE=dynamic), -the following error is observed: - - /usr/bin/ld: /usr/lib/makedumpfile-1.6.7/gcc/x86_64-redhat-linux/9/../../../../lib64/libdw.a(lzma.o): in function `__libdw_unlzma': - (.text+0xbd): undefined reference to `lzma_auto_decoder' - /usr/bin/ld: (.text+0x23a): undefined reference to `lzma_code' - /usr/bin/ld: (.text+0x269): undefined reference to `lzma_end' - /usr/bin/ld: (.text+0x2aa): undefined reference to `lzma_end' - /usr/bin/ld: (.text+0x3ac): undefined reference to `lzma_end' - /usr/bin/ld: (.text+0x427): undefined reference to `lzma_end' - /usr/bin/ld: (.text+0x62b): undefined reference to `lzma_end' - collect2: error: ld returned 1 exit status - make: *** [Makefile:97: makedumpfile] Error 1 - -Also, when doing it with USESNAPPY=on: - - /usr/bin/ld: /usr/local/lib64/libsnappy.a(snappy.cc.o): in function `snappy::internal::WorkingMemory::WorkingMemory(unsigned long)': - snappy.cc:(.text+0x7d4): undefined reference to `std::allocator::allocator()' - /usr/bin/ld: snappy.cc:(.text+0x803): undefined reference to `std::allocator::~allocator()' - /usr/bin/ld: snappy.cc:(.text+0x853): undefined reference to `std::allocator::~allocator()' - /usr/bin/ld: /usr/local/lib64/libsnappy.a(snappy.cc.o): in function `snappy::internal::WorkingMemory::~WorkingMemory()': - snappy.cc:(.text+0x87e): undefined reference to `std::allocator::allocator()' - /usr/bin/ld: snappy.cc:(.text+0x8a8): undefined reference to `std::allocator::~allocator()' - ... - -Fix these errors by adding -llzma and -lstd++ to LIBS respectively -if LINKTYPE=dynamic is not specified. - -Reported-by: Prabhakar Kushwaha -Signed-off-by: Kazuhito Hagio ---- - Makefile | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/makedumpfile-1.6.7/Makefile b/makedumpfile-1.6.7/Makefile -index 868eea6..ef20672 100644 ---- a/makedumpfile-1.6.7/Makefile -+++ b/makedumpfile-1.6.7/Makefile -@@ -52,7 +52,7 @@ OBJ_ARCH=$(patsubst %.c,%.o,$(SRC_ARCH)) - - LIBS = -ldw -lbz2 -ldl -lelf -lz - ifneq ($(LINKTYPE), dynamic) --LIBS := -static $(LIBS) -+LIBS := -static $(LIBS) -llzma - endif - - ifeq ($(USELZO), on) -@@ -62,6 +62,9 @@ endif - - ifeq ($(USESNAPPY), on) - LIBS := -lsnappy $(LIBS) -+ifneq ($(LINKTYPE), dynamic) -+LIBS := $(LIBS) -lstdc++ -+endif - CFLAGS += -DUSESNAPPY - endif - --- -2.7.5 - diff --git a/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-Remove-duplicated-variable-definitions.patch b/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-Remove-duplicated-variable-definitions.patch deleted file mode 100644 index 691cd05..0000000 --- a/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-Remove-duplicated-variable-definitions.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 399f2c9a3acd5bd913e50a4dde52dee6527b297e Mon Sep 17 00:00:00 2001 -From: Kairui Song -Date: Wed, 29 Jan 2020 13:37:13 +0800 -Subject: [PATCH 2/7] [PATCH] Remove duplicated variable definitions - -When building on Fedora 32 (with GCC 10), following error is observed: - -/usr/bin/ld: erase_info.o:/tmp/makedumpfile/makedumpfile.h:2010: multiple definition of - `crash_reserved_mem_nr'; elf_info.o:/tmp/makedumpfile/makedumpfile.h:2010: first defined here -/usr/bin/ld: erase_info.o:/tmp/makedumpfile/makedumpfile.h:2009: multiple definition of - `crash_reserved_mem'; elf_info.o:/tmp/makedumpfile/makedumpfile.h:2009: first defined here -/usr/bin/ld: erase_info.o:/tmp/makedumpfile/makedumpfile.h:1278: multiple definition of - `parallel_info_t'; elf_info.o:/tmp/makedumpfile/makedumpfile.h:1278: first defined here -/usr/bin/ld: erase_info.o:/tmp/makedumpfile/makedumpfile.h:1265: multiple definition of - `splitting_info_t'; elf_info.o:/tmp/makedumpfile/makedumpfile.h:1265: first defined here -... -collect2: error: ld returned 1 exit status -make: *** [Makefile:97: makedumpfile] Error 1 - -These variables are wrongly defined multiple times. So remove the -duplicated definitions. - -Signed-off-by: Kairui Song -Signed-off-by: Kazuhito Hagio ---- - makedumpfile.c | 8 ++++---- - makedumpfile.h | 8 ++++---- - 2 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/makedumpfile-1.6.7/makedumpfile.c b/makedumpfile-1.6.7/makedumpfile.c -index e290fbd..ae7336a 100644 ---- a/makedumpfile-1.6.7/makedumpfile.c -+++ b/makedumpfile-1.6.7/makedumpfile.c -@@ -10954,7 +10954,7 @@ check_param_for_reassembling_dumpfile(int argc, char *argv[]) - return FALSE; - - if ((info->splitting_info -- = malloc(sizeof(splitting_info_t) * info->num_dumpfile)) -+ = malloc(sizeof(struct splitting_info) * info->num_dumpfile)) - == NULL) { - MSG("Can't allocate memory for splitting_info.\n"); - return FALSE; -@@ -11042,7 +11042,7 @@ check_param_for_creating_dumpfile(int argc, char *argv[]) - return FALSE; - } - if ((info->splitting_info -- = malloc(sizeof(splitting_info_t) * info->num_dumpfile)) -+ = malloc(sizeof(struct splitting_info) * info->num_dumpfile)) - == NULL) { - MSG("Can't allocate memory for splitting_info.\n"); - return FALSE; -@@ -11077,13 +11077,13 @@ check_param_for_creating_dumpfile(int argc, char *argv[]) - - if (info->num_threads) { - if ((info->parallel_info = -- malloc(sizeof(parallel_info_t) * info->num_threads)) -+ malloc(sizeof(struct parallel_info) * info->num_threads)) - == NULL) { - MSG("Can't allocate memory for parallel_info.\n"); - return FALSE; - } - -- memset(info->parallel_info, 0, sizeof(parallel_info_t) -+ memset(info->parallel_info, 0, sizeof(struct parallel_info) - * info->num_threads); - } - -diff --git a/makedumpfile-1.6.7/makedumpfile.h b/makedumpfile-1.6.7/makedumpfile.h -index 68d9691..7217407 100644 ---- a/makedumpfile-1.6.7/makedumpfile.h -+++ b/makedumpfile-1.6.7/makedumpfile.h -@@ -1262,7 +1262,7 @@ struct splitting_info { - mdf_pfn_t end_pfn; - off_t offset_eraseinfo; - unsigned long size_eraseinfo; --} splitting_info_t; -+}; - - struct parallel_info { - int fd_memory; -@@ -1275,7 +1275,7 @@ struct parallel_info { - #ifdef USELZO - lzo_bytep wrkmem; - #endif --} parallel_info_t; -+}; - - struct ppc64_vmemmap { - unsigned long phys; -@@ -2006,8 +2006,8 @@ struct memory_range { - }; - - #define CRASH_RESERVED_MEM_NR 8 --struct memory_range crash_reserved_mem[CRASH_RESERVED_MEM_NR]; --int crash_reserved_mem_nr; -+extern struct memory_range crash_reserved_mem[CRASH_RESERVED_MEM_NR]; -+extern int crash_reserved_mem_nr; - - unsigned long read_vmcoreinfo_symbol(char *str_symbol); - int readmem(int type_addr, unsigned long long addr, void *bufptr, size_t size); --- -2.7.5 - diff --git a/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-cope-with-not-present-mem-section.patch b/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-cope-with-not-present-mem-section.patch deleted file mode 100644 index 2e9832c..0000000 --- a/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-cope-with-not-present-mem-section.patch +++ /dev/null @@ -1,65 +0,0 @@ -From e113f1c974c820f9633dc0073eda525d7575f365 Mon Sep 17 00:00:00 2001 -From: Pingfan Liu -Date: Mon, 20 Jan 2020 10:25:24 +0800 -Subject: [PATCH 3/7] [PATCH] cope with not-present mem section - -After kernel commit ba72b4c8cf60 ("mm/sparsemem: support sub-section -hotplug"), when hot-removed, section_mem_map is still encoded with section -start pfn, not NULL. This break the current makedumpfile. - - # makedumpfile -x vmlinux -l -d 31 vmcore vmcore.dump - get_mem_section: Could not validate mem_section. - get_mm_sparsemem: Can't get the address of mem_section. - - makedumpfile Failed. - -Whatever section_mem_map coding info after hot-removed, it is reliable -just to work on SECTION_MARKED_PRESENT bit. Fixing makedumpfile by this -way. - -[ This issue occurs on kernel 5.3 through 5.5, and should be fixed by -commit 1f503443e7df ("mm/sparse.c: reset section's mem_map when fully -deactivated") in 5.6-rc1, 5.5.3 and 5.4.19. ] - -Signed-off-by: Pingfan Liu -To: kexec@lists.infradead.org -Cc: Kazuhito Hagio -Cc: Baoquan He -Cc: David Hildenbrand -Cc: Andrew Morton -Cc: Dan Williams -Cc: Oscar Salvador -Cc: Michal Hocko -Cc: Qian Cai ---- - makedumpfile.c | 6 +----- - 1 file changed, 1 insertion(+), 5 deletions(-) - -diff --git a/makedumpfile-1.6.7/makedumpfile.c b/makedumpfile-1.6.7/makedumpfile.c -index ae7336a..607e07f 100644 ---- a/makedumpfile-1.6.7/makedumpfile.c -+++ b/makedumpfile-1.6.7/makedumpfile.c -@@ -3406,8 +3406,6 @@ section_mem_map_addr(unsigned long addr, unsigned long *map_mask) - map = ULONG(mem_section + OFFSET(mem_section.section_mem_map)); - mask = SECTION_MAP_MASK; - *map_mask = map & ~mask; -- if (map == 0x0) -- *map_mask |= SECTION_MARKED_PRESENT; - map &= mask; - free(mem_section); - -@@ -3453,10 +3451,8 @@ validate_mem_section(unsigned long *mem_sec, - mem_map = NOT_MEMMAP_ADDR; - } else { - mem_map = section_mem_map_addr(section, &map_mask); -+ /* for either no mem_map or hot-removed */ - if (!(map_mask & SECTION_MARKED_PRESENT)) { -- return FALSE; -- } -- if (mem_map == 0) { - mem_map = NOT_MEMMAP_ADDR; - } else { - mem_map = sparse_decode_mem_map(mem_map, --- -2.7.5 - diff --git a/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-sadump-kaslr-fix-failure-of-calculating-kaslr.patch b/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-sadump-kaslr-fix-failure-of-calculating-kaslr.patch deleted file mode 100644 index 6814649..0000000 --- a/SOURCES/kexec-tools-2.0.20-makedumpfile-PATCH-sadump-kaslr-fix-failure-of-calculating-kaslr.patch +++ /dev/null @@ -1,213 +0,0 @@ -From 3c0cf7a93cff83f1e711e241eb47fcb096a451c5 Mon Sep 17 00:00:00 2001 -From: HATAYAMA Daisuke -Date: Thu, 9 Jul 2020 18:27:49 +0900 -Subject: [PATCH] [PATCH] sadump, kaslr: fix failure of calculating - kaslr_offset due to an sadump format restriction - -We faced recently a memory dump collected by sadump where unused part -of register values are non-zero. For the crash dump, calculating -kaslr_offset fails because it is based on the assumption that unused -part of register values in the sadump format are always zero cleared. - -The problem is that used and unused part of register values are -rigorously indistinguishable in the sadump format. Although there is -kernel data structure that represents a map between logical cpu -numbers and lapic ids, they cannot be used in order to calculate -kaslr_offset. - -To fix this, we have no choice but use a trial-and-error approach: try -to use each entry of register values in order until we find a good -pair of cr3 and idtr by which we can refer to linux_banner symbol as -expected. - -Signed-off-by: HATAYAMA Daisuke ---- - sadump_info.c | 129 +++++++++++++++++++++++++++++++++++++++++----------------- - 1 file changed, 91 insertions(+), 38 deletions(-) - -diff --git a/makedumpfile-1.6.7/sadump_info.c b/makedumpfile-1.6.7/sadump_info.c -index 72a077b4f408..410c6bc2a909 100644 ---- a/makedumpfile-1.6.7/sadump_info.c -+++ b/makedumpfile-1.6.7/sadump_info.c -@@ -101,6 +101,7 @@ static int lookup_diskset(unsigned long long whole_offset, int *diskid, - unsigned long long *disk_offset); - static int max_mask_cpu(void); - static int cpu_online_mask_init(void); -+static int linux_banner_sanity_check(ulong cr3); - static int per_cpu_init(void); - static int get_data_from_elf_note_desc(const char *note_buf, uint32_t n_descsz, - char *name, uint32_t n_type, char **data); -@@ -1293,6 +1294,30 @@ finish: - return ret; - } - -+static int linux_banner_sanity_check(ulong cr3) -+{ -+ unsigned long linux_banner_paddr; -+ char buf[sizeof("Linux version")]; -+ -+ linux_banner_paddr = vtop4_x86_64_pagetable(SYMBOL(linux_banner), cr3); -+ if (linux_banner_paddr == NOT_PADDR) { -+ DEBUG_MSG("sadump: linux_banner address translation failed\n"); -+ return FALSE; -+ } -+ -+ if (!readmem(PADDR, linux_banner_paddr, &buf, sizeof(buf))) { -+ DEBUG_MSG("sadump: reading linux_banner failed\n"); -+ return FALSE; -+ } -+ -+ if (!STRNEQ(buf, "Linux version")) { -+ DEBUG_MSG("sadump: linux_banner sanity check failed\n"); -+ return FALSE; -+ } -+ -+ return TRUE; -+} -+ - /* - * Calculate kaslr_offset and phys_base - * -@@ -1370,59 +1395,85 @@ calc_kaslr_offset(void) - { - struct sadump_header *sh = si->sh_memory; - uint64_t idtr = 0, cr3 = 0, idtr_paddr; -- struct sadump_smram_cpu_state smram, zero; -+ struct sadump_smram_cpu_state smram; - int apicid; - unsigned long divide_error_vmcore, divide_error_vmlinux; - unsigned long kaslr_offset, phys_base; - unsigned long kaslr_offset_kdump, phys_base_kdump; -+ int sanity_check_passed = FALSE; - -- memset(&zero, 0, sizeof(zero)); - for (apicid = 0; apicid < sh->nr_cpus; ++apicid) { -+ -+ DEBUG_MSG("sadump: apicid: %d\n", apicid); -+ - if (!get_smram_cpu_state(apicid, &smram)) { - ERRMSG("get_smram_cpu_state error\n"); - return FALSE; - } - -- if (memcmp(&smram, &zero, sizeof(smram)) != 0) -- break; -- } -- if (apicid >= sh->nr_cpus) { -- ERRMSG("Can't get smram state\n"); -- return FALSE; -- } -+ idtr = ((uint64_t)smram.IdtUpper)<<32|(uint64_t)smram.IdtLower; - -- idtr = ((uint64_t)smram.IdtUpper)<<32 | (uint64_t)smram.IdtLower; -- if ((SYMBOL(pti_init) != NOT_FOUND_SYMBOL) || -- (SYMBOL(kaiser_init) != NOT_FOUND_SYMBOL)) -- cr3 = smram.Cr3 & ~(CR3_PCID_MASK|PTI_USER_PGTABLE_MASK); -- else -- cr3 = smram.Cr3 & ~CR3_PCID_MASK; -+ if (!smram.Cr3 || !idtr) { -+ DEBUG_MSG("sadump: cr3: %lx idt: %lx, skipped\n", -+ smram.Cr3, idtr); -+ continue; -+ } - -- /* Convert virtual address of IDT table to physical address */ -- if ((idtr_paddr = vtop4_x86_64_pagetable(idtr, cr3)) == NOT_PADDR) -- return FALSE; -+ if ((SYMBOL(pti_init) != NOT_FOUND_SYMBOL) || -+ (SYMBOL(kaiser_init) != NOT_FOUND_SYMBOL)) -+ cr3 = smram.Cr3 & ~(CR3_PCID_MASK|PTI_USER_PGTABLE_MASK); -+ else -+ cr3 = smram.Cr3 & ~CR3_PCID_MASK; - -- /* Now we can calculate kaslr_offset and phys_base */ -- divide_error_vmlinux = SYMBOL(divide_error); -- divide_error_vmcore = get_vec0_addr(idtr_paddr); -- kaslr_offset = divide_error_vmcore - divide_error_vmlinux; -- phys_base = idtr_paddr - -- (SYMBOL(idt_table) + kaslr_offset - __START_KERNEL_map); -+ /* Convert virtual address of IDT table to physical address */ -+ idtr_paddr = vtop4_x86_64_pagetable(idtr, cr3); -+ if (idtr_paddr == NOT_PADDR) { -+ DEBUG_MSG("sadump: converting IDT physical address " -+ "failed.\n"); -+ continue; -+ } - -- info->kaslr_offset = kaslr_offset; -- info->phys_base = phys_base; -+ /* Now we can calculate kaslr_offset and phys_base */ -+ divide_error_vmlinux = SYMBOL(divide_error); -+ divide_error_vmcore = get_vec0_addr(idtr_paddr); -+ kaslr_offset = divide_error_vmcore - divide_error_vmlinux; -+ phys_base = idtr_paddr - -+ (SYMBOL(idt_table)+kaslr_offset-__START_KERNEL_map); - -- DEBUG_MSG("sadump: idtr=%" PRIx64 "\n", idtr); -- DEBUG_MSG("sadump: cr3=%" PRIx64 "\n", cr3); -- DEBUG_MSG("sadump: idtr(phys)=%" PRIx64 "\n", idtr_paddr); -- DEBUG_MSG("sadump: devide_error(vmlinux)=%lx\n", -- divide_error_vmlinux); -- DEBUG_MSG("sadump: devide_error(vmcore)=%lx\n", -- divide_error_vmcore); -+ info->kaslr_offset = kaslr_offset; -+ info->phys_base = phys_base; - -- /* Reload symbol */ -- if (!get_symbol_info()) -- return FALSE; -+ DEBUG_MSG("sadump: idtr=%" PRIx64 "\n", idtr); -+ DEBUG_MSG("sadump: cr3=%" PRIx64 "\n", cr3); -+ DEBUG_MSG("sadump: idtr(phys)=%" PRIx64 "\n", idtr_paddr); -+ DEBUG_MSG("sadump: devide_error(vmlinux)=%lx\n", -+ divide_error_vmlinux); -+ DEBUG_MSG("sadump: devide_error(vmcore)=%lx\n", -+ divide_error_vmcore); -+ -+ /* Reload symbol */ -+ if (!get_symbol_info()) { -+ ERRMSG("Reading symbol table failed\n"); -+ return FALSE; -+ } -+ -+ /* Sanity check */ -+ if (linux_banner_sanity_check(cr3)) { -+ sanity_check_passed = TRUE; -+ break; -+ } -+ -+ info->kaslr_offset = 0; -+ info->phys_base = 0; -+ } -+ -+ if (!sanity_check_passed) { -+ ERRMSG("failed to calculate kaslr_offset and phys_base; " -+ "default to 0\n"); -+ info->kaslr_offset = 0; -+ info->phys_base = 0; -+ return TRUE; -+ } - - /* - * Check if current kaslr_offset/phys_base is for 1st kernel or 2nd -@@ -1430,13 +1481,15 @@ calc_kaslr_offset(void) - * from vmcoreinfo - */ - if (get_kaslr_offset_from_vmcoreinfo(cr3, &kaslr_offset_kdump, -- &phys_base_kdump)) { -+ &phys_base_kdump)) { - info->kaslr_offset = kaslr_offset_kdump; - info->phys_base = phys_base_kdump; - - /* Reload symbol */ -- if (!get_symbol_info()) -+ if (!get_symbol_info()) { -+ ERRMSG("Reading symbol table failed\n"); - return FALSE; -+ } - } - - DEBUG_MSG("sadump: kaslr_offset=%lx\n", info->kaslr_offset); --- -2.7.4 - diff --git a/SOURCES/rhonly-kexec-tools-2.0.18-makedumpfile-arm64-Add-support-for-ARMv8.2-LVA-52-bi.patch b/SOURCES/rhonly-kexec-tools-2.0.18-makedumpfile-arm64-Add-support-for-ARMv8.2-LVA-52-bi.patch deleted file mode 100644 index 71bdca4..0000000 --- a/SOURCES/rhonly-kexec-tools-2.0.18-makedumpfile-arm64-Add-support-for-ARMv8.2-LVA-52-bi.patch +++ /dev/null @@ -1,235 +0,0 @@ -From: Bhupesh Sharma -Date: Wed, 6 Feb 2019 12:31:29 +0530 -Subject: [PATCH] makedumpfile/arm64: Add support for ARMv8.2-LVA (52-bit - user-space VA support) - -With ARMv8.2-LVA architecture extension availability, arm64 hardware -which supports this extension can support upto 52-bit virtual -addresses. It is specially useful for having a 52-bit user-space virtual -address space while the kernel can still retain 48-bit virtual -addresses. - -Since at the moment we enable the support of this extension in the -kernel via a CONFIG flag (CONFIG_ARM64_USER_VA_BITS_52), so there are -no clear mechanisms in user-space to determine this CONFIG -flag value and use it to determine the user-space VA address range -values. - -'makedumpfile' can instead use 'MAX_USER_VA_BITS' value to -determine the maximum virtual physical address supported by user-space. -If 'MAX_USER_VA_BITS' value is greater than 'VA_BITS' than we are -running a use-case where user-space is 52-bit and underlying kernel is -still 48-bit. The increased 'PTRS_PER_PGD' value for such cases can then -be calculated as is done by the underlying kernel (see kernel file -'arch/arm64/include/asm/pgtable-hwdef.h' for details): - - #define PTRS_PER_PGD (1 << (MAX_USER_VA_BITS - PGDIR_SHIFT)) - -I have sent a kernel patch upstream to add 'MAX_USER_VA_BITS' to -vmcoreinfo for arm64 (see [0]). - -This patch is in accordance with ARMv8 Architecture Reference Manual -version D.a - -[0]. -http://lists.infradead.org/pipermail/kexec/2019-February/022411.html - -Signed-off-by: Bhupesh Sharma - ---- - arch/arm64.c | 109 ++++++++++++++++++++++++++++++++++++++++++--------------- - makedumpfile.c | 2 ++ - makedumpfile.h | 1 + - 3 files changed, 83 insertions(+), 29 deletions(-) - -diff --git a/makedumpfile-1.6.7/arch/arm64.c b/makedumpfile-1.6.7/arch/arm64.c -index 0535193..5fcf59d 100644 ---- a/makedumpfile-1.6.7/arch/arm64.c -+++ b/makedumpfile-1.6.7/arch/arm64.c -@@ -41,6 +41,7 @@ typedef struct { - - static int pgtable_level; - static int va_bits; -+static int max_user_va_bits; - static unsigned long kimage_voffset; - - #define SZ_4K (4 * 1024) -@@ -61,7 +62,7 @@ static unsigned long kimage_voffset; - - #define PAGE_MASK (~(PAGESIZE() - 1)) - #define PGDIR_SHIFT ((PAGESHIFT() - 3) * pgtable_level + 3) --#define PTRS_PER_PGD (1 << (va_bits - PGDIR_SHIFT)) -+#define PTRS_PER_PGD (1 << ((max_user_va_bits) - PGDIR_SHIFT)) - #define PUD_SHIFT get_pud_shift_arm64() - #define PUD_SIZE (1UL << PUD_SHIFT) - #define PUD_MASK (~(PUD_SIZE - 1)) -@@ -73,6 +74,10 @@ static unsigned long kimage_voffset; - #define PTRS_PER_PMD PTRS_PER_PTE - - #define PAGE_PRESENT (1 << 0) -+ -+/* -+ * Section address mask and size definitions. -+ */ - #define SECTIONS_SIZE_BITS 30 - /* Highest possible physical address supported */ - #define PHYS_MASK_SHIFT 48 -@@ -284,14 +289,83 @@ get_stext_symbol(void) - return(found ? kallsym : FALSE); - } - -+static int -+get_va_bits_from_stext_arm64(void) -+{ -+ ulong _stext; -+ -+ _stext = get_stext_symbol(); -+ if (!_stext) { -+ ERRMSG("Can't get the symbol of _stext.\n"); -+ return FALSE; -+ } -+ -+ /* Derive va_bits as per arch/arm64/Kconfig */ -+ if ((_stext & PAGE_OFFSET_36) == PAGE_OFFSET_36) { -+ va_bits = 36; -+ } else if ((_stext & PAGE_OFFSET_39) == PAGE_OFFSET_39) { -+ va_bits = 39; -+ } else if ((_stext & PAGE_OFFSET_42) == PAGE_OFFSET_42) { -+ va_bits = 42; -+ } else if ((_stext & PAGE_OFFSET_47) == PAGE_OFFSET_47) { -+ va_bits = 47; -+ } else if ((_stext & PAGE_OFFSET_48) == PAGE_OFFSET_48) { -+ va_bits = 48; -+ } else { -+ ERRMSG("Cannot find a proper _stext for calculating VA_BITS\n"); -+ return FALSE; -+ } -+ -+ DEBUG_MSG("va_bits : %d\n", va_bits); -+ -+ return TRUE; -+} -+ -+static void -+get_page_offset_arm64(void) -+{ -+ info->page_offset = (0xffffffffffffffffUL) << (va_bits - 1); -+ -+ DEBUG_MSG("page_offset : %lx\n", info->page_offset); -+} -+ - int - get_machdep_info_arm64(void) - { - /* Check if va_bits is still not initialized. If still 0, call - * get_versiondep_info() to initialize the same. - */ -+ if (NUMBER(VA_BITS) != NOT_FOUND_NUMBER) { -+ va_bits = NUMBER(VA_BITS); -+ DEBUG_MSG("va_bits : %d (vmcoreinfo)\n", -+ va_bits); -+ } -+ -+ /* Check if va_bits is still not initialized. If still 0, call -+ * get_versiondep_info() to initialize the same from _stext -+ * symbol. -+ */ - if (!va_bits) -- get_versiondep_info_arm64(); -+ if (get_va_bits_from_stext_arm64() == ERROR) -+ return ERROR; -+ -+ get_page_offset_arm64(); -+ -+ if (NUMBER(MAX_USER_VA_BITS) != NOT_FOUND_NUMBER) { -+ max_user_va_bits = NUMBER(MAX_USER_VA_BITS); -+ DEBUG_MSG("max_user_va_bits : %d (vmcoreinfo)\n", -+ max_user_va_bits); -+ } -+ -+ /* Check if max_user_va_bits is still not initialized. -+ * If still 0, its not available in vmcoreinfo and its -+ * safe to initialize it with va_bits. -+ */ -+ if (!max_user_va_bits) { -+ max_user_va_bits = va_bits; -+ DEBUG_MSG("max_user_va_bits : %d (default = va_bits)\n", -+ max_user_va_bits); -+ } - - if (!calculate_plat_config()) { - ERRMSG("Can't determine platform config values\n"); -@@ -330,34 +404,11 @@ get_xen_info_arm64(void) - int - get_versiondep_info_arm64(void) - { -- ulong _stext; -- -- _stext = get_stext_symbol(); -- if (!_stext) { -- ERRMSG("Can't get the symbol of _stext.\n"); -- return FALSE; -- } -- -- /* Derive va_bits as per arch/arm64/Kconfig */ -- if ((_stext & PAGE_OFFSET_36) == PAGE_OFFSET_36) { -- va_bits = 36; -- } else if ((_stext & PAGE_OFFSET_39) == PAGE_OFFSET_39) { -- va_bits = 39; -- } else if ((_stext & PAGE_OFFSET_42) == PAGE_OFFSET_42) { -- va_bits = 42; -- } else if ((_stext & PAGE_OFFSET_47) == PAGE_OFFSET_47) { -- va_bits = 47; -- } else if ((_stext & PAGE_OFFSET_48) == PAGE_OFFSET_48) { -- va_bits = 48; -- } else { -- ERRMSG("Cannot find a proper _stext for calculating VA_BITS\n"); -- return FALSE; -- } -- -- info->page_offset = (0xffffffffffffffffUL) << (va_bits - 1); -+ if (!va_bits) -+ if (get_va_bits_from_stext_arm64() == ERROR) -+ return ERROR; - -- DEBUG_MSG("va_bits : %d\n", va_bits); -- DEBUG_MSG("page_offset : %lx\n", info->page_offset); -+ get_page_offset_arm64(); - - return TRUE; - } -diff --git a/makedumpfile-1.6.7/makedumpfile.c b/makedumpfile-1.6.7/makedumpfile.c -index d76a435..c8906b5 100644 ---- a/makedumpfile-1.6.7/makedumpfile.c -+++ b/makedumpfile-1.6.7/makedumpfile.c -@@ -2313,6 +2313,7 @@ write_vmcoreinfo_data(void) - - WRITE_NUMBER("HUGETLB_PAGE_DTOR", HUGETLB_PAGE_DTOR); - #ifdef __aarch64__ -+ WRITE_NUMBER("MAX_USER_VA_BITS", MAX_USER_VA_BITS); - WRITE_NUMBER("VA_BITS", VA_BITS); - WRITE_NUMBER_UNSIGNED("PHYS_OFFSET", PHYS_OFFSET); - WRITE_NUMBER_UNSIGNED("kimage_voffset", kimage_voffset); -@@ -2719,6 +2720,7 @@ read_vmcoreinfo(void) - READ_NUMBER("phys_base", phys_base); - READ_NUMBER("KERNEL_IMAGE_SIZE", KERNEL_IMAGE_SIZE); - #ifdef __aarch64__ -+ READ_NUMBER("MAX_USER_VA_BITS", MAX_USER_VA_BITS); - READ_NUMBER("VA_BITS", VA_BITS); - READ_NUMBER_UNSIGNED("PHYS_OFFSET", PHYS_OFFSET); - READ_NUMBER_UNSIGNED("kimage_voffset", kimage_voffset); -diff --git a/makedumpfile-1.6.7/makedumpfile.h b/makedumpfile-1.6.7/makedumpfile.h -index 24b2f69..cccb52a 100644 ---- a/makedumpfile-1.6.7/makedumpfile.h -+++ b/makedumpfile-1.6.7/makedumpfile.h -@@ -1937,6 +1937,7 @@ struct number_table { - long phys_base; - long KERNEL_IMAGE_SIZE; - #ifdef __aarch64__ -+ long MAX_USER_VA_BITS; - long VA_BITS; - unsigned long PHYS_OFFSET; - unsigned long kimage_voffset; --- -2.7.5 - diff --git a/SPECS/kexec-tools.spec b/SPECS/kexec-tools.spec index 6ffc4cf..6e8a762 100644 --- a/SPECS/kexec-tools.spec +++ b/SPECS/kexec-tools.spec @@ -1,6 +1,6 @@ Name: kexec-tools Version: 2.0.20 -Release: 37%{?dist} +Release: 38%{?dist} License: GPLv2 Group: Applications/System Summary: The kexec/kdump userspace component @@ -13,7 +13,7 @@ Source4: kdump.sysconfig.i386 Source5: kdump.sysconfig.ppc64 Source7: mkdumprd Source8: kdump.conf -Source9: http://downloads.sourceforge.net/project/makedumpfile/makedumpfile/1.6.7/makedumpfile-1.6.7.tar.gz +Source9: https://github.com/makedumpfile/makedumpfile/archive/1.6.8.tar.gz Source10: kexec-kdump-howto.txt Source12: mkdumprd.8 Source13: 98-kexec.rules @@ -96,7 +96,7 @@ ExcludeArch: i686 # Patch601: rhelonly-kexec-tools-2.0.16-koji-build-fail-workaround.patch Patch602: rhelonly-kexec-tools-2.0.18-eppic-fix-issues-with-hardening-flags.patch -Patch603: rhonly-kexec-tools-2.0.18-makedumpfile-arm64-Add-support-for-ARMv8.2-LVA-52-bi.patch +#Patch603: rhonly-kexec-tools-2.0.18-makedumpfile-arm64-Add-support-for-ARMv8.2-LVA-52-bi.patch Patch604: kexec-tools-2.0.20-Cleanup-remove-the-read_elf_kcore.patch Patch605: kexec-tools-2.0.20-Fix-an-error-definition-about-the-variable-fname.patch Patch606: kexec-tools-2.0.20-Cleanup-move-it-back-from-util_lib-elf_info.c.patch @@ -107,14 +107,6 @@ Patch610: kexec-tools-2.0.20-arm64-kexec-allocate-memory-space-avoiding-reserved Patch611: kexec-tools-2.0.20-arm64-kdump-deal-with-a-lot-of-resource-entries-in-p.patch # Patches 701 onward for makedumpfile -Patch701: kexec-tools-2.0.20-makedumpfile-PATCH-Remove-duplicated-variable-definitions.patch -Patch702: kexec-tools-2.0.20-makedumpfile-PATCH-cope-with-not-present-mem-section.patch -Patch703: kexec-tools-2.0.20-makedumpfile-PATCH-Introduce-check-params-option.patch -Patch704: kexec-tools-2.0.20-makedumpfile-PATCH-Makefile-Fix-build-errors-in-static-build.patch -Patch705: kexec-tools-2.0.20-makedumpfile-PATCH-Align-PMD_SECTION_MASK-with-PHYS_MASK.patch -Patch706: kexec-tools-2.0.20-makedumpfile-PATCH-Fix-cd_header-offset-overflow-with-large-pfn.patch -Patch707: kexec-tools-2.0.20-makedumpfile-PATCH-Avoid-false-positive-failure-in-mem_seciton-va.patch -Patch708: kexec-tools-2.0.20-makedumpfile-PATCH-sadump-kaslr-fix-failure-of-calculating-kaslr.patch %description @@ -133,7 +125,7 @@ tar -z -x -v -f %{SOURCE19} %patch601 -p1 %patch602 -p1 -%patch603 -p1 +#%patch603 -p1 %patch604 -p1 %patch605 -p1 %patch606 -p1 @@ -142,14 +134,6 @@ tar -z -x -v -f %{SOURCE19} %patch609 -p1 %patch610 -p1 %patch611 -p1 -%patch701 -p1 -%patch702 -p1 -%patch703 -p1 -%patch704 -p1 -%patch705 -p1 -%patch706 -p1 -%patch707 -p1 -%patch708 -p1 %ifarch ppc %define archdef ARCH=ppc @@ -179,8 +163,8 @@ cp %{SOURCE31} . make %ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64 make -C eppic/libeppic -make -C makedumpfile-1.6.7 LINKTYPE=dynamic USELZO=on USESNAPPY=on -make -C makedumpfile-1.6.7 LDFLAGS="$LDFLAGS -I../eppic/libeppic -L../eppic/libeppic" eppic_makedumpfile.so +make -C makedumpfile-1.6.8 LINKTYPE=dynamic USELZO=on USESNAPPY=on +make -C makedumpfile-1.6.8 LDFLAGS="$LDFLAGS -I../eppic/libeppic -L../eppic/libeppic" eppic_makedumpfile.so %endif %install @@ -237,13 +221,13 @@ install -m 755 -D %{SOURCE32} $RPM_BUILD_ROOT%{_prefix}/lib/kernel/install.d/60- %ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64 -install -m 755 makedumpfile-1.6.7/makedumpfile $RPM_BUILD_ROOT/usr/sbin/makedumpfile -install -m 644 makedumpfile-1.6.7/makedumpfile.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/makedumpfile.8.gz -install -m 644 makedumpfile-1.6.7/makedumpfile.conf.5.gz $RPM_BUILD_ROOT/%{_mandir}/man5/makedumpfile.conf.5.gz -install -m 644 makedumpfile-1.6.7/makedumpfile.conf $RPM_BUILD_ROOT/%{_sysconfdir}/makedumpfile.conf.sample -install -m 755 makedumpfile-1.6.7/eppic_makedumpfile.so $RPM_BUILD_ROOT/%{_libdir}/eppic_makedumpfile.so +install -m 755 makedumpfile-1.6.8/makedumpfile $RPM_BUILD_ROOT/usr/sbin/makedumpfile +install -m 644 makedumpfile-1.6.8/makedumpfile.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/makedumpfile.8.gz +install -m 644 makedumpfile-1.6.8/makedumpfile.conf.5.gz $RPM_BUILD_ROOT/%{_mandir}/man5/makedumpfile.conf.5.gz +install -m 644 makedumpfile-1.6.8/makedumpfile.conf $RPM_BUILD_ROOT/%{_sysconfdir}/makedumpfile.conf.sample +install -m 755 makedumpfile-1.6.8/eppic_makedumpfile.so $RPM_BUILD_ROOT/%{_libdir}/eppic_makedumpfile.so mkdir -p $RPM_BUILD_ROOT/usr/share/makedumpfile/eppic_scripts/ -install -m 644 makedumpfile-1.6.7/eppic_scripts/* $RPM_BUILD_ROOT/usr/share/makedumpfile/eppic_scripts/ +install -m 644 makedumpfile-1.6.8/eppic_scripts/* $RPM_BUILD_ROOT/usr/share/makedumpfile/eppic_scripts/ %endif %define remove_dracut_prefix() %(echo -n %1|sed 's/.*dracut-//g') @@ -387,6 +371,15 @@ done %endif %changelog +* Fri Dec 11 2020 Pingfan Liu - 2.0.20-38 +- Don's try to restart dracut-initqueue if it's already failed +- fadump-howto: update about 'nocma' and 'off' options for 'fadump=' parameter +- dracut-module-setup.sh: use auto6 for ipv6 +- module-setup.sh: enable vlan on team interface +- Fix rootfs detection in dump_fs +- Remove RHEL-only patch: kexec-tools-2.0.18-makedumpfile-arm64-Add-support-for-ARMv8.2-LVA-52-bi.patch +- Rebase to makedumpfile-1.6.8 (step1) + * Fri Nov 13 2020 Pingfan Liu - 2.0.20-37 - Doc: improve the usage documentation of the logger - Update the kdump sysconfig