public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
* [patch 0/2] kdump: Common code changes for s390 kdump support
@ 2011-08-19 14:18 Michael Holzheu
  2011-08-19 14:18 ` [patch 1/2] kdump: Add KEXEC_CRASH_CONTROL_MEMORY_LIMIT Michael Holzheu
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Michael Holzheu @ 2011-08-19 14:18 UTC (permalink / raw)
  To: akpm
  Cc: oomichi, linux-s390, mahesh, heiko.carstens, linux-kernel, hbabu,
	horms, ebiederm, schwidefsky, kexec, vgoyal

Hello Andrew,

I had a long discussion with Vivek Goyal on the s390 kdump support (thanks
Vivek for all the time!). As a result of this, here are two common code
patches that are required for the s390 port. Could you please integrate them
upstream in the next merge window? The s390 specific part will be integrated
by our s390 maintainer Martin Schwidefsky.

I will be on vacation for the next two weeks. Therefore if you have comments
or questions, please contact also Martin Schwidefsky and Heiko Carstens.

Thanks

   Michael

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [patch 1/2] kdump: Add KEXEC_CRASH_CONTROL_MEMORY_LIMIT
  2011-08-19 14:18 [patch 0/2] kdump: Common code changes for s390 kdump support Michael Holzheu
@ 2011-08-19 14:18 ` Michael Holzheu
  2011-08-19 14:24   ` Vivek Goyal
  2011-08-19 14:18 ` [patch 2/2] kdump: Add size to elfcorehdr kernel parameter Michael Holzheu
  2011-08-19 22:03 ` [patch 0/2] kdump: Common code changes for s390 kdump support Andrew Morton
  2 siblings, 1 reply; 7+ messages in thread
From: Michael Holzheu @ 2011-08-19 14:18 UTC (permalink / raw)
  To: akpm
  Cc: oomichi, linux-s390, mahesh, heiko.carstens, linux-kernel, hbabu,
	horms, ebiederm, schwidefsky, kexec, vgoyal

[-- Attachment #1: s390-kdump-common-control-limit.patch --]
[-- Type: text/plain, Size: 1404 bytes --]

From: Michael Holzheu <holzheu@linux.vnet.ibm.com>

On s390 there is a different KEXEC_CONTROL_MEMORY_LIMIT for the normal and
the kdump kexec case. Therefore this patch introduces a new macro
KEXEC_CRASH_CONTROL_MEMORY_LIMIT. This is set to
KEXEC_CONTROL_MEMORY_LIMIT for all architectures that do not define
KEXEC_CRASH_CONTROL_MEMORY_LIMIT.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
---
 include/linux/kexec.h |    4 ++++
 kernel/kexec.c        |    2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -33,6 +33,10 @@
 #error KEXEC_ARCH not defined
 #endif
 
+#ifndef KEXEC_CRASH_CONTROL_MEMORY_LIMIT
+#define KEXEC_CRASH_CONTROL_MEMORY_LIMIT KEXEC_CONTROL_MEMORY_LIMIT
+#endif
+
 #define KEXEC_NOTE_HEAD_BYTES ALIGN(sizeof(struct elf_note), 4)
 #define KEXEC_CORE_NOTE_NAME "CORE"
 #define KEXEC_CORE_NOTE_NAME_BYTES ALIGN(sizeof(KEXEC_CORE_NOTE_NAME), 4)
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -498,7 +498,7 @@ static struct page *kimage_alloc_crash_c
 	while (hole_end <= crashk_res.end) {
 		unsigned long i;
 
-		if (hole_end > KEXEC_CONTROL_MEMORY_LIMIT)
+		if (hole_end > KEXEC_CRASH_CONTROL_MEMORY_LIMIT)
 			break;
 		if (hole_end > crashk_res.end)
 			break;


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [patch 2/2] kdump: Add size to elfcorehdr kernel parameter
  2011-08-19 14:18 [patch 0/2] kdump: Common code changes for s390 kdump support Michael Holzheu
  2011-08-19 14:18 ` [patch 1/2] kdump: Add KEXEC_CRASH_CONTROL_MEMORY_LIMIT Michael Holzheu
@ 2011-08-19 14:18 ` Michael Holzheu
  2011-08-19 14:25   ` Vivek Goyal
  2011-08-19 22:03 ` [patch 0/2] kdump: Common code changes for s390 kdump support Andrew Morton
  2 siblings, 1 reply; 7+ messages in thread
From: Michael Holzheu @ 2011-08-19 14:18 UTC (permalink / raw)
  To: akpm
  Cc: oomichi, linux-s390, mahesh, heiko.carstens, linux-kernel, hbabu,
	horms, ebiederm, schwidefsky, kexec, vgoyal

[-- Attachment #1: s390-kdump-common-elfcorehdr-parm.patch --]
[-- Type: text/plain, Size: 3012 bytes --]

From: Michael Holzheu <holzheu@linux.vnet.ibm.com>

Currently only the address of the pre-allocated ELF header is passed with
the elfcorehdr= kernel parameter. In order to reserve memory for the header
in the 2nd kernel also the size is required. Current kdump architecture
backends use different methods to do that, e.g. x86 uses the memmap= kernel
parameter. On s390 there is no easy way to transfer this information.
Therefore the elfcorehdr kernel parameter is extended to also pass the size.
This now can also be used as standard mechanism by all future kdump
architecture backends.

The syntax of the kernel parameter is extended as follows:

elfcorehdr=[size[KMG]@]offset[KMG]

This change is backward compatible because elfcorehdr=size is still allowed.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
---
 Documentation/kernel-parameters.txt |    6 +++---
 include/linux/crash_dump.h          |    1 +
 kernel/crash_dump.c                 |   11 +++++++++++
 3 files changed, 15 insertions(+), 3 deletions(-)

--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -727,10 +727,10 @@ bytes respectively. Such letter suffixes
 			See Documentation/block/as-iosched.txt and
 			Documentation/block/deadline-iosched.txt for details.
 
-	elfcorehdr=	[IA-64,PPC,SH,X86]
+	elfcorehdr=[size[KMG]@]offset[KMG] [IA64,PPC,SH,X86,S390]
 			Specifies physical address of start of kernel core
-			image elf header. Generally kexec loader will
-			pass this option to capture kernel.
+			image elf header and optionally the size. Generally
+			kexec loader will pass this option to capture kernel.
 			See Documentation/kdump/kdump.txt for details.
 
 	enable_mtrr_cleanup [X86]
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -10,6 +10,7 @@
 #define ELFCORE_ADDR_ERR	(-2ULL)
 
 extern unsigned long long elfcorehdr_addr;
+extern unsigned long long elfcorehdr_size;
 
 extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
 						unsigned long, int);
--- a/kernel/crash_dump.c
+++ b/kernel/crash_dump.c
@@ -20,8 +20,15 @@ unsigned long saved_max_pfn;
 unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
 
 /*
+ * stores the size of elf header of crash image
+ */
+unsigned long long elfcorehdr_size;
+
+/*
  * elfcorehdr= specifies the location of elf core header stored by the crashed
  * kernel. This option will be passed by kexec loader to the capture kernel.
+ *
+ * Syntax: elfcorehdr=[size[KMG]@]offset[KMG]
  */
 static int __init setup_elfcorehdr(char *arg)
 {
@@ -29,6 +36,10 @@ static int __init setup_elfcorehdr(char
 	if (!arg)
 		return -EINVAL;
 	elfcorehdr_addr = memparse(arg, &end);
+	if (*end == '@') {
+		elfcorehdr_size = elfcorehdr_addr;
+		elfcorehdr_addr = memparse(end + 1, &end);
+	}
 	return end > arg ? 0 : -EINVAL;
 }
 early_param("elfcorehdr", setup_elfcorehdr);


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch 1/2] kdump: Add KEXEC_CRASH_CONTROL_MEMORY_LIMIT
  2011-08-19 14:18 ` [patch 1/2] kdump: Add KEXEC_CRASH_CONTROL_MEMORY_LIMIT Michael Holzheu
@ 2011-08-19 14:24   ` Vivek Goyal
  0 siblings, 0 replies; 7+ messages in thread
From: Vivek Goyal @ 2011-08-19 14:24 UTC (permalink / raw)
  To: Michael Holzheu
  Cc: oomichi, linux-s390, mahesh, heiko.carstens, linux-kernel, hbabu,
	horms, ebiederm, schwidefsky, akpm, kexec

On Fri, Aug 19, 2011 at 04:18:58PM +0200, Michael Holzheu wrote:
> From: Michael Holzheu <holzheu@linux.vnet.ibm.com>
> 
> On s390 there is a different KEXEC_CONTROL_MEMORY_LIMIT for the normal and
> the kdump kexec case. Therefore this patch introduces a new macro
> KEXEC_CRASH_CONTROL_MEMORY_LIMIT. This is set to
> KEXEC_CONTROL_MEMORY_LIMIT for all architectures that do not define
> KEXEC_CRASH_CONTROL_MEMORY_LIMIT.
> 
> Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>

Looks good to me. 

Acked-by: Vivek Goyal <vgoyal@redhat.com>

Vivek

> ---
>  include/linux/kexec.h |    4 ++++
>  kernel/kexec.c        |    2 +-
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> --- a/include/linux/kexec.h
> +++ b/include/linux/kexec.h
> @@ -33,6 +33,10 @@
>  #error KEXEC_ARCH not defined
>  #endif
>  
> +#ifndef KEXEC_CRASH_CONTROL_MEMORY_LIMIT
> +#define KEXEC_CRASH_CONTROL_MEMORY_LIMIT KEXEC_CONTROL_MEMORY_LIMIT
> +#endif
> +
>  #define KEXEC_NOTE_HEAD_BYTES ALIGN(sizeof(struct elf_note), 4)
>  #define KEXEC_CORE_NOTE_NAME "CORE"
>  #define KEXEC_CORE_NOTE_NAME_BYTES ALIGN(sizeof(KEXEC_CORE_NOTE_NAME), 4)
> --- a/kernel/kexec.c
> +++ b/kernel/kexec.c
> @@ -498,7 +498,7 @@ static struct page *kimage_alloc_crash_c
>  	while (hole_end <= crashk_res.end) {
>  		unsigned long i;
>  
> -		if (hole_end > KEXEC_CONTROL_MEMORY_LIMIT)
> +		if (hole_end > KEXEC_CRASH_CONTROL_MEMORY_LIMIT)
>  			break;
>  		if (hole_end > crashk_res.end)
>  			break;

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch 2/2] kdump: Add size to elfcorehdr kernel parameter
  2011-08-19 14:18 ` [patch 2/2] kdump: Add size to elfcorehdr kernel parameter Michael Holzheu
@ 2011-08-19 14:25   ` Vivek Goyal
  0 siblings, 0 replies; 7+ messages in thread
From: Vivek Goyal @ 2011-08-19 14:25 UTC (permalink / raw)
  To: Michael Holzheu
  Cc: oomichi, linux-s390, mahesh, heiko.carstens, linux-kernel, hbabu,
	horms, ebiederm, schwidefsky, akpm, kexec

On Fri, Aug 19, 2011 at 04:18:59PM +0200, Michael Holzheu wrote:
> From: Michael Holzheu <holzheu@linux.vnet.ibm.com>
> 
> Currently only the address of the pre-allocated ELF header is passed with
> the elfcorehdr= kernel parameter. In order to reserve memory for the header
> in the 2nd kernel also the size is required. Current kdump architecture
> backends use different methods to do that, e.g. x86 uses the memmap= kernel
> parameter. On s390 there is no easy way to transfer this information.
> Therefore the elfcorehdr kernel parameter is extended to also pass the size.
> This now can also be used as standard mechanism by all future kdump
> architecture backends.
> 
> The syntax of the kernel parameter is extended as follows:
> 
> elfcorehdr=[size[KMG]@]offset[KMG]
> 
> This change is backward compatible because elfcorehdr=size is still allowed.
> 
> Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>

Looks good to me.

Acked-by: Vivek Goyal <vgoyal@redhat.com>

Vivek

> ---
>  Documentation/kernel-parameters.txt |    6 +++---
>  include/linux/crash_dump.h          |    1 +
>  kernel/crash_dump.c                 |   11 +++++++++++
>  3 files changed, 15 insertions(+), 3 deletions(-)
> 
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -727,10 +727,10 @@ bytes respectively. Such letter suffixes
>  			See Documentation/block/as-iosched.txt and
>  			Documentation/block/deadline-iosched.txt for details.
>  
> -	elfcorehdr=	[IA-64,PPC,SH,X86]
> +	elfcorehdr=[size[KMG]@]offset[KMG] [IA64,PPC,SH,X86,S390]
>  			Specifies physical address of start of kernel core
> -			image elf header. Generally kexec loader will
> -			pass this option to capture kernel.
> +			image elf header and optionally the size. Generally
> +			kexec loader will pass this option to capture kernel.
>  			See Documentation/kdump/kdump.txt for details.
>  
>  	enable_mtrr_cleanup [X86]
> --- a/include/linux/crash_dump.h
> +++ b/include/linux/crash_dump.h
> @@ -10,6 +10,7 @@
>  #define ELFCORE_ADDR_ERR	(-2ULL)
>  
>  extern unsigned long long elfcorehdr_addr;
> +extern unsigned long long elfcorehdr_size;
>  
>  extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
>  						unsigned long, int);
> --- a/kernel/crash_dump.c
> +++ b/kernel/crash_dump.c
> @@ -20,8 +20,15 @@ unsigned long saved_max_pfn;
>  unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
>  
>  /*
> + * stores the size of elf header of crash image
> + */
> +unsigned long long elfcorehdr_size;
> +
> +/*
>   * elfcorehdr= specifies the location of elf core header stored by the crashed
>   * kernel. This option will be passed by kexec loader to the capture kernel.
> + *
> + * Syntax: elfcorehdr=[size[KMG]@]offset[KMG]
>   */
>  static int __init setup_elfcorehdr(char *arg)
>  {
> @@ -29,6 +36,10 @@ static int __init setup_elfcorehdr(char
>  	if (!arg)
>  		return -EINVAL;
>  	elfcorehdr_addr = memparse(arg, &end);
> +	if (*end == '@') {
> +		elfcorehdr_size = elfcorehdr_addr;
> +		elfcorehdr_addr = memparse(end + 1, &end);
> +	}
>  	return end > arg ? 0 : -EINVAL;
>  }
>  early_param("elfcorehdr", setup_elfcorehdr);

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch 0/2] kdump: Common code changes for s390 kdump support
  2011-08-19 14:18 [patch 0/2] kdump: Common code changes for s390 kdump support Michael Holzheu
  2011-08-19 14:18 ` [patch 1/2] kdump: Add KEXEC_CRASH_CONTROL_MEMORY_LIMIT Michael Holzheu
  2011-08-19 14:18 ` [patch 2/2] kdump: Add size to elfcorehdr kernel parameter Michael Holzheu
@ 2011-08-19 22:03 ` Andrew Morton
  2011-08-22  6:34   ` Martin Schwidefsky
  2 siblings, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2011-08-19 22:03 UTC (permalink / raw)
  To: Michael Holzheu
  Cc: oomichi, linux-s390, mahesh, heiko.carstens, linux-kernel, hbabu,
	horms, ebiederm, schwidefsky, kexec, vgoyal

On Fri, 19 Aug 2011 16:18:57 +0200
Michael Holzheu <holzheu@linux.vnet.ibm.com> wrote:

> I had a long discussion with Vivek Goyal on the s390 kdump support (thanks
> Vivek for all the time!). As a result of this, here are two common code
> patches that are required for the s390 port. Could you please integrate them
> upstream in the next merge window? The s390 specific part will be integrated
> by our s390 maintainer Martin Schwidefsky.

The patches look OK to me.  I suggest that they be carried in Martin's
tree, alongside the s390 kdump support.  That will somewhat simplify
things during the merge window, and will greatly simplify getting the
entire feature into linux-next.

You can put my acked-by's on them if you like.

> I will be on vacation for the next two weeks. Therefore if you have comments
> or questions, please contact also Martin Schwidefsky and Heiko Carstens.

I'll put the patches into my tree (and hence linux-next) now, because I
need the typing practice ;) I'll drop them again if/when they turn up
in linux-next's s390 tree.


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch 0/2] kdump: Common code changes for s390 kdump support
  2011-08-19 22:03 ` [patch 0/2] kdump: Common code changes for s390 kdump support Andrew Morton
@ 2011-08-22  6:34   ` Martin Schwidefsky
  0 siblings, 0 replies; 7+ messages in thread
From: Martin Schwidefsky @ 2011-08-22  6:34 UTC (permalink / raw)
  To: Andrew Morton
  Cc: oomichi, linux-s390, mahesh, heiko.carstens, linux-kernel, hbabu,
	horms, ebiederm, Michael Holzheu, kexec, vgoyal

On Fri, 19 Aug 2011 15:03:53 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:

> On Fri, 19 Aug 2011 16:18:57 +0200
> Michael Holzheu <holzheu@linux.vnet.ibm.com> wrote:
> 
> > I had a long discussion with Vivek Goyal on the s390 kdump support (thanks
> > Vivek for all the time!). As a result of this, here are two common code
> > patches that are required for the s390 port. Could you please integrate them
> > upstream in the next merge window? The s390 specific part will be integrated
> > by our s390 maintainer Martin Schwidefsky.
> 
> The patches look OK to me.  I suggest that they be carried in Martin's
> tree, alongside the s390 kdump support.  That will somewhat simplify
> things during the merge window, and will greatly simplify getting the
> entire feature into linux-next.
> 
> You can put my acked-by's on them if you like.
> 
> > I will be on vacation for the next two weeks. Therefore if you have comments
> > or questions, please contact also Martin Schwidefsky and Heiko Carstens.
> 
> I'll put the patches into my tree (and hence linux-next) now, because I
> need the typing practice ;) I'll drop them again if/when they turn up
> in linux-next's s390 tree.

Ok, sounds reasonable to me. I'll take them via the s390 tree and add
you acked-by. Thanks Andrew. 


-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-08-22  6:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-19 14:18 [patch 0/2] kdump: Common code changes for s390 kdump support Michael Holzheu
2011-08-19 14:18 ` [patch 1/2] kdump: Add KEXEC_CRASH_CONTROL_MEMORY_LIMIT Michael Holzheu
2011-08-19 14:24   ` Vivek Goyal
2011-08-19 14:18 ` [patch 2/2] kdump: Add size to elfcorehdr kernel parameter Michael Holzheu
2011-08-19 14:25   ` Vivek Goyal
2011-08-19 22:03 ` [patch 0/2] kdump: Common code changes for s390 kdump support Andrew Morton
2011-08-22  6:34   ` Martin Schwidefsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox