Dominique Leuenberger 2017-11-24 09:53:08 +00:00 committed by Git OBS Bridge
commit fba1a6691d
8 changed files with 348 additions and 5 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0b6e73106998670407887de9e1a505b3a2dbb2fb517a4b968a665eda8fb097ce
size 176228

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ee3d21cb4032a60bd2c802d1d8b21b9f399710e1574f8de8ead5ab50cd821a6d
size 182149

View File

@ -0,0 +1,58 @@
From: Pratyush Anand <panand@redhat.com>
Date: Thu, 17 Aug 2017 12:47:13 +0900
Subject: [PATCH v2] Fix SECTION_MAP_MASK for kernel >= v.13
Patch-mainline: yes
References: bnc#1066811, bsc#1067703
* Required for kernel 4.13
* Required for SLE15 kernel due to backport of 2d070eab2e82 => 4.12
commit 2d070eab2e82 "mm: consider zone which is not fully populated to
have holes" added a new flag SECTION_IS_ONLINE and therefore
SECTION_MAP_MASK has been changed. We are not able to find correct
mem_map in makedumpfile for kernel version v4.13-rc1 and onward because
of the above kernel change.
This patch fixes the MASK value keeping the code backward compatible
Signed-off-by: Pratyush Anand <panand@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
makedumpfile.c | 5 ++++-
makedumpfile.h | 4 +++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/makedumpfile.c b/makedumpfile.c
index 8af0c9d6c2ac..509631994abc 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -3304,7 +3304,10 @@ section_mem_map_addr(unsigned long addr)
return NOT_KV_ADDR;
}
map = ULONG(mem_section + OFFSET(mem_section.section_mem_map));
- map &= SECTION_MAP_MASK;
+ if (info->kernel_version < KERNEL_VERSION(4, 12, 0))
+ map &= SECTION_MAP_MASK_4_12;
+ else
+ map &= SECTION_MAP_MASK;
free(mem_section);
return map;
diff --git a/makedumpfile.h b/makedumpfile.h
index b0cdd02f0470..6f188e4b9b25 100644
--- a/makedumpfile.h
+++ b/makedumpfile.h
@@ -183,7 +183,9 @@ isAnon(unsigned long mapping)
#define SECTIONS_PER_ROOT() (info->sections_per_root)
#define SECTION_ROOT_MASK() (SECTIONS_PER_ROOT() - 1)
#define SECTION_NR_TO_ROOT(sec) ((sec) / SECTIONS_PER_ROOT())
-#define SECTION_MAP_LAST_BIT (1UL<<2)
+#define SECTION_IS_ONLINE (1UL<<2)
+#define SECTION_MAP_LAST_BIT (1UL<<3)
+#define SECTION_MAP_MASK_4_12 (~(SECTION_IS_ONLINE-1))
#define SECTION_MAP_MASK (~(SECTION_MAP_LAST_BIT-1))
#define NR_SECTION_ROOTS() divideup(num_section, SECTIONS_PER_ROOT())
#define SECTION_NR_TO_PFN(sec) ((sec) << PFN_SECTION_SHIFT())
--
2.15.0

View File

@ -0,0 +1,74 @@
From dc28bfc3213960b549bcc70f0d5379a6222d2c60 Mon Sep 17 00:00:00 2001
From: Bhupesh Sharma <bhsharma@redhat.com>
Date: Wed, 13 Sep 2017 05:04:00 +0900
Subject: [PATCH] [PATCH v2] book3s/ppc64: Lower the max real address to 53
bits for kernels >= v4.11
Patch-mainline: yes
References: bsc#1067703
* Required for kernel 4.11
Kernel commit 2f18d533757da3899f4bedab0b2c051b080079dc lowered the
max real address on ppc64 to 53 bits.
Make similar changes in makedumpfile (on basis of the underlying kernel
version), without which the makedumpfile will fail to create a dumpfile
and instead throw a SEGV fault as shown below on kernels >= v4.11:
# makedumpfile --split -d 31 -x vmlinux vmcore dumpfile_{1,2,3} 2>&1
The kernel version is not supported.
The makedumpfile operation may be incomplete.
[ 1196.252094] makedumpfile[2367]: unhandled signal 11 at
00000100f7011ca8 nip 000000001001eecc lr 000000001001f3c0 code 30001
Segmentation fault
Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
Acked-by: Michal Suchanek <msuchanek@suse.de>
---
arch/ppc64.c | 8 +++++++-
makedumpfile.h | 5 +++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/ppc64.c b/arch/ppc64.c
index bacac778f73c..2f5a0daa16b2 100644
--- a/arch/ppc64.c
+++ b/arch/ppc64.c
@@ -307,11 +307,17 @@ ppc64_vmalloc_init(void)
}
info->pte_rpn_mask = PTE_RPN_MASK_DEFAULT;
- if (info->kernel_version >= KERNEL_VERSION(4, 6, 0)) {
+ if ((info->kernel_version >= KERNEL_VERSION(4, 6, 0)) &&
+ (info->kernel_version < KERNEL_VERSION(4, 11, 0))) {
info->pte_rpn_mask = PTE_RPN_MASK_L4_4_6;
info->pte_rpn_shift = PTE_RPN_SHIFT_L4_4_6;
}
+ if (info->kernel_version >= KERNEL_VERSION(4, 11, 0)) {
+ info->pte_rpn_mask = PTE_RPN_MASK_L4_4_11;
+ info->pte_rpn_shift = PTE_RPN_SHIFT_L4_4_11;
+ }
+
/*
* Compute ptrs per each level
*/
diff --git a/makedumpfile.h b/makedumpfile.h
index 7d81bbcf2234..f4ba02d11f09 100644
--- a/makedumpfile.h
+++ b/makedumpfile.h
@@ -692,6 +692,11 @@ unsigned long get_kvbase_arm64(void);
#define PUD_MASKED_BITS_4_7 0xc0000000000000ffUL
#define PMD_MASKED_BITS_4_7 0xc0000000000000ffUL
+#define PTE_RPN_SIZE_L4_4_11 53
+#define PTE_RPN_MASK_L4_4_11 \
+ (((1UL << PTE_RPN_SIZE_L4_4_11) - 1) & ~((1UL << info->page_shift) - 1))
+#define PTE_RPN_SHIFT_L4_4_11 info->page_shift
+
/*
* Supported MMU types
*/
--
2.13.6

View File

@ -0,0 +1,113 @@
From: Jeff Mahoney <jeffm@suse.com>
Subject: handle renamed init_level4_pgt -> init_top_pgt
Patch-mainline: Submitted to kexec-ml, 6 Nov 2017
References: bsc#1066770
Linux 4.13 renamed init_level4_pgt to init_top_pgt in preparation for
introducing 5-level page tables. This patch follows the rename if
the lookup for init_level4_pgt fails. It also checks to see if
5-level page tables are enabled and bails if it discovers they are.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
arch/x86_64.c | 24 +++++++++++++++++++++---
makedumpfile.c | 6 ++++++
makedumpfile.h | 2 ++
3 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/arch/x86_64.c b/arch/x86_64.c
index 08dd6b2..9b09035 100644
--- a/arch/x86_64.c
+++ b/arch/x86_64.c
@@ -259,16 +259,26 @@ vtop4_x86_64(unsigned long vaddr)
{
unsigned long page_dir, pml4, pgd_paddr, pgd_pte, pmd_paddr, pmd_pte;
unsigned long pte_paddr, pte;
+ unsigned long init_level4_pgt;
- if (SYMBOL(init_level4_pgt) == NOT_FOUND_SYMBOL) {
+ if (SYMBOL(init_level4_pgt) != NOT_FOUND_SYMBOL)
+ init_level4_pgt = SYMBOL(init_level4_pgt);
+ else if (SYMBOL(init_top_pgt) != NOT_FOUND_SYMBOL)
+ init_level4_pgt = SYMBOL(init_top_pgt);
+ else {
ERRMSG("Can't get the symbol of init_level4_pgt.\n");
return NOT_PADDR;
}
+ if (SYMBOL(level4_kernel_pgt) != NOT_FOUND_SYMBOL) {
+ ERRMSG("Kernel is built with 5-level page tables\n");
+ return NOT_PADDR;
+ }
+
/*
* Get PGD.
*/
- page_dir = SYMBOL(init_level4_pgt) - __START_KERNEL_map + info->phys_base;
+ page_dir = init_level4_pgt - __START_KERNEL_map + info->phys_base;
if (is_xen_memory()) {
page_dir = ptom_xen(page_dir);
if (page_dir == NOT_PADDR)
@@ -549,8 +559,16 @@ find_vmemmap_x86_64()
struct vmap_pfns *vmapp, *vmaphead = NULL, *cur, *tail;
init_level4_pgt = SYMBOL(init_level4_pgt);
+ if (init_level4_pgt == NOT_FOUND_SYMBOL)
+ init_level4_pgt = SYMBOL(init_top_pgt);
+
if (init_level4_pgt == NOT_FOUND_SYMBOL) {
- ERRMSG("init_level4_pgt not found\n");
+ ERRMSG("init_level4_pgt/init_top_pgt not found\n");
+ return FAILED;
+ }
+
+ if (SYMBOL(level4_kernel_pgt) != NOT_FOUND_SYMBOL) {
+ ERRMSG("kernel is configured for 5-level page tables\n");
return FAILED;
}
pagestructsize = size_table.page;
diff --git a/makedumpfile.c b/makedumpfile.c
index f85003a..6e5ec34 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -1486,6 +1486,8 @@ get_symbol_info(void)
SYMBOL_INIT(_stext, "_stext");
SYMBOL_INIT(swapper_pg_dir, "swapper_pg_dir");
SYMBOL_INIT(init_level4_pgt, "init_level4_pgt");
+ SYMBOL_INIT(level4_kernel_pgt, "level4_kernel_pgt");
+ SYMBOL_INIT(init_top_pgt, "init_top_pgt");
SYMBOL_INIT(vmlist, "vmlist");
SYMBOL_INIT(vmap_area_list, "vmap_area_list");
SYMBOL_INIT(node_online_map, "node_online_map");
@@ -2105,6 +2107,8 @@ write_vmcoreinfo_data(void)
WRITE_SYMBOL("_stext", _stext);
WRITE_SYMBOL("swapper_pg_dir", swapper_pg_dir);
WRITE_SYMBOL("init_level4_pgt", init_level4_pgt);
+ WRITE_SYMBOL("level4_kernel_pgt", level4_kernel_pgt);
+ WRITE_SYMBOL("init_top_pgt", init_top_pgt);
WRITE_SYMBOL("vmlist", vmlist);
WRITE_SYMBOL("vmap_area_list", vmap_area_list);
WRITE_SYMBOL("node_online_map", node_online_map);
@@ -2500,6 +2504,8 @@ read_vmcoreinfo(void)
READ_SYMBOL("_stext", _stext);
READ_SYMBOL("swapper_pg_dir", swapper_pg_dir);
READ_SYMBOL("init_level4_pgt", init_level4_pgt);
+ READ_SYMBOL("level4_kernel_pgt", level4_kernel_pgt);
+ READ_SYMBOL("init_top_pgt", init_top_pgt);
READ_SYMBOL("vmlist", vmlist);
READ_SYMBOL("vmap_area_list", vmap_area_list);
READ_SYMBOL("node_online_map", node_online_map);
diff --git a/makedumpfile.h b/makedumpfile.h
index 8a05794..9357e47 100644
--- a/makedumpfile.h
+++ b/makedumpfile.h
@@ -1517,6 +1517,8 @@ struct symbol_table {
unsigned long long _stext;
unsigned long long swapper_pg_dir;
unsigned long long init_level4_pgt;
+ unsigned long long level4_kernel_pgt;
+ unsigned long long init_top_pgt;
unsigned long long vmlist;
unsigned long long vmap_area_list;
unsigned long long phys_base;

View File

@ -0,0 +1,60 @@
From 13f48cbab7207d8247834453b55d45b2a95f65cb Mon Sep 17 00:00:00 2001
From: Hari Bathini <hbathini@linux.vnet.ibm.com>
Date: Sat, 11 Nov 2017 02:13:54 +0900
Subject: [PATCH] [PATCH] ppc64: update hash page table geometry
Patch-mainline: yes
References: bsc#1067703
* Required for kernel 4.12
Starting with kernel 4.12, BOOK3S hash page table geometry is updated
to accommodate larger virtual address range. Update here accordingly.
Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
Acked-by: Michal Suchanek <msuchanek@suse.de>
---
arch/ppc64.c | 12 +++++++++---
makedumpfile.h | 3 +++
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/arch/ppc64.c b/arch/ppc64.c
index 2f5a0daa16b2..8bdbcc583c47 100644
--- a/arch/ppc64.c
+++ b/arch/ppc64.c
@@ -245,10 +245,16 @@ ppc64_vmalloc_init(void)
} else if (info->kernel_version >= KERNEL_VERSION(4, 6, 0)) {
info->l1_index_size = PTE_INDEX_SIZE_L4_64K_3_10;
- info->l2_index_size = PMD_INDEX_SIZE_L4_64K_4_6;
- info->l3_index_size = PUD_INDEX_SIZE_L4_64K_4_6;
- info->l4_index_size = PGD_INDEX_SIZE_L4_64K_3_10;
+ if (info->kernel_version >= KERNEL_VERSION(4, 12, 0)) {
+ info->l2_index_size = PMD_INDEX_SIZE_L4_64K_4_12;
+ info->l3_index_size = PUD_INDEX_SIZE_L4_64K_4_12;
+ info->l4_index_size = PGD_INDEX_SIZE_L4_64K_4_12;
+ } else {
+ info->l2_index_size = PMD_INDEX_SIZE_L4_64K_4_6;
+ info->l3_index_size = PUD_INDEX_SIZE_L4_64K_4_6;
+ info->l4_index_size = PGD_INDEX_SIZE_L4_64K_3_10;
+ }
} else if (info->kernel_version >= KERNEL_VERSION(3, 10, 0)) {
info->l1_index_size = PTE_INDEX_SIZE_L4_64K_3_10;
info->l2_index_size = PMD_INDEX_SIZE_L4_64K_3_10;
diff --git a/makedumpfile.h b/makedumpfile.h
index db753792bca6..b983aaf5ab03 100644
--- a/makedumpfile.h
+++ b/makedumpfile.h
@@ -670,6 +670,9 @@ unsigned long get_kvbase_arm64(void);
#define PGD_INDEX_SIZE_L4_64K_3_10 12
#define PMD_INDEX_SIZE_L4_64K_4_6 5
#define PUD_INDEX_SIZE_L4_64K_4_6 5
+#define PMD_INDEX_SIZE_L4_64K_4_12 10
+#define PUD_INDEX_SIZE_L4_64K_4_12 7
+#define PGD_INDEX_SIZE_L4_64K_4_12 8
#define PTE_INDEX_SIZE_RADIX_64K 5
#define PMD_INDEX_SIZE_RADIX_64K 9
#define PUD_INDEX_SIZE_RADIX_64K 9
--
2.13.6

View File

@ -1,3 +1,33 @@
-------------------------------------------------------------------
Wed Nov 15 18:05:58 UTC 2017 - msuchanek@suse.com
- ppc64 Can't convert a virtual address (bsc#1067703)
* Added patches: makedumpfile-ppc64-update-hash-page-table-geometry.patch
makedumpfile-book3s-ppc64-Lower-the-max-real-address-to-53-bits.patch
* Refresh makedumpfile-Fix-SECTION_MAP_MASK-for-kernel-v.13.patch to also
apply to SLE15 (4.12 kernel) due to backport of 2d070eab2e82 (bsc#1067703)
-------------------------------------------------------------------
Fri Nov 10 17:01:33 HKT 2017 - lzwang@suse.com
- Handled renaming of init_level4_pgt to init_top_pgt (bsc#1066770).
* Added patch: makedumpfile-handle-renamed-init_level4_pgt-init_top_pgt.patch
-------------------------------------------------------------------
Thu Nov 9 12:16:29 UTC 2017 - jslaby@suse.com
- add makedumpfile-Fix-SECTION_MAP_MASK-for-kernel-v.13.patch (bnc#1066811)
-------------------------------------------------------------------
Wed Nov 8 17:00:15 HKT 2017 - lzwang@suse.com
- Update to 1.6.2
* Fix the use of Xen physical and machine addresses (bsc#1014136)
* Fix memory leak in get_kcore_dump_loads()
* Support kernels up to 4.11.7
* Consider not page-size aligned phys_end for paddr_to_pfn()
* Add runtime kaslr offset if it exists
-------------------------------------------------------------------
Thu May 11 15:32:13 UTC 2017 - ptesarik@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package makedumpfile
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -29,7 +29,7 @@
%endif
Name: makedumpfile
Version: 1.6.1
Version: 1.6.2
Release: 0
Summary: Partial kernel dump
License: GPL-2.0
@ -38,7 +38,11 @@ Url: https://sourceforge.net/projects/makedumpfile/
Source: https://sourceforge.net/projects/makedumpfile/files/makedumpfile/%{version}/%{name}-%{version}.tar.gz
Source99: %{name}-rpmlintrc
Patch0: %{name}-coptflags.diff
Patch1: %{name}-Fix-SECTION_MAP_MASK-for-kernel-v.13.patch
Patch2: %{name}-override-libtinfo.patch
Patch3: %{name}-handle-renamed-init_level4_pgt-init_top_pgt.patch
Patch4: %{name}-ppc64-update-hash-page-table-geometry.patch
Patch5: %{name}-book3s-ppc64-Lower-the-max-real-address-to-53-bits.patch
BuildRequires: libdw-devel
BuildRequires: libebl-devel
BuildRequires: libelf-devel
@ -67,7 +71,11 @@ via gdb or crash utility.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build
%if %{have_snappy}