makedumpfile: Increase SECTION_MAP_LAST_BIT to 4

Backport from the makedumpfile devel branch in upstream.

commit 7bdb468c2c99dd780c9a5321f93c79cbfdce2527
Author: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Date:   Tue Jul 23 12:24:47 2019 -0400

    [PATCH] Increase SECTION_MAP_LAST_BIT to 4

    kernel commit 326e1b8f83a4 ("mm/sparsemem: introduce a SECTION_IS_EARLY
    flag") added the flag to mem_section->section_mem_map value, and it caused
    makedumpfile an error like the following:

      readmem: Can't convert a virtual address(fffffc97d1000000) to physical address.
      readmem: type_addr: 0, addr:fffffc97d1000000, size:32768
      __exclude_unnecessary_pages: Can't read the buffer of struct page.
      create_2nd_bitmap: Can't exclude unnecessary pages.

    To fix this, SECTION_MAP_LAST_BIT needs to be updated. The bit has not
    been used until the addition, so we can just increase the value.

    Signed-off-by: Kazuhito Hagio <k-hagio@ab.jp.nec.com>

Signed-off-by: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Acked-by: Dave Young <dyoung@redhat.com>
Acked-by: Kairui Song <kasong@redhat.com>
This commit is contained in:
Kazuhito Hagio 2019-08-02 10:59:38 -04:00 committed by Kairui Song
parent 076b839dd4
commit 15f6d2627f
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,38 @@
From 7bdb468c2c99dd780c9a5321f93c79cbfdce2527 Mon Sep 17 00:00:00 2001
From: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Date: Tue, 23 Jul 2019 12:24:47 -0400
Subject: [PATCH 2/2] Increase SECTION_MAP_LAST_BIT to 4
kernel commit 326e1b8f83a4 ("mm/sparsemem: introduce a SECTION_IS_EARLY
flag") added the flag to mem_section->section_mem_map value, and it caused
makedumpfile an error like the following:
readmem: Can't convert a virtual address(fffffc97d1000000) to physical address.
readmem: type_addr: 0, addr:fffffc97d1000000, size:32768
__exclude_unnecessary_pages: Can't read the buffer of struct page.
create_2nd_bitmap: Can't exclude unnecessary pages.
To fix this, SECTION_MAP_LAST_BIT needs to be updated. The bit has not
been used until the addition, so we can just increase the value.
Signed-off-by: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
---
makedumpfile.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/makedumpfile.h b/makedumpfile.h
index 24b2f69f400c..df745b9f53e5 100644
--- a/makedumpfile-1.6.6/makedumpfile.h
+++ b/makedumpfile-1.6.6/makedumpfile.h
@@ -195,7 +195,7 @@ isAnon(unsigned long mapping)
* 2. it has been verified that (1UL<<2) was never set, so it is
* safe to mask that bit off even in old kernels.
*/
-#define SECTION_MAP_LAST_BIT (1UL<<3)
+#define SECTION_MAP_LAST_BIT (1UL<<4)
#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.18.1

View File

@ -93,6 +93,7 @@ Patch0: kexec-tools-2.0.20-fix-broken-multiboot2-buliding-for-i386.patch
# Patches 601 onward are generic patches
#
Patch601: kexec-tools-2.0.20-makedumpfile-Do-not-proceed-when-get_num_dumpable_cyclic-fails.patch
Patch602: kexec-tools-2.0.20-makedumpfile-Increase-SECTION_MAP_LAST_BIT-to-4.patch
%description
kexec-tools provides /sbin/kexec binary that facilitates a new
@ -110,6 +111,7 @@ tar -z -x -v -f %{SOURCE19}
%patch0 -p1
%patch601 -p1
%patch602 -p1
%ifarch ppc
%define archdef ARCH=ppc