From a9f3ca4c4447d653745ab2026d153d5bad355f12 Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Nov 06 2024 01:46:13 +0000 Subject: Rebase makedumpfile to v1.7.6 Signed-off-by: Tao Liu --- diff --git a/kexec-tools.spec b/kexec-tools.spec index 323fcad..67ae528 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -1,6 +1,6 @@ %global eppic_ver e8844d3793471163ae4a56d8f95897be9e5bd554 %global eppic_shortver %(c=%{eppic_ver}; echo ${c:0:7}) -%global mkdf_ver 1.7.4 +%global mkdf_ver 1.7.6 %global mkdf_shortver %(c=%{mkdf_ver}; echo ${c:0:7}) Name: kexec-tools diff --git a/makedumpfile-1.7.2-0001-Mark-start-of-1.7.3-development-phase-with-ver.patch b/makedumpfile-1.7.2-0001-Mark-start-of-1.7.3-development-phase-with-ver.patch deleted file mode 100644 index 5d8aa4c..0000000 --- a/makedumpfile-1.7.2-0001-Mark-start-of-1.7.3-development-phase-with-ver.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 2f53c3a6006a475cca65f73538dc2c844c313940 Mon Sep 17 00:00:00 2001 -From: Kazuhito Hagio -Date: Thu, 27 Oct 2022 09:34:28 +0900 -Subject: [PATCH 1/7] [PATCH] Mark start of 1.7.3 development phase with - version 1.7.2++ - -Signed-off-by: Kazuhito Hagio ---- - Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/makedumpfile-1.7.2/Makefile b/makedumpfile-1.7.2/Makefile -index 548e5b7..f982aaf 100644 ---- a/makedumpfile-1.7.2/Makefile -+++ b/makedumpfile-1.7.2/Makefile -@@ -1,6 +1,6 @@ - # makedumpfile - --VERSION=1.7.2 -+VERSION=1.7.2++ - DATE=20 Oct 2022 - - # Honour the environment variable CC --- -2.33.1 - diff --git a/makedumpfile-1.7.2-0002-Makefile-Remove-version-from-usr-share-makedum.patch b/makedumpfile-1.7.2-0002-Makefile-Remove-version-from-usr-share-makedum.patch deleted file mode 100644 index 73d405c..0000000 --- a/makedumpfile-1.7.2-0002-Makefile-Remove-version-from-usr-share-makedum.patch +++ /dev/null @@ -1,34 +0,0 @@ -From f1d84a5d69d81bc7a89aefae504be88df1e50693 Mon Sep 17 00:00:00 2001 -From: Leonidas Spyropoulos -Date: Fri, 21 Oct 2022 11:24:59 +0100 -Subject: [PATCH 2/7] [PATCH] Makefile: Remove version from - /usr/share/makedumpfile - -Version specific paths doesn't make sense at /usr/share/makedumpfile. -This assumes you will have only one version installed which on a normal -system it makes sense and devs can always specify different DESTDIR per -versions. - -Fixes: https://github.com/makedumpfile/makedumpfile/issues/10 -Signed-off-by: Leonidas Spyropoulos ---- - Makefile | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/makedumpfile-1.7.2/Makefile b/makedumpfile-1.7.2/Makefile -index f982aaf..a289e41 100644 ---- a/makedumpfile-1.7.2/Makefile -+++ b/makedumpfile-1.7.2/Makefile -@@ -130,6 +130,6 @@ install: - install -m 755 -t ${DESTDIR}/usr/sbin makedumpfile $(VPATH)makedumpfile-R.pl - install -m 644 -t ${DESTDIR}/usr/share/man/man8 makedumpfile.8 - install -m 644 -t ${DESTDIR}/usr/share/man/man5 makedumpfile.conf.5 -- mkdir -p ${DESTDIR}/usr/share/makedumpfile-${VERSION}/eppic_scripts -- install -m 644 -D $(VPATH)makedumpfile.conf ${DESTDIR}/usr/share/makedumpfile-${VERSION}/makedumpfile.conf.sample -- install -m 644 -t ${DESTDIR}/usr/share/makedumpfile-${VERSION}/eppic_scripts/ $(VPATH)eppic_scripts/* -+ mkdir -p ${DESTDIR}/usr/share/makedumpfile/eppic_scripts -+ install -m 644 -D $(VPATH)makedumpfile.conf ${DESTDIR}/usr/share/makedumpfile/makedumpfile.conf.sample -+ install -m 644 -t ${DESTDIR}/usr/share/makedumpfile/eppic_scripts/ $(VPATH)eppic_scripts/* --- -2.33.1 - diff --git a/makedumpfile-1.7.2-0003-IMPLEMENTAION-Add-a-description-of-the-flatten.patch b/makedumpfile-1.7.2-0003-IMPLEMENTAION-Add-a-description-of-the-flatten.patch deleted file mode 100644 index 17cb7a7..0000000 --- a/makedumpfile-1.7.2-0003-IMPLEMENTAION-Add-a-description-of-the-flatten.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 42955c0b4d9c0723de72a810f80e4b3543053631 Mon Sep 17 00:00:00 2001 -From: Kazuhito Hagio -Date: Wed, 30 Nov 2022 12:02:44 +0900 -Subject: [PATCH 3/7] [PATCH] IMPLEMENTAION: Add a description of the flattened - format - -Signed-off-by: Kazuhito Hagio ---- - IMPLEMENTATION | 45 +++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 45 insertions(+) - -diff --git a/makedumpfile-1.7.2/IMPLEMENTATION b/makedumpfile-1.7.2/IMPLEMENTATION -index 589c5bf..b7a1603 100644 ---- a/makedumpfile-1.7.2/IMPLEMENTATION -+++ b/makedumpfile-1.7.2/IMPLEMENTATION -@@ -280,3 +280,48 @@ - - If there is no segment dumped into the DUMPFILE, the DUMPFILE can't be - analysed by crash. -+ -+ -+* The flattened format -+ -+ This format is mostly used to send dump data to a remote host via SSH. -+ The kdump-compressed format and ELF format require random access to create -+ a DUMPFILE, so it cannot be written directly to standard output. -+ The flattened format adds the original offset and size of each data block, -+ and it can be rearranged to the original format on the remote host. -+ -+ - File structure -+ -+ This is the case of the kdump-compressed format. -+ File offset -+ +------------------------------------------+ 0x0 -+ | flat header (struct makedumpfile_header) | -+ | | -+ |------------------------------------------| 0x1000 (4096) -+ | flat data header | -+ | (struct makedumpfile_data_header) | -+ | main header (struct disk_dump_header) | -+ |------------------------------------------| (not aligned) -+ | flat data header | -+ | : | -+ -+ Note: For the ELF format, ELF header is not always the first data. -+ -+ - flat header -+ -+ struct makedumpfile_header { -+ char signature[SIG_LEN_MDF]; /* = "makedumpfile\0\0\0\0" */ -+ int64_t type; /* = TYPE_FLAT_HEADER (1) */ -+ int64_t version; /* = VERSION_FLAT_HEADER (1) */ -+ }; -+ -+ Note: the type and version are big endian. -+ -+ - flat data header -+ -+ struct makedumpfile_data_header { -+ int64_t offset; -+ int64_t buf_size; -+ }; -+ -+ Note: the offset and buf_size are big endian. --- -2.33.1 - diff --git a/makedumpfile-1.7.2-0004-Fix-wrong-exclusion-of-slab-pages-on-Linux-6.2.patch b/makedumpfile-1.7.2-0004-Fix-wrong-exclusion-of-slab-pages-on-Linux-6.2.patch deleted file mode 100644 index 08548e1..0000000 --- a/makedumpfile-1.7.2-0004-Fix-wrong-exclusion-of-slab-pages-on-Linux-6.2.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 5f17bdd2128998a3eeeb4521d136a192222fadb6 Mon Sep 17 00:00:00 2001 -From: Kazuhito Hagio -Date: Wed, 21 Dec 2022 11:06:39 +0900 -Subject: [PATCH 4/7] [PATCH] Fix wrong exclusion of slab pages on Linux - 6.2-rc1 - -* Required for kernel 6.2 - -Kernel commit 130d4df57390 ("mm/sl[au]b: rearrange struct slab fields to -allow larger rcu_head"), which is contained in Linux 6.2-rc1 and later, -made the offset of slab.slabs equal to page.mapping's one. As a result, -"makedumpfile -d 8", which should exclude user data, excludes some slab -pages wrongly because isAnon() returns true when slab.slabs is an odd -number. With such dumpfiles, crash can fail to start session with an -error like this: - - # crash vmlinux dumpfile - ... - crash: page excluded: kernel virtual address: ffff8fa047ac2fe8 type: "xa_node shift" - -Make isAnon() check that the page is not slab to fix this. - -Signed-off-by: Kazuhito Hagio ---- - makedumpfile.c | 6 +++--- - makedumpfile.h | 9 +++------ - 2 files changed, 6 insertions(+), 9 deletions(-) - -diff --git a/makedumpfile-1.7.2/makedumpfile.c b/makedumpfile-1.7.2/makedumpfile.c -index ff821eb..f403683 100644 ---- a/makedumpfile-1.7.2/makedumpfile.c -+++ b/makedumpfile-1.7.2/makedumpfile.c -@@ -6502,7 +6502,7 @@ __exclude_unnecessary_pages(unsigned long mem_map, - */ - else if ((info->dump_level & DL_EXCLUDE_CACHE) - && is_cache_page(flags) -- && !isPrivate(flags) && !isAnon(mapping)) { -+ && !isPrivate(flags) && !isAnon(mapping, flags)) { - pfn_counter = &pfn_cache; - } - /* -@@ -6510,7 +6510,7 @@ __exclude_unnecessary_pages(unsigned long mem_map, - */ - else if ((info->dump_level & DL_EXCLUDE_CACHE_PRI) - && is_cache_page(flags) -- && !isAnon(mapping)) { -+ && !isAnon(mapping, flags)) { - if (isPrivate(flags)) - pfn_counter = &pfn_cache_private; - else -@@ -6522,7 +6522,7 @@ __exclude_unnecessary_pages(unsigned long mem_map, - * - hugetlbfs pages - */ - else if ((info->dump_level & DL_EXCLUDE_USER_DATA) -- && (isAnon(mapping) || isHugetlb(compound_dtor))) { -+ && (isAnon(mapping, flags) || isHugetlb(compound_dtor))) { - pfn_counter = &pfn_user; - } - /* -diff --git a/makedumpfile-1.7.2/makedumpfile.h b/makedumpfile-1.7.2/makedumpfile.h -index 70a1a91..21dec7d 100644 ---- a/makedumpfile-1.7.2/makedumpfile.h -+++ b/makedumpfile-1.7.2/makedumpfile.h -@@ -161,12 +161,9 @@ test_bit(int nr, unsigned long addr) - #define isSwapBacked(flags) test_bit(NUMBER(PG_swapbacked), flags) - #define isHWPOISON(flags) (test_bit(NUMBER(PG_hwpoison), flags) \ - && (NUMBER(PG_hwpoison) != NOT_FOUND_NUMBER)) -- --static inline int --isAnon(unsigned long mapping) --{ -- return ((unsigned long)mapping & PAGE_MAPPING_ANON) != 0; --} -+#define isSlab(flags) test_bit(NUMBER(PG_slab), flags) -+#define isAnon(mapping, flags) (((unsigned long)mapping & PAGE_MAPPING_ANON) != 0 \ -+ && !isSlab(flags)) - - #define PTOB(X) (((unsigned long long)(X)) << PAGESHIFT()) - #define BTOP(X) (((unsigned long long)(X)) >> PAGESHIFT()) --- -2.33.1 - diff --git a/makedumpfile-1.7.2-0005-sadump-fix-failure-of-reading-memory-when-5-le.patch b/makedumpfile-1.7.2-0005-sadump-fix-failure-of-reading-memory-when-5-le.patch deleted file mode 100644 index cc62076..0000000 --- a/makedumpfile-1.7.2-0005-sadump-fix-failure-of-reading-memory-when-5-le.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 58553ad03187f0cf208d6c4a0dc026c6338e5edd Mon Sep 17 00:00:00 2001 -From: "Daisuke Hatayama (Fujitsu)" -Date: Wed, 29 Mar 2023 12:44:10 +0000 -Subject: [PATCH 5/7] [PATCH] sadump: fix failure of reading memory when - 5-level paging is enabled - -makedumpfile fails as follows for memory dumps collected by sadump -when 5-level paging is enabled on the corresponding systems: - - # makedumpfile -l -d 31 -x ./vmlinux ./dump.sadump dump.sadump-ld31 - __vtop4_x86_64: Can't get a valid pgd. - ...snip... - __vtop4_x86_64: Can't get a valid pgd. - calc_kaslr_offset: failed to calculate kaslr_offset and phys_base; default to 0 - __vtop4_x86_64: Can't get a valid pgd. - readmem: Can't convert a virtual address(ffffffff82fce960) to physical address. - readmem: type_addr: 0, addr:ffffffff82fce960, size:1024 - cpu_online_mask_init: Can't read cpu_online_mask memory. - - makedumpfile Failed. - -This is because 5-level paging support has not been done yet for -sadump; the work of the 5-level paging support was done by the commit -30a3214a7193e94c551c0cebda5918a72a35c589 (PATCH 4/4 arch/x86_64: Add -5-level paging support) but that was focused on the core part only. - -Having said that, most of things has already been finished in the -commit. What needs to be newly added for sadump is just how to check -if 5-level paging is enabled for a given memory dump. - -For that purpose, let's refer to CR4.LA57, bit 12 of CR4, representing -whether 5-level paging is enabled or not. We can do this because -memory dumps collected by sadump have SMRAM as note information and -they include CR4 together with the other control registers. - -Signed-off-by: HATAYAMA Daisuke ---- - sadump_info.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/makedumpfile-1.7.2/sadump_info.c b/makedumpfile-1.7.2/sadump_info.c -index adfa8dc..2c44068 100644 ---- a/makedumpfile-1.7.2/sadump_info.c -+++ b/makedumpfile-1.7.2/sadump_info.c -@@ -1362,6 +1362,7 @@ static int linux_banner_sanity_check(ulong cr3) - #define PTI_USER_PGTABLE_BIT (info->page_shift) - #define PTI_USER_PGTABLE_MASK (1 << PTI_USER_PGTABLE_BIT) - #define CR3_PCID_MASK 0xFFFull -+#define CR4_LA57 (1 << 12) - int - calc_kaslr_offset(void) - { -@@ -1397,6 +1398,8 @@ calc_kaslr_offset(void) - else - cr3 = smram.Cr3 & ~CR3_PCID_MASK; - -+ NUMBER(pgtable_l5_enabled) = !!(smram.Cr4 & CR4_LA57); -+ - /* Convert virtual address of IDT table to physical address */ - idtr_paddr = vtop4_x86_64_pagetable(idtr, cr3); - if (idtr_paddr == NOT_PADDR) { -@@ -1417,6 +1420,7 @@ calc_kaslr_offset(void) - - DEBUG_MSG("sadump: idtr=%" PRIx64 "\n", idtr); - DEBUG_MSG("sadump: cr3=%" PRIx64 "\n", cr3); -+ DEBUG_MSG("sadump: cr4=%" PRIx32 "\n", smram.Cr4); - DEBUG_MSG("sadump: idtr(phys)=%" PRIx64 "\n", idtr_paddr); - DEBUG_MSG("sadump: devide_error(vmlinux)=%lx\n", - divide_error_vmlinux); --- -2.33.1 - diff --git a/makedumpfile-1.7.2-0006-1-2-eppic-Fix-incompatible-pointer-type-warnin.patch b/makedumpfile-1.7.2-0006-1-2-eppic-Fix-incompatible-pointer-type-warnin.patch deleted file mode 100644 index fbe298b..0000000 --- a/makedumpfile-1.7.2-0006-1-2-eppic-Fix-incompatible-pointer-type-warnin.patch +++ /dev/null @@ -1,44 +0,0 @@ -From f8ac9140c2e649229880a1b08e199f8245c9cd20 Mon Sep 17 00:00:00 2001 -From: Petr Tesarik -Date: Sat, 15 Apr 2023 18:02:12 +0200 -Subject: [PATCH 6/7] [PATCH 1/2] eppic: Fix incompatible pointer type warnings - -On Linux, eppic defines ull (a bit confusingly) as uint64_t. This -is an unsigned long on 64-bit platforms with both GCC and LLVM, and -the compiler complains about passing a pointer to an unsigned long -where a pointer to an unsigned long long is expected. - -It is not a real bug, because both types are identical on 64-bit -platforms, and on 32-bit platforms, uint64_t denotes an unsigned -long long, but the warning is annoying. - -Signed-off-by: Petr Tesarik ---- - extension_eppic.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/makedumpfile-1.7.2/extension_eppic.c b/makedumpfile-1.7.2/extension_eppic.c -index 45bc032..8aa9ed2 100644 ---- a/makedumpfile-1.7.2/extension_eppic.c -+++ b/makedumpfile-1.7.2/extension_eppic.c -@@ -122,7 +122,7 @@ drilldown(ull offset, type_t *t) - { - int type_flag, len = 0, t_len = 0, nidx = 0; - int fctflg = 0, ref = 0, *idxlst = 0; -- ull die_off = offset, t_die_off; -+ unsigned long long die_off = offset, t_die_off; - char *tstr = NULL, *tstr_dup = NULL; - - while (GET_DIE_ATTR_TYPE(die_off, &type_flag, &t_die_off)) { -@@ -221,7 +221,7 @@ apimember(char *mname, ull idx, type_t *tm, member_t *m, ull *last_index) - int index, nfields = -1, size; - int nbits = 0, fbits = 0; - long offset; -- ull m_die, die_off = idx; -+ unsigned long long m_die, die_off = idx; - char *name = NULL; - - nfields = GET_DIE_NFIELDS_ALL(die_off); --- -2.33.1 - diff --git a/makedumpfile-1.7.2-0007-2-2-eppic-Fix-a-warning-about-redefining-ERRMS.patch b/makedumpfile-1.7.2-0007-2-2-eppic-Fix-a-warning-about-redefining-ERRMS.patch deleted file mode 100644 index 8a47186..0000000 --- a/makedumpfile-1.7.2-0007-2-2-eppic-Fix-a-warning-about-redefining-ERRMS.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 8e8b8814be1a9f8b5b66ca06a602041b05c923df Mon Sep 17 00:00:00 2001 -From: Petr Tesarik -Date: Sat, 15 Apr 2023 18:02:13 +0200 -Subject: [PATCH 7/7] [PATCH 2/2] eppic: Fix a warning about redefining ERRMSG - -The macro is redefined on purpose, so let's #undef it first to -silence the warning. - -Signed-off-by: Petr Tesarik ---- - extension_eppic.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/makedumpfile-1.7.2/extension_eppic.h b/makedumpfile-1.7.2/extension_eppic.h -index 24189ba..08f1db0 100644 ---- a/makedumpfile-1.7.2/extension_eppic.h -+++ b/makedumpfile-1.7.2/extension_eppic.h -@@ -71,6 +71,7 @@ typedef TYPE_S { - ull rtype; /* type_t a reference refers too */ - } type_t; - -+#undef ERRMSG - #define ERRMSG(x...) \ - do { \ - fprintf(stderr, __FUNCTION__); \ --- -2.33.1 - diff --git a/sources b/sources index c12e9e3..3e00b12 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ SHA512 (eppic-e8844d3.tar.gz) = d86b9f90c57e694107272d8f71b87f66a30743b9530480fb6f665026bbada4c6b0205a83e40b5383663a945681cfbfcf1ee79469fc219ddf679473c4b2290763 SHA512 (kexec-tools-2.0.27.tar.xz) = 30b5ef7c2075dfd11fd1c3c33abe6b60673400257668d60145be08a2472356c7191a0810095da0fa32e327b9806a7578c73129ac0550d26c28ea6571c88c7b3c -SHA512 (makedumpfile-1.7.4.tar.gz) = 6c3455b711bd4e120173ee07fcc5ff708ae6d34eaee0f4c135eca7ee0e0475b4d391429c23cf68e848b156ee3edeab956e693a390d67ccc634c43224c7129a96 +SHA512 (makedumpfile-1.7.6.tar.gz) = 2436bbc5ced82e95e1c528cc63c6d71b5a386f34623f2f3cf6050019d21e6e81a15ddb5aa50cbec33b86228d2ba622f3ff37989b7cbeb6e66c94380380518f60 \ No newline at end of file