[prev in list] [next in list] [prev in thread] [next in thread] 

List:       opensuse-commit
Subject:    commit kexec-tools
From:       root () suse ! de (h_root)
Date:       2006-05-31 15:10:08
Message-ID: 20060531151008.791809088F () Hilbert ! suse ! de
[Download RAW message or body]


Hello community,

here is the log from the commit of package kexec-tools
checked in at Wed May 31 17:10:08 CEST 2006.

--------
--- kexec-tools/kexec-tools.changes	2006-05-22 12:51:25.000000000 +0200
+++ kexec-tools/kexec-tools.changes	2006-05-30 16:04:43.000000000 +0200
@@ -1,0 +2,5 @@
+Tue May 30 16:03:26 CEST 2006 - tiwai@suse.de
+
+- ppc64 kdump ELF header fix for power 4 box (#175128).
+
+-------------------------------------------------------------------

New:
----
  ppc64-kdump-tools-ELF-header-fix.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kexec-tools.spec ++++++
--- /var/tmp/diff_new_pack.rFXKRI/_old	2006-05-31 17:09:45.000000000 +0200
+++ /var/tmp/diff_new_pack.rFXKRI/_new	2006-05-31 17:09:45.000000000 +0200
@@ -17,7 +17,7 @@
 Autoreqprov:    on
 Summary:        Tools for fast kernel loading
 Version:        1.101
-Release:        33
+Release:        34
 Source:         %{name}-%{version}.tar.bz2
 Source1:        kdump
 Source2:        sysconfig.kdump
@@ -31,6 +31,7 @@
 Patch3:         kexec-tools-ia64-fix.diff
 Patch4:         kexec-tools-s390-fix.diff
 Patch5:         kexec-tools-ppc64-rm-platform-prop-fix.patch
+Patch6:         ppc64-kdump-tools-ELF-header-fix.patch
 URL:            http://www.xmission.com/~ebiederm/files/kexec/
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
@@ -59,6 +60,7 @@
 %patch3
 %patch4
 %patch5 -p1
+%patch6 -p1
 %{?suse_update_config -f}
 cp %{SOURCE5} .
 
@@ -114,6 +116,8 @@
 /var/adm/fillup-templates/sysconfig.kdump
 
 %changelog -n kexec-tools
+* Tue May 30 2006 - tiwai@suse.de
+- ppc64 kdump ELF header fix for power 4 box (#175128).
 * Mon May 22 2006 - tiwai@suse.de
 - added the missing man page for kexec (#175084).
 - add sleep after reboot in kdump init script for avoiding






++++++ ppc64-kdump-tools-ELF-header-fix.patch ++++++
diff -Naurp tools.orig/kexec-tools-1.101/kexec/arch/ppc64/crashdump-ppc64.c \
                kexec-tools-1.101/kexec/arch/ppc64/crashdump-ppc64.c
--- tools.orig/kexec-tools-1.101/kexec/arch/ppc64/crashdump-ppc64.c	2006-05-28 \
                20:06:06.000000000 -0500
+++ kexec-tools-1.101/kexec/arch/ppc64/crashdump-ppc64.c	2006-05-28 \
20:17:18.000000000 -0500 @@ -44,9 +44,6 @@ static struct memory_range crash_memory_
  */
 mem_rgns_t usablemem_rgns = {0, };
 
-/* array to store memory regions to be excluded from elf header creation */
-mem_rgns_t exclude_rgns = {0, };
-
 /*
  * To store the memory size of the first kernel and this value will be
  * passed to the second kernel as command line (savemaxmem=xM).
@@ -58,8 +55,6 @@ mem_rgns_t exclude_rgns = {0, };
  */
 unsigned long saved_max_mem = 0;
 
-static int sort_regions(mem_rgns_t *rgn);
-
 /* Reads the appropriate file and retrieves the SYSTEM RAM regions for whom to
  * create Elf headers. Keeping it separate from get_memory_ranges() as
  * requirements are different in the case of normal kexec and crashdumps.
@@ -81,7 +76,7 @@ static int get_crash_memory_ranges(struc
 	DIR *dir, *dmem;
 	FILE *file;
 	struct dirent *dentry, *mentry;
-	int i, n, match;
+	int i, n;
 	unsigned long long start, end, cstart, cend;
 
 	/* create a separate program header for the backup region */
@@ -121,68 +116,72 @@ static int get_crash_memory_ranges(struc
 				closedir(dir);
 				return -1;
 			}
-			if (memory_ranges >= MAX_MEMORY_RANGES)
-				break;
+			if (memory_ranges >= MAX_MEMORY_RANGES) {
+				/* No space to insert another element. */
+				fprintf(stderr, 
+					"Error: Number of crash memory ranges"	
+					" excedeed the max limit\n");
+				return -1;
+			}
+
 			start = ((unsigned long long *)buf)[0];
 			end = start + ((unsigned long long *)buf)[1];
 			if (start == 0 && end >= 0x8000)
 				start = 0x8000;
-			match = 0;
-			sort_regions(&exclude_rgns);
-
-			/* exclude crash reserved regions */
-			for (i = 0; i < exclude_rgns.size; i++) {
-				cstart = exclude_rgns.ranges[i].start;
-				cend = exclude_rgns.ranges[i].end;
-				if (cstart < end && cend > start) {
-					if ((cstart == start) && (cend == end)) {
-						match = 1;
-						continue;
-					}
-					if (start < cstart && end > cend) {
-						match = 1;
-						crash_memory_range[memory_ranges].start = start;
-						crash_memory_range[memory_ranges].end = cstart - 1;
-						crash_memory_range[memory_ranges].type = RANGE_RAM;
-						memory_ranges++;
-						crash_memory_range[memory_ranges].start = cend + 1;
-						crash_memory_range[memory_ranges].end = end;
-						crash_memory_range[memory_ranges].type = RANGE_RAM;
-						memory_ranges++;
-						break;
-					} else if (start < cstart) {
-						match = 1;
-						crash_memory_range[memory_ranges].start = start;
-						crash_memory_range[memory_ranges].end = cstart - 1;
-						crash_memory_range[memory_ranges].type = RANGE_RAM;
-						memory_ranges++;
-						end = cstart - 1;
-						continue;
-					} else if (end > cend){
-						match = 1;
-						crash_memory_range[memory_ranges].start = cend + 1;
-						crash_memory_range[memory_ranges].end = end;
-						crash_memory_range[memory_ranges].type = RANGE_RAM;
-						memory_ranges++;
-						start = cend + 1;
-						continue;
-					}
+			
+			cstart = crash_base;
+			cend = crash_base + crash_size;
+			/*
+			 * Exclude the region that lies within crashkernel
+			 */
+			if (cstart < end && cend > start) {
+				if (start < cstart && end > cend) {
+					crash_memory_range[memory_ranges].start = start;
+					crash_memory_range[memory_ranges].end = cstart;
+					crash_memory_range[memory_ranges].type = RANGE_RAM;
+					memory_ranges++;
+					crash_memory_range[memory_ranges].start = cend;
+					crash_memory_range[memory_ranges].end = end;
+					crash_memory_range[memory_ranges].type = RANGE_RAM;
+					memory_ranges++;
+				} else if (start < cstart) {
+					crash_memory_range[memory_ranges].start = start;
+					crash_memory_range[memory_ranges].end = cstart;
+					crash_memory_range[memory_ranges].type = RANGE_RAM;
+					memory_ranges++;
+				} else if (end > cend){
+					crash_memory_range[memory_ranges].start = cend;
+					crash_memory_range[memory_ranges].end = end;
+					crash_memory_range[memory_ranges].type = RANGE_RAM;
+					memory_ranges++;
 				}
-
-			} /* end of for loop */
-			if (!match) {
+			} else {
 				crash_memory_range[memory_ranges].start = start;
 				crash_memory_range[memory_ranges].end  = end;
 				crash_memory_range[memory_ranges].type = RANGE_RAM;
 				memory_ranges++;
 			}
-
 			fclose(file);
 		}
 		closedir(dmem);
 	}
 	closedir(dir);
 
+	/* 
+	 * If RTAS region is overlapped with crashkernel, need to create ELF
+	 * Program header for the overlapped memory.
+	 */
+	if (crash_base < rtas_base + rtas_size &&
+		rtas_base < crash_base + crash_size) {
+		cstart = rtas_base;
+		cend = rtas_base + rtas_size;
+		if (cstart < crash_base)
+			cstart = crash_base;
+		if (cend > crash_base + crash_size)
+			cend = crash_base + crash_size;
+		crash_memory_range[memory_ranges].start = cstart;
+		crash_memory_range[memory_ranges++].end = cend;
+	} 
 	/*
 	 * Can not trust the memory regions order that we read from
 	 * device-tree. Hence, get the MAX end value.
@@ -450,45 +449,7 @@ void add_usable_mem_rgns(unsigned long l
 #endif
 }
 
-/*
- * Used to exclude various memory regions that do not need elf hdr generation
- */
-
-void add_exclude_rgns(unsigned long long base, unsigned long long size)
-{
-	int i;
-	unsigned long long end = base + size;
-	unsigned long long xstart, xend;
-
-	for (i=0; i < exclude_rgns.size; i++) {
-		xstart = exclude_rgns.ranges[i].start;
-		xend = exclude_rgns.ranges[i].end;
-		if (base < xend && end > xstart) {
-			if ((base >= xstart) && (end <= xend))
-				return;
-			if (base < xstart && end > xend) {
-				exclude_rgns.ranges[i].start = base;
-				exclude_rgns.ranges[i].end = end;
-				return;
-			} else if (base < xstart) {
-				exclude_rgns.ranges[i].start = base;
-				exclude_rgns.ranges[i].end = xend;
-				return;
-			} else if (end > xend){
-				exclude_rgns.ranges[i].start = xstart;
-				exclude_rgns.ranges[i].end = end;
-				return;
-			}
-		}
-	}
-	exclude_rgns.ranges[exclude_rgns.size].start = base;
-	exclude_rgns.ranges[exclude_rgns.size++].end = end;
-
-#ifdef DEBUG
-	fprintf(stderr, "exclude rgns size:%d base:%lx end:%lx size:%lx\n", \
                exclude_rgns.size, base, end, size);
-#endif
-}
-
+#if 0
 static int sort_regions(mem_rgns_t *rgn)
 {
 	int i, j;
@@ -508,4 +469,5 @@ static int sort_regions(mem_rgns_t *rgn)
 	return 0;
 
 }
+#endif
 
diff -Naurp tools.orig/kexec-tools-1.101/kexec/arch/ppc64/crashdump-ppc64.h \
                kexec-tools-1.101/kexec/arch/ppc64/crashdump-ppc64.h
--- tools.orig/kexec-tools-1.101/kexec/arch/ppc64/crashdump-ppc64.h	2006-05-28 \
                20:06:06.000000000 -0500
+++ kexec-tools-1.101/kexec/arch/ppc64/crashdump-ppc64.h	2006-05-28 \
15:21:31.000000000 -0500 @@ -4,7 +4,6 @@
 int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
 				unsigned long max_addr, unsigned long min_base);
 void add_usable_mem_rgns(unsigned long long base, unsigned long long size);
-void add_exclude_rgns(unsigned long long base, unsigned long long size);
 
 #define PAGE_OFFSET      0xC000000000000000
 #define KERNELBASE      PAGE_OFFSET
@@ -31,5 +30,7 @@ void add_exclude_rgns(unsigned long long
 
 extern unsigned long long crash_base;
 extern unsigned long long crash_size;
+extern unsigned int rtas_base;
+extern unsigned int rtas_size;
 
 #endif /* CRASHDUMP_PPC64_H */
diff -Naurp tools.orig/kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.c \
                kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.c
--- tools.orig/kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.c	2006-05-28 \
                20:06:06.000000000 -0500
+++ kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.c	2006-05-28 20:22:52.000000000 \
-0500 @@ -41,6 +41,7 @@ static struct memory_range base_memory_r
 unsigned long long memory_max = 0;
 static int nr_memory_ranges, nr_exclude_ranges;
 unsigned long long crash_base, crash_size;
+unsigned int rtas_base, rtas_size;
 
 static int sort_base_ranges();
 
@@ -87,8 +88,10 @@ static int get_base_ranges()
 				closedir(dir);
 				return -1;
 			}
-			if (local_memory_ranges >= MAX_MEMORY_RANGES)
+			if (local_memory_ranges >= MAX_MEMORY_RANGES) {
+				fclose(file);
 				break;
+			}
 			base_memory_range[local_memory_ranges].start =
 				((unsigned long long *)buf)[0];
 			base_memory_range[local_memory_ranges].end  =
@@ -165,7 +168,6 @@ static int get_devtree_details(unsigned 
 	unsigned long long rmo_base;
 	unsigned long long tce_base;
 	unsigned int tce_size;
-	unsigned int rtas_base, rtas_size;
 	unsigned long long htab_base, htab_size;
 	unsigned long long kernel_end;
 	char buf[MAXBYTES-1];
@@ -428,29 +430,6 @@ static int get_devtree_details(unsigned 
 
 	sort_ranges();
 
-	/* add crash_region and remove rtas range from exclude regions if it
-	 * lies within crash region
-	 */
-	if (kexec_flags & KEXEC_ON_CRASH) {
-		unsigned long new_crash_size;
-		if (crash_base < rtas_base &&
-			((crash_base + crash_size) > (rtas_base + rtas_size))){
-			new_crash_size = rtas_base - crash_base;
-			add_exclude_rgns(crash_base, new_crash_size);
-			new_crash_size = (crash_base + crash_size) - (rtas_base + rtas_size);
-			add_exclude_rgns(rtas_base + rtas_size, new_crash_size);
-		} else if (crash_base < rtas_base &&
-			((rtas_base + rtas_size) > (crash_base + crash_size))){
-			new_crash_size = rtas_base - crash_base;
-			add_exclude_rgns(crash_base, new_crash_size);
-		} else if (crash_base > rtas_base &&
-			((rtas_base + rtas_size) < (crash_base + crash_size))){
-			new_crash_size = (crash_base + crash_size) - (rtas_base + rtas_size);
-			add_exclude_rgns(rtas_base + rtas_size, new_crash_size);
-		} else
-			add_exclude_rgns(crash_base, crash_size);
-	}
-
 #ifdef DEBUG
 	int k;
 	for (k = 0; k < i; k++)
diff -Naurp tools.orig/kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.h \
                kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.h
--- tools.orig/kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.h	2006-05-28 \
                20:06:06.000000000 -0500
+++ kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.h	2006-05-28 15:30:00.000000000 \
-0500 @@ -1,7 +1,8 @@
 #ifndef KEXEC_PPC64_H
 #define KEXEC_PPC64_H
 
-#define MAX_MEMORY_RANGES 256 /* TO FIX - needs to be dynamically set */
+#define MAX_MEMORY_RANGES 1024 /* TO FIX - needs to be dynamically set */
+
 #define MAXBYTES 128
 #define MAX_LINE 160
 #define CORE_TYPE_ELF32 1


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic