makedumpfile: fix 4.13 kernel larget vmcore bug

Added patch from panand which was accepted by upstream but not merged in upstream yet.
kexec-tools-2.0.15-makedumpfile-fix-SECTION_MAP_MASK-for-kernel-bigger-than-4.13.patch
This commit is contained in:
Dave Young 2017-08-17 16:50:23 +08:00
parent fcaa683b01
commit 4384995b3d
2 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,66 @@
From: Pratyush Anand <panand@redhat.com>
To: ats-kumagai@wm.jp.nec.com
Subject: [Makedumpfile PATCH v2] Fix SECTION_MAP_MASK for kernel >= v.13
Date: Thu, 17 Aug 2017 09:16:59 +0530
Cc: Pratyush Anand <panand@redhat.com>, dyoung@redhat.com,
kexec@lists.infradead.org, bhe@redhat.com
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=utf-8
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>
---
v1->v2: Improved kernel_version comparison to take care of stable kernel
versions as well.
makedumpfile.c | 5 ++++-
makedumpfile.h | 4 +++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git kexec-tools-2.0.15/makedumpfile-1.6.2/makedumpfile.c kexec-tools-2.0.15.new/makedumpfile-1.6.2/makedumpfile.c
index 30230a15a2e7..c975651ca357 100644
--- kexec-tools-2.0.15/makedumpfile-1.6.2/makedumpfile.c
+++ kexec-tools-2.0.15.new/makedumpfile-1.6.2/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, 13, 0))
+ map &= SECTION_MAP_MASK_4_12;
+ else
+ map &= SECTION_MAP_MASK;
free(mem_section);
return map;
diff --git kexec-tools-2.0.15/makedumpfile-1.6.2/makedumpfile.h kexec-tools-2.0.15.new/makedumpfile-1.6.2/makedumpfile.h
index 8a05794843fb..322f28c632b0 100644
--- kexec-tools-2.0.15/makedumpfile-1.6.2/makedumpfile.h
+++ kexec-tools-2.0.15.new/makedumpfile-1.6.2/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.9.4
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

View File

@ -86,6 +86,7 @@ Obsoletes: diskdumputils netdump kexec-tools-eppic
# #
Patch601: kexec-tools-2.0.3-disable-kexec-test.patch Patch601: kexec-tools-2.0.3-disable-kexec-test.patch
Patch602: kexec-tools-2.0.15-makedumpfile-take-care-of-init-level4-pgt-rename-in-kernel.patch Patch602: kexec-tools-2.0.15-makedumpfile-take-care-of-init-level4-pgt-rename-in-kernel.patch
Patch603: kexec-tools-2.0.15-makedumpfile-fix-SECTION_MAP_MASK-for-kernel-bigger-than-4.13.patch
%description %description
@ -111,6 +112,7 @@ tar -z -x -v -f %{SOURCE23}
%patch601 -p1 %patch601 -p1
%patch602 -p1 %patch602 -p1
%patch603 -p1
%ifarch ppc %ifarch ppc
%define archdef ARCH=ppc %define archdef ARCH=ppc