Re: Kexec/Kdump: honour non-zero crashkernel offset.

From: Horms <horms_at_verge.net.au>
Date: 2006-10-20 15:52:01
On Thu, Sep 21, 2006 at 06:45:48PM +0900, Horms wrote:
> On Thu, Sep 21, 2006 at 01:49:09PM +0800, Zou, Nanhai wrote:
> > 	This patch is still incorrect. You will miss the rsvd_region code if base not equals 0. 
> 
> Thanks, I guess this is closer, though I'm assuming that calling
> sort_regions() isn't needed unless kdump_find_rsvd_region() is going
> to be called.

Hi,

here is yet another version of this patch. This time I tested it
and it actually seems to work (unlike previous itterations I sent).

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/

[IA64] Kexec/Kdump: honour non-zero crashkernel offset.

There seems to be a value in both allowing the kernel to determine
the base offset of the crashkernel automatically and allowing
users's to sepcify it.

The old behaviour on ia64, which is still the current behaviour on
most architectures is for the user to always specify the address.
Recently ia64 was changed so that it is always automatically determined.

With this patch the kernel automatically determines the offset if
the supplied value is 0, otherwise it uses the value provided.

This should probably be backed by a documentation change.

Signed-Off-By: Simon Horman <horms@verge.net.au>

Index: kexec-ia64-2.6/arch/ia64/kernel/setup.c
===================================================================
--- kexec-ia64-2.6.orig/arch/ia64/kernel/setup.c	2006-10-20 13:13:38.000000000 +0900
+++ kexec-ia64-2.6/arch/ia64/kernel/setup.c	2006-10-20 14:49:05.000000000 +0900
@@ -257,7 +257,7 @@
 
 #ifdef CONFIG_KEXEC
 	/* crashkernel=size@offset specifies the size to reserve for a crash
-	 * kernel.(offset is ingored for keep compatibility with other archs)
+	 * kernel. If offset is 0, then it is determined automatically.
 	 * By reserving this memory we guarantee that linux never set's it
 	 * up as a DMA target.Useful for holding code to do something
 	 * appropriate after a kernel panic.
@@ -267,10 +267,16 @@
 		unsigned long base, size;
 		if (from) {
 			size = memparse(from + 12, &from);
+			if (*from == '@')
+				base = memparse(from+1, &from);
+			else
+				base = 0;
 			if (size) {
-				sort_regions(rsvd_region, n);
-				base = kdump_find_rsvd_region(size,
-				rsvd_region, n);
+				if (!base) {
+					sort_regions(rsvd_region, n);
+					base = kdump_find_rsvd_region(size,
+							      	rsvd_region, n);
+					}
 				if (base != ~0UL) {
 					rsvd_region[n].start =
 						(unsigned long)__va(base);
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Fri Oct 20 15:53:40 2006

This archive was generated by hypermail 2.1.8 : 2006-10-20 15:53:51 EST