linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 0/2] kdump: Initialize vmcoreinfo note at startup
@ 2011-09-09 10:26 Michael Holzheu
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Holzheu @ 2011-09-09 10:26 UTC (permalink / raw)
  To: vgoyal
  Cc: ebiederm, mahesh, schwidefsky, heiko.carstens, kexec,
	linux-kernel, linux-s390

Hello Vivek,

Another patch that we would like to have upstream is the vmcoreinfo
note intitialization. This is independent from the s390 kdump port.
We need that for our traditional stand-alone and hypervisor dump
tools. You already have agreed that the patch looks ok:
https://lkml.org/lkml/2011/7/20/296

So could we get an ACK from you for the patch?

[1] kdump: Initialize vmcoreinfo note at startup
[2] s390: Export vmcoreinfo note

Thanks!

Michael

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

* [patch 0/2] kdump: Initialize vmcoreinfo note at startup
@ 2011-09-20 14:34 Michael Holzheu
  2011-09-20 14:34 ` [patch 1/2] " Michael Holzheu
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Michael Holzheu @ 2011-09-20 14:34 UTC (permalink / raw)
  To: akpm
  Cc: vgoyal, ebiederm, mahesh, schwidefsky, heiko.carstens, kexec,
	linux-kernel, linux-s390

Hello Andrew,

Another common code patch that we would like to have upstream is the vmcoreinfo
note initialization at Linux startup time. We need that for our traditional
stand-alone and hypervisor dump tools.

[1] kdump: Initialize vmcoreinfo note at startup
[2] s390: Export vmcoreinfo note

I already have discussed this with Vivek and he has acked the common code
patch [1].

Do you agree that Martin sends these patches together with the kdump page
table patches (see https://lkml.org/lkml/2011/9/15/55) in the next merge
window?

Michael

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

* [patch 1/2] kdump: Initialize vmcoreinfo note at startup
  2011-09-20 14:34 [patch 0/2] kdump: Initialize vmcoreinfo note at startup Michael Holzheu
@ 2011-09-20 14:34 ` Michael Holzheu
  2011-09-20 22:59   ` Andrew Morton
  2011-09-20 14:34 ` [patch 2/2] s390: Export vmcoreinfo note Michael Holzheu
  2011-09-20 23:00 ` [patch 0/2] kdump: Initialize vmcoreinfo note at startup Andrew Morton
  2 siblings, 1 reply; 7+ messages in thread
From: Michael Holzheu @ 2011-09-20 14:34 UTC (permalink / raw)
  To: akpm
  Cc: vgoyal, ebiederm, mahesh, schwidefsky, heiko.carstens, kexec,
	linux-kernel, linux-s390

[-- Attachment #1: s390-kdump-common-vmcoreinfo-init.patch --]
[-- Type: text/plain, Size: 2426 bytes --]

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

Currently the vmcoreinfo note is only initialized in case of kdump. On s390
it is possible to create kernel dumps with other dump mechanisms than kdump
(e.g. via hypervisor dump or stand-alone dump tools). For those dumps it
would also be desirable to include the vmcoreinfo data. To accomplish this,
with this patch the vmcoreinfo ELF note is always initialized, not only in
case of a (kdump) crash. On s390 we will add an ABI defined pointer at
a well known address to vmcoreinfo so that dump analysis tools are able to
find this information.

In particular on s390 we have a tool named zgetdump. With this tool it is
possible to convert dump formats on the fly using fuse. E.g. you can mount a
s390 stand-alone dump as ELF dump. When this is done, the tool finds the
vmcoreinfo in the stand-alone dump via the well known ABI defined address and
it creates the respective VMCOREINFO ELF note in the output ELF dump. This then
can be used e.g. by makedumpfile for dump filtering.  No more need for a
vmlinux file with debug information.

So this will look like the following:
$ zgetdump --mount standalone.dump -f elf /mnt
$ ls /mnt
  dump.elf
$ readelf -n /mnt/dump.elf
$ ...
  VMCOREINFO            0x00000474      Unknown note type: (0x00000000)
$ makedumpfile -c -d 31 /mnt/dump.elf dump.kdump

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
---
 kernel/kexec.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -1392,24 +1392,23 @@ int __init parse_crashkernel(char 		 *cm
 }
 
 
-
-void crash_save_vmcoreinfo(void)
+static void update_vmcoreinfo_note(void)
 {
-	u32 *buf;
+	u32 *buf = (u32 *) vmcoreinfo_note;
 
 	if (!vmcoreinfo_size)
 		return;
-
-	vmcoreinfo_append_str("CRASHTIME=%ld", get_seconds());
-
-	buf = (u32 *)vmcoreinfo_note;
-
 	buf = append_elf_note(buf, VMCOREINFO_NOTE_NAME, 0, vmcoreinfo_data,
 			      vmcoreinfo_size);
-
 	final_note(buf);
 }
 
+void crash_save_vmcoreinfo(void)
+{
+	vmcoreinfo_append_str("CRASHTIME=%ld", get_seconds());
+	update_vmcoreinfo_note();
+}
+
 void vmcoreinfo_append_str(const char *fmt, ...)
 {
 	va_list args;
@@ -1495,6 +1494,7 @@ static int __init crash_save_vmcoreinfo_
 	VMCOREINFO_NUMBER(PG_swapcache);
 
 	arch_crash_save_vmcoreinfo();
+	update_vmcoreinfo_note();
 
 	return 0;
 }


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

* [patch 2/2] s390: Export vmcoreinfo note
  2011-09-20 14:34 [patch 0/2] kdump: Initialize vmcoreinfo note at startup Michael Holzheu
  2011-09-20 14:34 ` [patch 1/2] " Michael Holzheu
@ 2011-09-20 14:34 ` Michael Holzheu
  2011-09-20 23:00 ` [patch 0/2] kdump: Initialize vmcoreinfo note at startup Andrew Morton
  2 siblings, 0 replies; 7+ messages in thread
From: Michael Holzheu @ 2011-09-20 14:34 UTC (permalink / raw)
  To: akpm
  Cc: vgoyal, ebiederm, mahesh, schwidefsky, heiko.carstens, kexec,
	linux-kernel, linux-s390

[-- Attachment #1: s390-kdump-arch-vmcoreinfo.patch --]
[-- Type: text/plain, Size: 1452 bytes --]

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

This patch defines for s390 an ABI defined pointer to the vmcoreinfo note at
a well known address. With this patch tools are able to find this information
in dumps created by stand-alone or hypervisor dump tools.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
---
 arch/s390/include/asm/lowcore.h |    3 ++-
 arch/s390/kernel/setup.c        |    8 ++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

--- a/arch/s390/include/asm/lowcore.h
+++ b/arch/s390/include/asm/lowcore.h
@@ -287,7 +287,8 @@ struct _lowcore {
 	 */
 	__u64	ipib;				/* 0x0e00 */
 	__u32	ipib_checksum;			/* 0x0e08 */
-	__u8	pad_0x0e0c[0x0f00-0x0e0c];	/* 0x0e0c */
+	__u64	vmcore_info;			/* 0x0e0c */
+	__u8	pad_0x0e14[0x0f00-0x0e14];	/* 0x0e14 */
 
 	/* Extended facility list */
 	__u64	stfle_fac_list[32];		/* 0x0f00 */
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -559,6 +559,13 @@ static void __init setup_restart_psw(voi
 	copy_to_absolute_zero(&S390_lowcore.restart_psw, &psw, sizeof(psw));
 }
 
+static void __init setup_vmcoreinfo(void)
+{
+	unsigned long ptr = paddr_vmcoreinfo_note();
+
+	copy_to_absolute_zero(&S390_lowcore.vmcore_info, &ptr, sizeof(ptr));
+}
+
 #ifdef CONFIG_CRASH_DUMP
 
 /*
@@ -1019,6 +1026,7 @@ setup_arch(char **cmdline_p)
 	reserve_crashkernel();
 	setup_memory();
 	setup_resources();
+	setup_vmcoreinfo();
 	setup_restart_psw();
 	setup_lowcore();
 


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

* Re: [patch 1/2] kdump: Initialize vmcoreinfo note at startup
  2011-09-20 14:34 ` [patch 1/2] " Michael Holzheu
@ 2011-09-20 22:59   ` Andrew Morton
  2011-09-21  8:49     ` Michael Holzheu
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2011-09-20 22:59 UTC (permalink / raw)
  To: Michael Holzheu
  Cc: vgoyal, ebiederm, mahesh, schwidefsky, heiko.carstens, kexec,
	linux-kernel, linux-s390, Andrew Morton

On Tue, 20 Sep 2011 16:34:01 +0200
Michael Holzheu <holzheu@linux.vnet.ibm.com> wrote:

> From: Michael Holzheu <holzheu@linux.vnet.ibm.com>
> 
> Currently the vmcoreinfo note is only initialized in case of kdump. On s390
> it is possible to create kernel dumps with other dump mechanisms than kdump
> (e.g. via hypervisor dump or stand-alone dump tools). For those dumps it
> would also be desirable to include the vmcoreinfo data. To accomplish this,
> with this patch the vmcoreinfo ELF note is always initialized, not only in
> case of a (kdump) crash. On s390 we will add an ABI defined pointer at
> a well known address to vmcoreinfo so that dump analysis tools are able to
> find this information.
> 
> In particular on s390 we have a tool named zgetdump. With this tool it is
> possible to convert dump formats on the fly using fuse. E.g. you can mount a
> s390 stand-alone dump as ELF dump. When this is done, the tool finds the
> vmcoreinfo in the stand-alone dump via the well known ABI defined address and
> it creates the respective VMCOREINFO ELF note in the output ELF dump. This then
> can be used e.g. by makedumpfile for dump filtering.  No more need for a
> vmlinux file with debug information.
> 
> So this will look like the following:
> $ zgetdump --mount standalone.dump -f elf /mnt
> $ ls /mnt
>   dump.elf
> $ readelf -n /mnt/dump.elf
> $ ...
>   VMCOREINFO            0x00000474      Unknown note type: (0x00000000)
> $ makedumpfile -c -d 31 /mnt/dump.elf dump.kdump
> 
> ...
>
> -void crash_save_vmcoreinfo(void)
> +static void update_vmcoreinfo_note(void)
>  {
> -	u32 *buf;
> +	u32 *buf = (u32 *) vmcoreinfo_note;

The cast is unneeded?

>  	if (!vmcoreinfo_size)
>  		return;
> -
> -	vmcoreinfo_append_str("CRASHTIME=%ld", get_seconds());
> -
> -	buf = (u32 *)vmcoreinfo_note;

As was the space you added after it ;)

>  	buf = append_elf_note(buf, VMCOREINFO_NOTE_NAME, 0, vmcoreinfo_data,
>  			      vmcoreinfo_size);
> -
>  	final_note(buf);
>  }


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

* Re: [patch 0/2] kdump: Initialize vmcoreinfo note at startup
  2011-09-20 14:34 [patch 0/2] kdump: Initialize vmcoreinfo note at startup Michael Holzheu
  2011-09-20 14:34 ` [patch 1/2] " Michael Holzheu
  2011-09-20 14:34 ` [patch 2/2] s390: Export vmcoreinfo note Michael Holzheu
@ 2011-09-20 23:00 ` Andrew Morton
  2 siblings, 0 replies; 7+ messages in thread
From: Andrew Morton @ 2011-09-20 23:00 UTC (permalink / raw)
  To: Michael Holzheu
  Cc: vgoyal, ebiederm, mahesh, schwidefsky, heiko.carstens, kexec,
	linux-kernel, linux-s390, Andrew Morton

On Tue, 20 Sep 2011 16:34:00 +0200
Michael Holzheu <holzheu@linux.vnet.ibm.com> wrote:

> Hello Andrew,
> 
> Another common code patch that we would like to have upstream is the vmcoreinfo
> note initialization at Linux startup time. We need that for our traditional
> stand-alone and hypervisor dump tools.
> 
> [1] kdump: Initialize vmcoreinfo note at startup
> [2] s390: Export vmcoreinfo note
> 
> I already have discussed this with Vivek and he has acked the common code
> patch [1].
> 
> Do you agree that Martin sends these patches together with the kdump page
> table patches (see https://lkml.org/lkml/2011/9/15/55) in the next merge
> window?

Sounds good to me, thanks.

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

* Re: [patch 1/2] kdump: Initialize vmcoreinfo note at startup
  2011-09-20 22:59   ` Andrew Morton
@ 2011-09-21  8:49     ` Michael Holzheu
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Holzheu @ 2011-09-21  8:49 UTC (permalink / raw)
  To: Andrew Morton
  Cc: vgoyal, ebiederm, mahesh, schwidefsky, heiko.carstens, kexec,
	linux-kernel, linux-s390, Andrew Morton

Hello Andrew,

On Tue, 2011-09-20 at 15:59 -0700, Andrew Morton wrote:
> On Tue, 20 Sep 2011 16:34:01 +0200

[snip]

> Michael Holzheu <holzheu@linux.vnet.ibm.com> wrote:
> > -void crash_save_vmcoreinfo(void)
> > +static void update_vmcoreinfo_note(void)
> >  {
> > -	u32 *buf;
> > +	u32 *buf = (u32 *) vmcoreinfo_note;
> 
> The cast is unneeded?

Correct. I removed the cast (with the blank :), thanks!

Michael


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

end of thread, other threads:[~2011-09-21  8:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-20 14:34 [patch 0/2] kdump: Initialize vmcoreinfo note at startup Michael Holzheu
2011-09-20 14:34 ` [patch 1/2] " Michael Holzheu
2011-09-20 22:59   ` Andrew Morton
2011-09-21  8:49     ` Michael Holzheu
2011-09-20 14:34 ` [patch 2/2] s390: Export vmcoreinfo note Michael Holzheu
2011-09-20 23:00 ` [patch 0/2] kdump: Initialize vmcoreinfo note at startup Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2011-09-09 10:26 Michael Holzheu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).