Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package makedumpfile for openSUSE:Factory checked in at 2023-04-29 17:27:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/makedumpfile (Old) and /work/SRC/openSUSE:Factory/.makedumpfile.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "makedumpfile" Sat Apr 29 17:27:58 2023 rev:89 rq:1083540 version:1.7.3 Changes: -------- --- /work/SRC/openSUSE:Factory/makedumpfile/makedumpfile.changes 2023-01-08 21:25:17.247157258 +0100 +++ /work/SRC/openSUSE:Factory/.makedumpfile.new.1533/makedumpfile.changes 2023-04-29 17:28:08.902544129 +0200 @@ -1,0 +2,8 @@ +Tue Apr 25 10:42:06 UTC 2023 - Petr TesaÅÃk <[email protected]> + +- update to 1.7.3: + * Support kernels up to v6.3 (x86_64) + * Support sadump with 5-level paging +- temporarily disable eppic until v5.0 branch can be supported + +------------------------------------------------------------------- Old: ---- makedumpfile-1.7.2.tar.gz New: ---- makedumpfile-1.7.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ makedumpfile.spec ++++++ --- /var/tmp/diff_new_pack.gnoren/_old 2023-04-29 17:28:09.678547378 +0200 +++ /var/tmp/diff_new_pack.gnoren/_new 2023-04-29 17:28:09.682547395 +0200 @@ -1,7 +1,7 @@ # # spec file for package makedumpfile # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,8 @@ # +%define build_eppic 0 + %if 0%{!?have_snappy:1} %if 0%{?suse_version} >= 1310 %define have_snappy 1 @@ -40,7 +42,7 @@ # End of compatibility cruft Name: makedumpfile -Version: 1.7.2 +Version: 1.7.3 Release: 0 Summary: Partial kernel dump License: GPL-2.0-only @@ -54,7 +56,9 @@ BuildRequires: libbz2-devel BuildRequires: libdw-devel BuildRequires: libelf-devel +%if %{build_eppic} BuildRequires: libeppic-devel +%endif BuildRequires: lzo-devel BuildRequires: ncurses-devel BuildRequires: xz-devel @@ -88,16 +92,20 @@ export USELZO=on export LINKTYPE=dynamic make %{?_smp_mflags} LDFLAGS="-Wl,-rpath,%{_libdir}/%{name}-%{version}" +%if %{build_eppic} make %{?_smp_mflags} eppic_makedumpfile.so %{?ncurses_make_opts} +%endif %install install -D -m 0755 makedumpfile %{buildroot}%{_bindir}/makedumpfile install -D -m 0755 makedumpfile-R.pl %{buildroot}%{_bindir}/makedumpfile-R.pl install -D -m 0644 makedumpfile.8 %{buildroot}%{_mandir}/man8/makedumpfile.8 install -D -m 0644 makedumpfile.conf.5 %{buildroot}%{_mandir}/man5/makedumpfile.conf.5 +%if %{build_eppic} install -D -m 0755 eppic_makedumpfile.so %{buildroot}%{_libdir}/%{name}-%{version}/eppic_makedumpfile.so install -d -m 0755 %{buildroot}%{_datadir}/%{name}-%{version}/eppic_scripts install -m 0644 -t %{buildroot}%{_datadir}/%{name}-%{version}/eppic_scripts/ eppic_scripts/* +%endif # Compatibility cruft # there is no %%license prior to SLE12 @@ -117,9 +125,11 @@ %doc README IMPLEMENTATION %{_mandir}/man?/* %{_bindir}/* +%if %{build_eppic} %dir %{_libdir}/%{name}-%{version} %{_libdir}/%{name}-%{version}/eppic_makedumpfile.so %dir %{_datadir}/%{name}-%{version} %{_datadir}/%{name}-%{version}/eppic_scripts/ +%endif %changelog ++++++ makedumpfile-1.7.2.tar.gz -> makedumpfile-1.7.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makedumpfile-1.7.2/IMPLEMENTATION new/makedumpfile-1.7.3/IMPLEMENTATION --- old/makedumpfile-1.7.2/IMPLEMENTATION 2022-10-20 02:39:03.000000000 +0200 +++ new/makedumpfile-1.7.3/IMPLEMENTATION 2023-04-25 08:42:54.000000000 +0200 @@ -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. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makedumpfile-1.7.2/Makefile new/makedumpfile-1.7.3/Makefile --- old/makedumpfile-1.7.2/Makefile 2022-10-20 02:39:03.000000000 +0200 +++ new/makedumpfile-1.7.3/Makefile 2023-04-25 08:42:54.000000000 +0200 @@ -1,7 +1,7 @@ # makedumpfile -VERSION=1.7.2 -DATE=20 Oct 2022 +VERSION=1.7.3 +DATE=25 Apr 2023 # Honour the environment variable CC ifeq ($(strip $CC),) @@ -130,6 +130,6 @@ 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/* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makedumpfile-1.7.2/README new/makedumpfile-1.7.3/README --- old/makedumpfile-1.7.2/README 2022-10-20 02:39:03.000000000 +0200 +++ new/makedumpfile-1.7.3/README 2023-04-25 08:42:54.000000000 +0200 @@ -166,6 +166,9 @@ 5.18 | | ** | | | | ** | | -- | | OK | | | 5.19 | | ** | | | | ** | | -- | | OK | | | 6.0 | | ** | | | | ** | | -- | | OK | | | + 6.1 | | ** | | | | ** | | -- | | OK | | | + 6.2 | | ** | | | | ** | | -- | | OK | | | + 6.3 | | ** | | | | ** | | -- | | OK | | | OK : Support. -- : Not support. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makedumpfile-1.7.2/extension_eppic.c new/makedumpfile-1.7.3/extension_eppic.c --- old/makedumpfile-1.7.2/extension_eppic.c 2022-10-20 02:39:03.000000000 +0200 +++ new/makedumpfile-1.7.3/extension_eppic.c 2023-04-25 08:42:54.000000000 +0200 @@ -122,7 +122,7 @@ { 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 @@ 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); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makedumpfile-1.7.2/extension_eppic.h new/makedumpfile-1.7.3/extension_eppic.h --- old/makedumpfile-1.7.2/extension_eppic.h 2022-10-20 02:39:03.000000000 +0200 +++ new/makedumpfile-1.7.3/extension_eppic.h 2023-04-25 08:42:54.000000000 +0200 @@ -71,6 +71,7 @@ ull rtype; /* type_t a reference refers too */ } type_t; +#undef ERRMSG #define ERRMSG(x...) \ do { \ fprintf(stderr, __FUNCTION__); \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makedumpfile-1.7.2/makedumpfile.c new/makedumpfile-1.7.3/makedumpfile.c --- old/makedumpfile-1.7.2/makedumpfile.c 2022-10-20 02:39:03.000000000 +0200 +++ new/makedumpfile-1.7.3/makedumpfile.c 2023-04-25 08:42:54.000000000 +0200 @@ -1732,6 +1732,9 @@ OFFSET_INIT(page.compound_dtor, "page", "compound_dtor"); OFFSET_INIT(page.compound_order, "page", "compound_order"); OFFSET_INIT(page.compound_head, "page", "compound_head"); + /* Linux 6.3 and later */ + OFFSET_INIT(folio._folio_dtor, "folio", "_folio_dtor"); + OFFSET_INIT(folio._folio_order, "folio", "_folio_order"); /* * Some vmlinux(s) don't have debugging information about @@ -2381,6 +2384,10 @@ WRITE_MEMBER_OFFSET("page.compound_dtor", page.compound_dtor); WRITE_MEMBER_OFFSET("page.compound_order", page.compound_order); WRITE_MEMBER_OFFSET("page.compound_head", page.compound_head); + /* Linux 6.3 and later */ + WRITE_MEMBER_OFFSET("folio._folio_dtor", folio._folio_dtor); + WRITE_MEMBER_OFFSET("folio._folio_order", folio._folio_order); + WRITE_MEMBER_OFFSET("mem_section.section_mem_map", mem_section.section_mem_map); WRITE_MEMBER_OFFSET("pglist_data.node_zones", pglist_data.node_zones); @@ -2821,6 +2828,10 @@ READ_MEMBER_OFFSET("page.compound_dtor", page.compound_dtor); READ_MEMBER_OFFSET("page.compound_order", page.compound_order); READ_MEMBER_OFFSET("page.compound_head", page.compound_head); + /* Linux 6.3 and later */ + READ_MEMBER_OFFSET("folio._folio_dtor", folio._folio_dtor); + READ_MEMBER_OFFSET("folio._folio_order", folio._folio_order); + READ_MEMBER_OFFSET("mem_section.section_mem_map", mem_section.section_mem_map); READ_MEMBER_OFFSET("pglist_data.node_zones", pglist_data.node_zones); @@ -4297,6 +4308,32 @@ return ret; } +void +init_compound_offset(void) { + + /* Linux 6.3 and later */ + if (OFFSET(folio._folio_order) != NOT_FOUND_STRUCTURE) + info->compound_order_offset = OFFSET(folio._folio_order) - SIZE(page); + else if (OFFSET(page.compound_order) != NOT_FOUND_STRUCTURE) + info->compound_order_offset = OFFSET(page.compound_order); + else if (info->kernel_version < KERNEL_VERSION(4, 4, 0)) + info->compound_order_offset = OFFSET(page.lru) + OFFSET(list_head.prev); + else + info->compound_order_offset = 0; + + if (OFFSET(folio._folio_dtor) != NOT_FOUND_STRUCTURE) + info->compound_dtor_offset = OFFSET(folio._folio_dtor) - SIZE(page); + else if (OFFSET(page.compound_dtor) != NOT_FOUND_STRUCTURE) + info->compound_dtor_offset = OFFSET(page.compound_dtor); + else if (info->kernel_version < KERNEL_VERSION(4, 4, 0)) + info->compound_dtor_offset = OFFSET(page.lru) + OFFSET(list_head.next); + else + info->compound_dtor_offset = 0; + + DEBUG_MSG("compound_order_offset : %u\n", info->compound_order_offset); + DEBUG_MSG("compound_dtor_offset : %u\n", info->compound_dtor_offset); +} + int initial(void) { @@ -4606,6 +4643,8 @@ if (info->dump_level & DL_EXCLUDE_FREE) setup_page_is_buddy(); + init_compound_offset(); + if (info->flag_usemmap == MMAP_TRY ) { if (initialize_mmap()) { DEBUG_MSG("mmap() is available on the kernel.\n"); @@ -6351,6 +6390,9 @@ return FALSE; } + order_offset = info->compound_order_offset; + dtor_offset = info->compound_dtor_offset; + for (pfn = pfn_start; pfn < pfn_end; pfn++, mem_map += SIZE(page)) { /* @@ -6399,24 +6441,6 @@ _count = UINT(pcache + OFFSET(page._refcount)); mapping = ULONG(pcache + OFFSET(page.mapping)); - if (OFFSET(page.compound_order) != NOT_FOUND_STRUCTURE) { - order_offset = OFFSET(page.compound_order); - } else { - if (info->kernel_version < KERNEL_VERSION(4, 4, 0)) - order_offset = OFFSET(page.lru) + OFFSET(list_head.prev); - else - order_offset = 0; - } - - if (OFFSET(page.compound_dtor) != NOT_FOUND_STRUCTURE) { - dtor_offset = OFFSET(page.compound_dtor); - } else { - if (info->kernel_version < KERNEL_VERSION(4, 4, 0)) - dtor_offset = OFFSET(page.lru) + OFFSET(list_head.next); - else - dtor_offset = 0; - } - compound_order = 0; compound_dtor = 0; /* @@ -6428,14 +6452,10 @@ unsigned char *addr = pcache + SIZE(page); if (order_offset) { - if (info->kernel_version >= - KERNEL_VERSION(4, 16, 0)) { - compound_order = - UCHAR(addr + order_offset); - } else { - compound_order = - USHORT(addr + order_offset); - } + if (info->kernel_version >= KERNEL_VERSION(4, 16, 0)) + compound_order = UCHAR(addr + order_offset); + else + compound_order = USHORT(addr + order_offset); } if (dtor_offset) { @@ -6443,18 +6463,12 @@ * compound_dtor has been changed from the address of descriptor * to the ID of it since linux-4.4. */ - if (info->kernel_version >= - KERNEL_VERSION(4, 16, 0)) { - compound_dtor = - UCHAR(addr + dtor_offset); - } else if (info->kernel_version >= - KERNEL_VERSION(4, 4, 0)) { - compound_dtor = - USHORT(addr + dtor_offset); - } else { - compound_dtor = - ULONG(addr + dtor_offset); - } + if (info->kernel_version >= KERNEL_VERSION(4, 16, 0)) + compound_dtor = UCHAR(addr + dtor_offset); + else if (info->kernel_version >= KERNEL_VERSION(4, 4, 0)) + compound_dtor = USHORT(addr + dtor_offset); + else + compound_dtor = ULONG(addr + dtor_offset); } if ((compound_order >= sizeof(unsigned long) * 8) @@ -6502,7 +6516,7 @@ */ 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 +6524,7 @@ */ 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 +6536,7 @@ * - 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makedumpfile-1.7.2/makedumpfile.h new/makedumpfile-1.7.3/makedumpfile.h --- old/makedumpfile-1.7.2/makedumpfile.h 2022-10-20 02:39:03.000000000 +0200 +++ new/makedumpfile-1.7.3/makedumpfile.h 2023-04-25 08:42:54.000000000 +0200 @@ -161,12 +161,9 @@ #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()) @@ -501,7 +498,7 @@ #define KVER_MIN_SHIFT 16 #define KERNEL_VERSION(x,y,z) (((x) << KVER_MAJ_SHIFT) | ((y) << KVER_MIN_SHIFT) | (z)) #define OLDEST_VERSION KERNEL_VERSION(2, 6, 15) /* linux-2.6.15 */ -#define LATEST_VERSION KERNEL_VERSION(6, 0, 1) /* linux-6.0.1 */ +#define LATEST_VERSION KERNEL_VERSION(6, 3, 0) /* linux-6.3.0 */ /* * vmcoreinfo in /proc/vmcore @@ -1471,6 +1468,12 @@ unsigned long kaslr_offset; /* + * for compound page + */ + unsigned int compound_order_offset; + unsigned int compound_dtor_offset; + + /* * page table info for ppc64 */ int cur_mmu_type; @@ -1875,6 +1878,10 @@ long compound_order; long compound_head; } page; + struct folio { + long _folio_dtor; + long _folio_order; + } folio; struct mem_section { long section_mem_map; } mem_section; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makedumpfile-1.7.2/makedumpfile.spec new/makedumpfile-1.7.3/makedumpfile.spec --- old/makedumpfile-1.7.2/makedumpfile.spec 2022-10-20 02:39:03.000000000 +0200 +++ new/makedumpfile-1.7.3/makedumpfile.spec 2023-04-25 08:42:54.000000000 +0200 @@ -1,6 +1,6 @@ Name: makedumpfile Summary: makedumpfile package -Version: 1.7.2 +Version: 1.7.3 Release: 1 Group: Applications/Text License: GPL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makedumpfile-1.7.2/sadump_info.c new/makedumpfile-1.7.3/sadump_info.c --- old/makedumpfile-1.7.2/sadump_info.c 2022-10-20 02:39:03.000000000 +0200 +++ new/makedumpfile-1.7.3/sadump_info.c 2023-04-25 08:42:54.000000000 +0200 @@ -1362,6 +1362,7 @@ #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 @@ 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 @@ 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);
