Accepting request 540193 from home:jirislaby:branches:Kernel:kdump

- add makedumpfile-Fix-SECTION_MAP_MASK-for-kernel-v.13.patch (bnc#1066811)

OBS-URL: https://build.opensuse.org/request/show/540193
OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/makedumpfile?expand=0&rev=107
This commit is contained in:
2017-11-10 07:47:46 +00:00
committed by Git OBS Bridge
parent f2ffa3fd31
commit feebaa4ace
3 changed files with 64 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
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
* Required for kernel 4.13
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, 13, 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

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
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

View File

@@ -38,6 +38,7 @@ 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
BuildRequires: libdw-devel
BuildRequires: libebl-devel
@@ -67,6 +68,7 @@ via gdb or crash utility.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build