[PATCH 15/17] x86/kexec: Remove walk_iomem_res() call with GART type

Borislav Petkov bp at alien8.de
Tue Jan 26 12:57:31 PST 2016


From: Toshi Kani <toshi.kani at hpe.com>

There is no longer any driver inserting a "GART" region in the kernel
since

  707d4eefbdb3 ("Revert "[PATCH] Insert GART region into resource map"").

Remove the call to walk_iomem_res() with "GART" type, its callback
function, and GART-specific variables set by the callback.

Reviewed-by: Dave Young <dyoung at redhat.com>
Signed-off-by: Toshi Kani <toshi.kani at hpe.com>
Cc: Andrew Morton <akpm at linux-foundation.org>
Cc: Andy Lutomirski <luto at kernel.org>
Cc: "H. Peter Anvin" <hpa at zytor.com>
Cc: Ingo Molnar <mingo at redhat.com>
Cc: kexec at lists.infradead.org
Cc: "Lee, Chun-Yi" <joeyli.kernel at gmail.com>
Cc: linux-arch at vger.kernel.org
Cc: linux-mm <linux-mm at kvack.org>
Cc: Minfei Huang <mnfhuang at gmail.com>
Cc: "Peter Zijlstra (Intel)" <peterz at infradead.org>
Cc: Stephen Rothwell <sfr at canb.auug.org.au>
Cc: Takao Indoh <indou.takao at jp.fujitsu.com>
Cc: Thomas Gleixner <tglx at linutronix.de>
Cc: Viresh Kumar <viresh.kumar at linaro.org>
Cc: x86-ml <x86 at kernel.org>
Link: http://lkml.kernel.org/r/20160104110427.GA2965@dhcp-128-65.nay.redhat.com
Link: http://lkml.kernel.org/r/1452020081-26534-15-git-send-email-toshi.kani@hpe.com
Signed-off-by: Borislav Petkov <bp at suse.de>
---
 arch/x86/kernel/crash.c | 37 +------------------------------------
 1 file changed, 1 insertion(+), 36 deletions(-)

diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index 35e152eeb6e0..9ef978d69c22 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -57,10 +57,9 @@ struct crash_elf_data {
 	struct kimage *image;
 	/*
 	 * Total number of ram ranges we have after various adjustments for
-	 * GART, crash reserved region etc.
+	 * crash reserved region, etc.
 	 */
 	unsigned int max_nr_ranges;
-	unsigned long gart_start, gart_end;
 
 	/* Pointer to elf header */
 	void *ehdr;
@@ -201,17 +200,6 @@ static int get_nr_ram_ranges_callback(u64 start, u64 end, void *arg)
 	return 0;
 }
 
-static int get_gart_ranges_callback(u64 start, u64 end, void *arg)
-{
-	struct crash_elf_data *ced = arg;
-
-	ced->gart_start = start;
-	ced->gart_end = end;
-
-	/* Not expecting more than 1 gart aperture */
-	return 1;
-}
-
 
 /* Gather all the required information to prepare elf headers for ram regions */
 static void fill_up_crash_elf_data(struct crash_elf_data *ced,
@@ -226,22 +214,6 @@ static void fill_up_crash_elf_data(struct crash_elf_data *ced,
 
 	ced->max_nr_ranges = nr_ranges;
 
-	/*
-	 * We don't create ELF headers for GART aperture as an attempt
-	 * to dump this memory in second kernel leads to hang/crash.
-	 * If gart aperture is present, one needs to exclude that region
-	 * and that could lead to need of extra phdr.
-	 */
-	walk_iomem_res("GART", IORESOURCE_MEM, 0, -1,
-				ced, get_gart_ranges_callback);
-
-	/*
-	 * If we have gart region, excluding that could potentially split
-	 * a memory range, resulting in extra header. Account for  that.
-	 */
-	if (ced->gart_end)
-		ced->max_nr_ranges++;
-
 	/* Exclusion of crash region could split memory ranges */
 	ced->max_nr_ranges++;
 
@@ -350,13 +322,6 @@ static int elf_header_exclude_ranges(struct crash_elf_data *ced,
 			return ret;
 	}
 
-	/* Exclude GART region */
-	if (ced->gart_end) {
-		ret = exclude_mem_range(cmem, ced->gart_start, ced->gart_end);
-		if (ret)
-			return ret;
-	}
-
 	return ret;
 }
 
-- 
2.3.5




More information about the kexec mailing list