Skip to contentSkip to conversation

xen,kdump: handle pv domain in paddr_vmcoreinfo_note()

PATCH Superseded Juergen Gross 5 participants 19 messages Mar 31, 2017 – Apr 15, 2017

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Juergen Gross

author maintainer
#0 lore raw

PATCH v2 1/1 xen,kdump: handle pv domain in paddr_vmcoreinfo_note()

For kdump to work correctly it needs the physical address of vmcoreinfo_note. When running as dom0 this means the virtual address has to be translated to the related machine address.

paddr_vmcoreinfo_note() is meant to do the translation via __pa_symbol() only, but being attributed "weak" it can be replaced easily in Xen case.

---
Changes in V2:
- use __pa_symbol() (Boris Ostrovsky)
- remove unneeded casts (Jan Beulich)

This patch needs to be rebased on top of Vitaly's series to split pv- and hvm-code. I'll do this as soon as his series is in the Xen tree in its final form.

---
 arch/x86/xen/mmu.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/x86/xen/mmu.c +13 -0
index 37cb5aa..33ab96c 100644
@@ -49,6 +49,9 @@
 #include <linux/memblock.h>
 #include <linux/seq_file.h>
 #include <linux/crash_dump.h>
+#ifdef CONFIG_KEXEC_CORE
+#include <linux/kexec.h>
+#endif
 
 #include <trace/events/xen.h>
 
@@ -2903,3 +2906,13 @@ int xen_unmap_domain_gfn_range(struct vm_area_struct *vma,
 	return -EINVAL;
 }
 EXPORT_SYMBOL_GPL(xen_unmap_domain_gfn_range);
+
+#ifdef CONFIG_KEXEC_CORE
+phys_addr_t paddr_vmcoreinfo_note(void)
+{
+	if (xen_pv_domain())
+		return virt_to_machine(&vmcoreinfo_note).maddr;
+	else
+		return __pa_symbol(&vmcoreinfo_note);
+}
+#endif /* CONFIG_KEXEC_CORE */
Signature · 1 line
2.10.2
reviewer Reviewed-by on v2 1/1
#1 lore raw
Quoted 9 lines · Juergen Gross

For kdump to work correctly it needs the physical address of vmcoreinfo_note. When running as dom0 this means the virtual address has to be translated to the related machine address.

paddr_vmcoreinfo_note() is meant to do the translation via __pa_symbol() only, but being attributed "weak" it can be replaced easily in Xen case.

Similar to Jan's concern, if bare-metal x86 people decide to have their own paddr_vmcoreinfo_note() (and they usually build with !CONFIG_XEN) we will have to update this again. I suppose we can deal with that if/when it happens since we will discover this immediately.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Reviewed-by on v2 1/1
#2 lore raw

Re: [Xen-devel] [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

In reply to Juergen Gross
Quoted 9 lines · Juergen Gross

For kdump to work correctly it needs the physical address of vmcoreinfo_note. When running as dom0 this means the virtual address has to be translated to the related machine address.

paddr_vmcoreinfo_note() is meant to do the translation via __pa_symbol() only, but being attributed "weak" it can be replaced easily in Xen case.

Have you tested this patch with latest crash tool? Do dom0 and Xen hypervisor analysis work without any issue (at least basic commands like dmesg, bt, ps, etc.)? If yes for both you can add:

Daniel

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

author maintainer
#3 lore raw

Re: [Xen-devel] [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

Quoted 9 lines · Daniel Kiper
Quoted 8 lines · Juergen Gross

For kdump to work correctly it needs the physical address of vmcoreinfo_note. When running as dom0 this means the virtual address has to be translated to the related machine address.

paddr_vmcoreinfo_note() is meant to do the translation via __pa_symbol() only, but being attributed "weak" it can be replaced easily in Xen case.

Quoted 7 lines
Quoted 1 line

Have you tested this patch with latest crash tool? Do dom0 and Xen hypervisor analysis work without any issue (at least basic commands like dmesg, bt, ps, etc.)? If yes for both you can add:

This patch isn't for dump analysis, but for dump creation. Petr has verified that the dump is in the expected format. Please ask Petr for further details, e.g. user side modifications being necessary.

Juergen

author maintainer
#4 lore raw

Re: [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

In reply to Daniel Kiper
Quoted 9 lines · Daniel Kiper
Quoted 8 lines · Juergen Gross

For kdump to work correctly it needs the physical address of vmcoreinfo_note. When running as dom0 this means the virtual address has to be translated to the related machine address.

paddr_vmcoreinfo_note() is meant to do the translation via __pa_symbol() only, but being attributed "weak" it can be replaced easily in Xen case.

Quoted 7 lines
Quoted 1 line

Have you tested this patch with latest crash tool? Do dom0 and Xen hypervisor analysis work without any issue (at least basic commands like dmesg, bt, ps, etc.)? If yes for both you can add:

This patch isn't for dump analysis, but for dump creation. Petr has verified that the dump is in the expected format. Please ask Petr for further details, e.g. user side modifications being necessary.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

author maintainer
#5 lore raw

Re: [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

In reply to Daniel Kiper
Quoted 9 lines · Daniel Kiper
Quoted 8 lines · Juergen Gross

For kdump to work correctly it needs the physical address of vmcoreinfo_note. When running as dom0 this means the virtual address has to be translated to the related machine address.

paddr_vmcoreinfo_note() is meant to do the translation via __pa_symbol() only, but being attributed "weak" it can be replaced easily in Xen case.

Quoted 7 lines
Quoted 1 line

Have you tested this patch with latest crash tool? Do dom0 and Xen hypervisor analysis work without any issue (at least basic commands like dmesg, bt, ps, etc.)? If yes for both you can add:

So can I add your R-b: now?

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

author maintainer
#6 lore raw

Re: [Xen-devel] [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

In reply to Daniel Kiper
Quoted 9 lines · Daniel Kiper
Quoted 8 lines · Juergen Gross

For kdump to work correctly it needs the physical address of vmcoreinfo_note. When running as dom0 this means the virtual address has to be translated to the related machine address.

paddr_vmcoreinfo_note() is meant to do the translation via __pa_symbol() only, but being attributed "weak" it can be replaced easily in Xen case.

Quoted 7 lines
Quoted 1 line

Have you tested this patch with latest crash tool? Do dom0 and Xen hypervisor analysis work without any issue (at least basic commands like dmesg, bt, ps, etc.)? If yes for both you can add:

So can I add your R-b: now?

Juergen

#7 lore raw

Re: [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

Quoted 12 lines · Juergen Gross
Quoted 11 lines · Daniel Kiper
Quoted 9 lines · Juergen Gross

For kdump to work correctly it needs the physical address of vmcoreinfo_note. When running as dom0 this means the virtual address has to be translated to the related machine address.

paddr_vmcoreinfo_note() is meant to do the translation via __pa_symbol() only, but being attributed "weak" it can be replaced easily in Xen case.

Quoted 7 lines
Quoted 5 lines

Have you tested this patch with latest crash tool? Do dom0 and Xen hypervisor analysis work without any issue (at least basic commands like dmesg, bt, ps, etc.)? If yes for both you can add:

So can I add your R-b: now?

My R-b is still valid. Though, let's wait for Petr's Tested-by. He did makedumpfile tests but I asked him to do crash tool tests too. I think it is important.

Daniel

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#8 lore raw

Re: [Xen-devel] [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

In reply to Juergen Gross
Quoted 12 lines · Juergen Gross
Quoted 11 lines · Daniel Kiper
Quoted 9 lines · Juergen Gross

For kdump to work correctly it needs the physical address of vmcoreinfo_note. When running as dom0 this means the virtual address has to be translated to the related machine address.

paddr_vmcoreinfo_note() is meant to do the translation via __pa_symbol() only, but being attributed "weak" it can be replaced easily in Xen case.

Quoted 7 lines
Quoted 5 lines

Have you tested this patch with latest crash tool? Do dom0 and Xen hypervisor analysis work without any issue (at least basic commands like dmesg, bt, ps, etc.)? If yes for both you can add:

So can I add your R-b: now?

My R-b is still valid. Though, let's wait for Petr's Tested-by. He did makedumpfile tests but I asked him to do crash tool tests too. I think it is important.

Daniel

Tested-by
#9 lore raw

Re: [Xen-devel] [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

Quoted 17 lines · On Tue, 11 Apr 2017 15:00:58 +0200 Daniel Kiper <[email protected]> wrote:
Quoted 16 lines · Juergen Gross
Quoted 15 lines · Daniel Kiper
Quoted 9 lines · Juergen Gross

For kdump to work correctly it needs the physical address of vmcoreinfo_note. When running as dom0 this means the virtual address has to be translated to the related machine address.

paddr_vmcoreinfo_note() is meant to do the translation via __pa_symbol() only, but being attributed "weak" it can be replaced easily in Xen case.

Have you tested this patch with latest crash tool? Do dom0 and Xen hypervisor analysis work without any issue (at least basic commands like dmesg, bt, ps, etc.)? If yes for both you can add:

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

So can I add your R-b: now?

My R-b is still valid. Though, let's wait for Petr's Tested-by. He did makedumpfile tests but I asked him to do crash tool tests too. I think it is important.

I copied the complete /proc/vmcore to a directory on disk. Exactly as expected, crash works both without the patch and with the patch, as it does not use VMCOREINFO at all (instead, crash obtains the information from kernel debuginfo directly).

Without the patch:

morricone:/abuild/dumps/2017-04-11-16:38/:[0]# crash vmlinux vmcore 

crash 7.1.8
Copyright (C) 2002-2016 Red Hat, Inc.
Copyright (C) 2004, 2005, 2006, 2010 IBM Corporation
Copyright (C) 1999-2006 Hewlett-Packard Co
Copyright (C) 2005, 2006, 2011, 2012 Fujitsu Limited
Copyright (C) 2006, 2007 VA Linux Systems Japan K.K.
Copyright (C) 2005, 2011 NEC Corporation
Copyright (C) 1999, 2002, 2007 Silicon Graphics, Inc.
Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc. This program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Enter "help copying" to see the conditions. This program has absolutely no warranty. Enter "help warranty" for details.

crash: vmlinux: no .gnu_debuglink section
GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu"...

      KERNEL: vmlinux                           
    DUMPFILE: vmcore
        CPUS: 12 [OFFLINE: 11]
        DATE: Tue Apr 11 16:37:34 2017
      UPTIME: 00:11:51
LOAD AVERAGE: 0.04, 0.08, 0.08
       TASKS: 269
    NODENAME: morricone
     RELEASE: 4.11.0-rc5-default-pt+
     VERSION: #1 SMP PREEMPT Thu Apr 6 17:40:53 CEST 2017
     MACHINE: x86_64  (2400 Mhz)
      MEMORY: 16 GB
       PANIC: "sysrq: SysRq : Trigger a crash"
         PID: 12009
     COMMAND: "bash"
        TASK: ffff8804065d2080  [THREAD_INFO: ffff8804065d2080]
         CPU: 7
       STATE: TASK_RUNNING (SYSRQ)

crash>

With the patch included:

morricone:/abuild/dumps/2017-04-11-12:52/:[0]# crash vmlinux vmcore  

crash 7.1.8
Copyright (C) 2002-2016 Red Hat, Inc.
Copyright (C) 2004, 2005, 2006, 2010 IBM Corporation
Copyright (C) 1999-2006 Hewlett-Packard Co
Copyright (C) 2005, 2006, 2011, 2012 Fujitsu Limited
Copyright (C) 2006, 2007 VA Linux Systems Japan K.K.
Copyright (C) 2005, 2011 NEC Corporation
Copyright (C) 1999, 2002, 2007 Silicon Graphics, Inc.
Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc. This program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Enter "help copying" to see the conditions. This program has absolutely no warranty. Enter "help warranty" for details.

crash: vmlinux: no .gnu_debuglink section
GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu"...

      KERNEL: vmlinux                           
    DUMPFILE: vmcore
        CPUS: 12 [OFFLINE: 11]
        DATE: Tue Apr 11 12:51:15 2017
      UPTIME: 4 days, 01:31:42
LOAD AVERAGE: 0.04, 0.01, 0.00
       TASKS: 634
    NODENAME: morricone
     RELEASE: 4.11.0-rc5-default-pt+
     VERSION: #2 SMP PREEMPT Fri Apr 7 09:34:10 CEST 2017
     MACHINE: x86_64  (2400 Mhz)
      MEMORY: 16 GB
       PANIC: "sysrq: SysRq : Trigger a crash"
         PID: 19503
     COMMAND: "bash"
        TASK: ffff8803367762c0  [THREAD_INFO: ffff8803367762c0]
         CPU: 3
       STATE: TASK_RUNNING (SYSRQ)

crash>

Petr T

#10 lore raw

Re: [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

Quoted 28 lines · Petr Tesarik
Quoted 17 lines · On Tue, 11 Apr 2017 15:00:58 +0200 Daniel Kiper <[email protected]> wrote:
Quoted 16 lines · Juergen Gross
Quoted 15 lines · Daniel Kiper
Quoted 9 lines · Juergen Gross

For kdump to work correctly it needs the physical address of vmcoreinfo_note. When running as dom0 this means the virtual address has to be translated to the related machine address.

paddr_vmcoreinfo_note() is meant to do the translation via __pa_symbol() only, but being attributed "weak" it can be replaced easily in Xen case.

Have you tested this patch with latest crash tool? Do dom0 and Xen hypervisor analysis work without any issue (at least basic commands like dmesg, bt, ps, etc.)? If yes for both you can add:

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

So can I add your R-b: now?

My R-b is still valid. Though, let's wait for Petr's Tested-by. He did makedumpfile tests but I asked him to do crash tool tests too. I think it is important.

Quoted 6 lines

I copied the complete /proc/vmcore to a directory on disk. Exactly as expected, crash works both without the patch and with the patch, as it does not use VMCOREINFO at all (instead, crash obtains the information from kernel debuginfo directly).

Thanks for doing the tests. I suppose that you have tested HVM guests. IIRC, PV guests are not supported by crash right now due to p2m VMA mapping. At least it was an issue some time ago. Is it still valid? Anyway, one guy in Oracle works on fix for that issue and I do review. We are going to post it in 2-3 weeks.

Juergen, I do not have any objections any longer. You can go ahead. Ahhh... I see. You have posted v3. Good!

Daniel

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#11 lore raw

Re: [Xen-devel] [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

In reply to Petr Tesarik
Quoted 28 lines · Petr Tesarik
Quoted 17 lines · On Tue, 11 Apr 2017 15:00:58 +0200 Daniel Kiper <[email protected]> wrote:
Quoted 16 lines · Juergen Gross
Quoted 15 lines · Daniel Kiper
Quoted 9 lines · Juergen Gross

For kdump to work correctly it needs the physical address of vmcoreinfo_note. When running as dom0 this means the virtual address has to be translated to the related machine address.

paddr_vmcoreinfo_note() is meant to do the translation via __pa_symbol() only, but being attributed "weak" it can be replaced easily in Xen case.

Have you tested this patch with latest crash tool? Do dom0 and Xen hypervisor analysis work without any issue (at least basic commands like dmesg, bt, ps, etc.)? If yes for both you can add:

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

So can I add your R-b: now?

My R-b is still valid. Though, let's wait for Petr's Tested-by. He did makedumpfile tests but I asked him to do crash tool tests too. I think it is important.

Quoted 6 lines

I copied the complete /proc/vmcore to a directory on disk. Exactly as expected, crash works both without the patch and with the patch, as it does not use VMCOREINFO at all (instead, crash obtains the information from kernel debuginfo directly).

Thanks for doing the tests. I suppose that you have tested HVM guests. IIRC, PV guests are not supported by crash right now due to p2m VMA mapping. At least it was an issue some time ago. Is it still valid? Anyway, one guy in Oracle works on fix for that issue and I do review. We are going to post it in 2-3 weeks.

Juergen, I do not have any objections any longer. You can go ahead. Ahhh... I see. You have posted v3. Good!

Daniel

#12 lore raw

Re: [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

Quoted 10 lines · On Tue, 11 Apr 2017 19:20:08 +0200 Daniel Kiper <[email protected]> wrote:

On Tue, Apr 11, 2017 at 04:59:16PM +0200, Petr Tesarik wrote:
[...]

Quoted 6 lines

I copied the complete /proc/vmcore to a directory on disk. Exactly as expected, crash works both without the patch and with the patch, as it does not use VMCOREINFO at all (instead, crash obtains the information from kernel debuginfo directly).

Thanks for doing the tests. I suppose that you have tested HVM guests.

Not really. I crashed Dom0, which is in turn sent to the hypervisor, so the result is a complete host dump, including Xen hypervisor data and all domains.

Quoted 2 lines

IIRC, PV guests are not supported by crash right now due to p2m VMA mapping. At least it was an issue some time ago. Is it still valid?

Yes, this is correct. I tested this behaviour a few weeks ago.

Quoted 2 lines

Anyway, one guy in Oracle works on fix for that issue and I do review. We are going to post it in 2-3 weeks.

All right. FYI I do not plan to put much effort into it, as my focus has shifted towards libkdumpfile (https://github.com/ptesarik/libkdumpfile),
and this library can open PV guest dump files without any issues.

Petr T

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#13 lore raw

Re: [Xen-devel] [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

In reply to Daniel Kiper
Quoted 10 lines · On Tue, 11 Apr 2017 19:20:08 +0200 Daniel Kiper <[email protected]> wrote:

On Tue, Apr 11, 2017 at 04:59:16PM +0200, Petr Tesarik wrote:
[...]

Quoted 6 lines

I copied the complete /proc/vmcore to a directory on disk. Exactly as expected, crash works both without the patch and with the patch, as it does not use VMCOREINFO at all (instead, crash obtains the information from kernel debuginfo directly).

Thanks for doing the tests. I suppose that you have tested HVM guests.

Not really. I crashed Dom0, which is in turn sent to the hypervisor, so the result is a complete host dump, including Xen hypervisor data and all domains.

Quoted 2 lines

IIRC, PV guests are not supported by crash right now due to p2m VMA mapping. At least it was an issue some time ago. Is it still valid?

Yes, this is correct. I tested this behaviour a few weeks ago.

Quoted 2 lines

Anyway, one guy in Oracle works on fix for that issue and I do review. We are going to post it in 2-3 weeks.

All right. FYI I do not plan to put much effort into it, as my focus has shifted towards libkdumpfile (https://github.com/ptesarik/libkdumpfile),
and this library can open PV guest dump files without any issues.

Petr T

#14 lore raw

Re: [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

Quoted 11 lines · Petr Tesarik
Quoted 9 lines · On Tue, 11 Apr 2017 19:20:08 +0200 Daniel Kiper <[email protected]> wrote:

On Tue, Apr 11, 2017 at 04:59:16PM +0200, Petr Tesarik wrote:
[...]

Quoted 6 lines

I copied the complete /proc/vmcore to a directory on disk. Exactly as expected, crash works both without the patch and with the patch, as it does not use VMCOREINFO at all (instead, crash obtains the information from kernel debuginfo directly).

Quoted 5 lines
Quoted 1 line

Thanks for doing the tests. I suppose that you have tested HVM guests.

Not really. I crashed Dom0, which is in turn sent to the hypervisor, so the result is a complete host dump, including Xen hypervisor data and all domains.

OK.

Quoted 4 lines
Quoted 2 lines

IIRC, PV guests are not supported by crash right now due to p2m VMA mapping. At least it was an issue some time ago. Is it still valid?

Yes, this is correct. I tested this behaviour a few weeks ago.

Thanks for update.

Quoted 4 lines
Quoted 2 lines

Anyway, one guy in Oracle works on fix for that issue and I do review. We are going to post it in 2-3 weeks.

All right. FYI I do not plan to put much effort into it, as my focus has

OK.

Quoted 2 lines

shifted towards libkdumpfile (https://github.com/ptesarik/libkdumpfile),
and this library can open PV guest dump files without any issues.

Great! AIUI, it reminds my idea to make such think. However, I have not have time to make it happen. Is it based on makedumpfile or written from scratch? Do you plan support for Linux kernel dumps and/or Xen ones?

Daniel

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#15 lore raw

Re: [Xen-devel] [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

In reply to Petr Tesarik
Quoted 11 lines · Petr Tesarik
Quoted 9 lines · On Tue, 11 Apr 2017 19:20:08 +0200 Daniel Kiper <[email protected]> wrote:

On Tue, Apr 11, 2017 at 04:59:16PM +0200, Petr Tesarik wrote:
[...]

Quoted 6 lines

I copied the complete /proc/vmcore to a directory on disk. Exactly as expected, crash works both without the patch and with the patch, as it does not use VMCOREINFO at all (instead, crash obtains the information from kernel debuginfo directly).

Quoted 5 lines
Quoted 1 line

Thanks for doing the tests. I suppose that you have tested HVM guests.

Not really. I crashed Dom0, which is in turn sent to the hypervisor, so the result is a complete host dump, including Xen hypervisor data and all domains.

OK.

Quoted 4 lines
Quoted 2 lines

IIRC, PV guests are not supported by crash right now due to p2m VMA mapping. At least it was an issue some time ago. Is it still valid?

Yes, this is correct. I tested this behaviour a few weeks ago.

Thanks for update.

Quoted 4 lines
Quoted 2 lines

Anyway, one guy in Oracle works on fix for that issue and I do review. We are going to post it in 2-3 weeks.

All right. FYI I do not plan to put much effort into it, as my focus has

OK.

Quoted 2 lines

shifted towards libkdumpfile (https://github.com/ptesarik/libkdumpfile),
and this library can open PV guest dump files without any issues.

Great! AIUI, it reminds my idea to make such think. However, I have not have time to make it happen. Is it based on makedumpfile or written from scratch? Do you plan support for Linux kernel dumps and/or Xen ones?

Daniel

#16 lore raw

Re: [Xen-devel] [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

Quoted 8 lines · On Sat, 15 Apr 2017 00:26:05 +0200 Daniel Kiper <[email protected]> wrote:

On Fri, Apr 14, 2017 at 06:53:36PM +0200, Petr Tesarik wrote:
[...]

Quoted 2 lines

shifted towards libkdumpfile (https://github.com/ptesarik/libkdumpfile),
and this library can open PV guest dump files without any issues.

Great! AIUI, it reminds my idea to make such think. However, I have not have time to make it happen. Is it based on makedumpfile or written from scratch? Do you plan support for Linux kernel dumps and/or Xen ones?

Some ideas are borrowed from existing tools (makedumpfile, crash). All code is written from scratch, however.

The kdumpfile library itself is designed for use with any platform and operating system. Xen is treated as just another type of operating system. Based on which OS type is initialized, the library is able to provide a hypervisor view or a Dom0 view.

There is another project led by Jeff Mahoney, which extends standard gdb with semantic commands. This project supports only x86_64 Linux right now. See https://github.com/jeffmahoney/crash-python.

Petr T

#17 lore raw

Re: [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

In reply to Daniel Kiper
Quoted 8 lines · On Sat, 15 Apr 2017 00:26:05 +0200 Daniel Kiper <[email protected]> wrote:

On Fri, Apr 14, 2017 at 06:53:36PM +0200, Petr Tesarik wrote:
[...]

Quoted 2 lines

shifted towards libkdumpfile (https://github.com/ptesarik/libkdumpfile),
and this library can open PV guest dump files without any issues.

Great! AIUI, it reminds my idea to make such think. However, I have not have time to make it happen. Is it based on makedumpfile or written from scratch? Do you plan support for Linux kernel dumps and/or Xen ones?

Some ideas are borrowed from existing tools (makedumpfile, crash). All code is written from scratch, however.

The kdumpfile library itself is designed for use with any platform and operating system. Xen is treated as just another type of operating system. Based on which OS type is initialized, the library is able to provide a hypervisor view or a Dom0 view.

There is another project led by Jeff Mahoney, which extends standard gdb with semantic commands. This project supports only x86_64 Linux right now. See https://github.com/jeffmahoney/crash-python.

Petr T

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Tested-by
#18 lore raw

Re: [PATCH v2] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()

In reply to Daniel Kiper
Quoted 17 lines · On Tue, 11 Apr 2017 15:00:58 +0200 Daniel Kiper <[email protected]> wrote:
Quoted 16 lines · Juergen Gross
Quoted 15 lines · Daniel Kiper
Quoted 9 lines · Juergen Gross

For kdump to work correctly it needs the physical address of vmcoreinfo_note. When running as dom0 this means the virtual address has to be translated to the related machine address.

paddr_vmcoreinfo_note() is meant to do the translation via __pa_symbol() only, but being attributed "weak" it can be replaced easily in Xen case.

Have you tested this patch with latest crash tool? Do dom0 and Xen hypervisor analysis work without any issue (at least basic commands like dmesg, bt, ps, etc.)? If yes for both you can add:

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

So can I add your R-b: now?

My R-b is still valid. Though, let's wait for Petr's Tested-by. He did makedumpfile tests but I asked him to do crash tool tests too. I think it is important.

I copied the complete /proc/vmcore to a directory on disk. Exactly as expected, crash works both without the patch and with the patch, as it does not use VMCOREINFO at all (instead, crash obtains the information from kernel debuginfo directly).

Without the patch:

morricone:/abuild/dumps/2017-04-11-16:38/:[0]# crash vmlinux vmcore 

crash 7.1.8
Copyright (C) 2002-2016 Red Hat, Inc.
Copyright (C) 2004, 2005, 2006, 2010 IBM Corporation
Copyright (C) 1999-2006 Hewlett-Packard Co
Copyright (C) 2005, 2006, 2011, 2012 Fujitsu Limited
Copyright (C) 2006, 2007 VA Linux Systems Japan K.K.
Copyright (C) 2005, 2011 NEC Corporation
Copyright (C) 1999, 2002, 2007 Silicon Graphics, Inc.
Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc. This program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Enter "help copying" to see the conditions. This program has absolutely no warranty. Enter "help warranty" for details.

crash: vmlinux: no .gnu_debuglink section
GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu"...

      KERNEL: vmlinux                           
    DUMPFILE: vmcore
        CPUS: 12 [OFFLINE: 11]
        DATE: Tue Apr 11 16:37:34 2017
      UPTIME: 00:11:51
LOAD AVERAGE: 0.04, 0.08, 0.08
       TASKS: 269
    NODENAME: morricone
     RELEASE: 4.11.0-rc5-default-pt+
     VERSION: #1 SMP PREEMPT Thu Apr 6 17:40:53 CEST 2017
     MACHINE: x86_64  (2400 Mhz)
      MEMORY: 16 GB
       PANIC: "sysrq: SysRq : Trigger a crash"
         PID: 12009
     COMMAND: "bash"
        TASK: ffff8804065d2080  [THREAD_INFO: ffff8804065d2080]
         CPU: 7
       STATE: TASK_RUNNING (SYSRQ)

crash>

With the patch included:

morricone:/abuild/dumps/2017-04-11-12:52/:[0]# crash vmlinux vmcore  

crash 7.1.8
Copyright (C) 2002-2016 Red Hat, Inc.
Copyright (C) 2004, 2005, 2006, 2010 IBM Corporation
Copyright (C) 1999-2006 Hewlett-Packard Co
Copyright (C) 2005, 2006, 2011, 2012 Fujitsu Limited
Copyright (C) 2006, 2007 VA Linux Systems Japan K.K.
Copyright (C) 2005, 2011 NEC Corporation
Copyright (C) 1999, 2002, 2007 Silicon Graphics, Inc.
Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc. This program is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Enter "help copying" to see the conditions. This program has absolutely no warranty. Enter "help warranty" for details.

crash: vmlinux: no .gnu_debuglink section
GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu"...

      KERNEL: vmlinux                           
    DUMPFILE: vmcore
        CPUS: 12 [OFFLINE: 11]
        DATE: Tue Apr 11 12:51:15 2017
      UPTIME: 4 days, 01:31:42
LOAD AVERAGE: 0.04, 0.01, 0.00
       TASKS: 634
    NODENAME: morricone
     RELEASE: 4.11.0-rc5-default-pt+
     VERSION: #2 SMP PREEMPT Fri Apr 7 09:34:10 CEST 2017
     MACHINE: x86_64  (2400 Mhz)
      MEMORY: 16 GB
       PANIC: "sysrq: SysRq : Trigger a crash"
         PID: 19503
     COMMAND: "bash"
        TASK: ffff8803367762c0  [THREAD_INFO: ffff8803367762c0]
         CPU: 3
       STATE: TASK_RUNNING (SYSRQ)

crash>

Petr T

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel