Blame SOURCES/kexec-tools-2.0.14-makedumpfile-elf_info-kcore-check-for-invalid-physic.patch

23ef29
From f4ab6897a716d3f3959f6cb8cab27744eaecb5a6 Mon Sep 17 00:00:00 2001
23ef29
Message-Id: <f4ab6897a716d3f3959f6cb8cab27744eaecb5a6.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:16 +0900
23ef29
Subject: [PATCH 4/7] [PATCH v3 4/7] elf_info: kcore: check for invalid
23ef29
 physical address
23ef29
23ef29
kcore passes correct phys_start for direct mapped region and an invalid
23ef29
value (-1) for all other regions after the kernel commit
23ef29
464920104bf7(/proc/kcore: update physical address for kcore ram and
23ef29
text). arch specific function is_phys_addr() accepts only virt_start.
23ef29
Therefore, check for valid phys_start in get_kcore_dump_loads().
23ef29
23ef29
Signed-off-by: Pratyush Anand <panand@redhat.com>
23ef29
---
23ef29
 elf_info.c | 6 ++++--
23ef29
 1 file changed, 4 insertions(+), 2 deletions(-)
23ef29
23ef29
diff --git a/makedumpfile-1.6.1/elf_info.c b/makedumpfile-1.6.1/elf_info.c
23ef29
index 65ff333cf33a..c5743b3cab28 100644
23ef29
--- a/makedumpfile-1.6.1/elf_info.c
23ef29
+++ b/makedumpfile-1.6.1/elf_info.c
23ef29
@@ -881,7 +881,8 @@ int get_kcore_dump_loads(void)
23ef29
 
23ef29
 	for (i = 0; i < num_pt_loads; ++i) {
23ef29
 		struct pt_load_segment *p = &pt_loads[i];
23ef29
-		if (!is_phys_addr(p->virt_start))
23ef29
+		if (p->phys_start == NOT_PADDR
23ef29
+				|| !is_phys_addr(p->virt_start))
23ef29
 			continue;
23ef29
 		loads++;
23ef29
 	}
23ef29
@@ -901,7 +902,8 @@ int get_kcore_dump_loads(void)
23ef29
 
23ef29
 	for (i = 0, j = 0; i < num_pt_loads; ++i) {
23ef29
 		struct pt_load_segment *p = &pt_loads[i];
23ef29
-		if (!is_phys_addr(p->virt_start))
23ef29
+		if (p->phys_start == NOT_PADDR
23ef29
+				|| !is_phys_addr(p->virt_start))
23ef29
 			continue;
23ef29
 		if (j >= loads)
23ef29
 			return FALSE;
23ef29
-- 
23ef29
2.9.3
23ef29