Blame SOURCES/kexec-tools-2.0.14-makedumpfile-x86_64-check-physical-address-in-PT_LOA.patch

23ef29
From f1363023b909df886eca5efcb64b78be9b8e6086 Mon Sep 17 00:00:00 2001
23ef29
Message-Id: <f1363023b909df886eca5efcb64b78be9b8e6086.1489471500.git.panand@redhat.com>
23ef29
In-Reply-To: <4b0bed3523a5f6c2c428d9dab3d27d4572207d52.1489471500.git.panand@redhat.com>
23ef29
References: <4b0bed3523a5f6c2c428d9dab3d27d4572207d52.1489471500.git.panand@redhat.com>
23ef29
From: Pratyush Anand <panand@redhat.com>
23ef29
Date: Thu, 2 Mar 2017 17:37:13 +0900
23ef29
Subject: [PATCH 3/7] [PATCH v3 3/7] x86_64: check physical address in PT_LOAD
23ef29
 for none direct mapped regions
23ef29
23ef29
A kcore PT_LOAD can have a section from vmalloc region. However,
23ef29
physical address in that header would be invalid (-1) after kernel
23ef29
commit 464920104bf7 (/proc/kcore: update physical address for kcore ram
23ef29
and text). Therefore, check for valid physical address while calculating
23ef29
page_offset or phys_offset.
23ef29
23ef29
Signed-off-by: Pratyush Anand <panand@redhat.com>
23ef29
---
23ef29
 arch/x86_64.c | 6 ++++--
23ef29
 1 file changed, 4 insertions(+), 2 deletions(-)
23ef29
23ef29
diff --git a/makedumpfile-1.6.1/arch/x86_64.c b/makedumpfile-1.6.1/arch/x86_64.c
23ef29
index 893cd516fc8b..e978a36f8878 100644
23ef29
--- a/makedumpfile-1.6.1/arch/x86_64.c
23ef29
+++ b/makedumpfile-1.6.1/arch/x86_64.c
23ef29
@@ -41,7 +41,8 @@ get_page_offset_x86_64(void)
23ef29
 	unsigned long long virt_start;
23ef29
 
23ef29
 	for (i = 0; get_pt_load(i, &phys_start, NULL, &virt_start, NULL); i++) {
23ef29
-		if (virt_start < __START_KERNEL_map) {
23ef29
+		if (virt_start < __START_KERNEL_map
23ef29
+				&& phys_start != NOT_PADDR) {
23ef29
 			info->page_offset = virt_start - phys_start;
23ef29
 			return TRUE;
23ef29
 		}
23ef29
@@ -76,7 +77,8 @@ get_phys_base_x86_64(void)
23ef29
 	}
23ef29
 
23ef29
 	for (i = 0; get_pt_load(i, &phys_start, NULL, &virt_start, NULL); i++) {
23ef29
-		if (virt_start >= __START_KERNEL_map) {
23ef29
+		if (virt_start >= __START_KERNEL_map
23ef29
+				&& phys_start != NOT_PADDR) {
23ef29
 
23ef29
 			info->phys_base = phys_start -
23ef29
 			    (virt_start & ~(__START_KERNEL_map));
23ef29
-- 
23ef29
2.9.3
23ef29