Blame SOURCES/kexec-tools-2.0.4-Revert-kexec-include-reserved-e820-sections-in-crash.patch

ab224c
From 1a4e90ba221684e563bf1baf06f3547cd95e60b0 Mon Sep 17 00:00:00 2001
ab224c
Message-Id: <1a4e90ba221684e563bf1baf06f3547cd95e60b0.1380267809.git.bhe@redhat.com>
ab224c
From: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
ab224c
Date: Sun, 31 Mar 2013 11:12:53 +0800
ab224c
Subject: [PATCH] Revert "kexec: include reserved e820 sections in crash
ab224c
 kernel"
ab224c
ab224c
This reverts commit e35aa29fb40b37bf86d980b2e19af5e01c2d2549.
ab224c
This patch is based on the commit 49320340f705694e387d794f7f19d407ad9baefa
ab224c
     "kexec: lengthen the kernel command line image"
ab224c
Since the latter commit has been reverted due to its useless, this
ab224c
patch should be reverted too.
ab224c
ab224c
Besides, This patch also changed a kernel restriction of max segments
ab224c
from 16 to 70. Though kexec-tools could have more segments, more than 16,
ab224c
the kexec_load syscall will still fail for the kernel side has a restriction
ab224c
of 16.
ab224c
ab224c
Cc: Cliff Wickman <cpw@sgi.com>
ab224c
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
ab224c
Signed-off-by: Simon Horman <horms@verge.net.au>
ab224c
Signed-off-by: Baoquan He <bhe@redhat.com>
ab224c
---
ab224c
 kexec/arch/i386/crashdump-x86.c | 31 ++-----------------------------
ab224c
 kexec/kexec-syscall.h           |  2 +-
ab224c
 2 files changed, 3 insertions(+), 30 deletions(-)
ab224c
ab224c
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
ab224c
index 4167e5e..e44fceb 100644
ab224c
--- a/kexec/arch/i386/crashdump-x86.c
ab224c
+++ b/kexec/arch/i386/crashdump-x86.c
ab224c
@@ -247,8 +247,6 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges,
ab224c
 			type = RANGE_ACPI;
ab224c
 		} else if(memcmp(str,"ACPI Non-volatile Storage\n",26) == 0 ) {
ab224c
 			type = RANGE_ACPI_NVS;
ab224c
-		} else if(memcmp(str,"reserved\n", 9) == 0 ) {
ab224c
-			type = RANGE_RESERVED;
ab224c
 		} else if (memcmp(str, "GART\n", 5) == 0) {
ab224c
 			gart_start = start;
ab224c
 			gart_end = end;
ab224c
@@ -908,27 +906,6 @@ static void get_backup_area(struct kexec_info *info,
ab224c
 	info->backup_src_size = BACKUP_SRC_END - BACKUP_SRC_START + 1;
ab224c
 }
ab224c
 
ab224c
-/* Appends memmap=X$Y commandline for reserved memory to command line*/
ab224c
-static int cmdline_add_memmap_reserved(char *cmdline, unsigned long start,
ab224c
-					unsigned long end)
ab224c
-{
ab224c
-	int align = 1024;
ab224c
-	unsigned long startk, endk;
ab224c
-
ab224c
-	if (!(end - start))
ab224c
-		return 0;
ab224c
-
ab224c
-	startk = start/1024;
ab224c
-	endk = (end + align - 1)/1024;
ab224c
-	cmdline_add_memmap_internal(cmdline, startk, endk, RANGE_RESERVED);
ab224c
-
ab224c
-#ifdef DEBUG
ab224c
-		printf("Command line after adding reserved memmap\n");
ab224c
-		printf("%s\n", cmdline);
ab224c
-#endif
ab224c
-	return 0;
ab224c
-}
ab224c
-
ab224c
 /* Loads additional segments in case of a panic kernel is being loaded.
ab224c
  * One segment for backup region, another segment for storing elf headers
ab224c
  * for crash memory image.
ab224c
@@ -1076,15 +1053,11 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,
ab224c
 	for (i = 0; i < CRASH_MAX_MEMORY_RANGES; i++) {
ab224c
 		unsigned long start, end;
ab224c
 		if ( !( mem_range[i].type == RANGE_ACPI
ab224c
-			|| mem_range[i].type == RANGE_ACPI_NVS
ab224c
-			|| mem_range[i].type == RANGE_RESERVED) )
ab224c
+			|| mem_range[i].type == RANGE_ACPI_NVS) )
ab224c
 			continue;
ab224c
 		start = mem_range[i].start;
ab224c
 		end = mem_range[i].end;
ab224c
-		if (mem_range[i].type == RANGE_RESERVED)
ab224c
-			cmdline_add_memmap_reserved(mod_cmdline, start, end);
ab224c
-		else
ab224c
-			cmdline_add_memmap_acpi(mod_cmdline, start, end);
ab224c
+		cmdline_add_memmap_acpi(mod_cmdline, start, end);
ab224c
 	}
ab224c
 	return 0;
ab224c
 }
ab224c
diff --git a/kexec/kexec-syscall.h b/kexec/kexec-syscall.h
ab224c
index f5ee992..b56cb00 100644
ab224c
--- a/kexec/kexec-syscall.h
ab224c
+++ b/kexec/kexec-syscall.h
ab224c
@@ -78,7 +78,7 @@ static inline long kexec_load(void *entry, unsigned long nr_segments,
ab224c
 #define KEXEC_ARCH_MIPS    ( 8 << 16)
ab224c
 #define KEXEC_ARCH_CRIS    (76 << 16)
ab224c
 
ab224c
-#define KEXEC_MAX_SEGMENTS 70
ab224c
+#define KEXEC_MAX_SEGMENTS 16
ab224c
 
ab224c
 #ifdef __i386__
ab224c
 #define KEXEC_ARCH_NATIVE	KEXEC_ARCH_386
ab224c
-- 
ab224c
1.8.3.1
ab224c