Hi, I followed xen-4.1.2/docs/misc/kexec_and_kdump.txt, but I cannot see "Crash kernel" in /dev/iomem. Is this a known issue? $ grep -E ''CONFIG_PROC_VMCORE|CONFIG_KEXEC|CONFIG_CRASH_DUMP'' linux-2.6.32.24/.config CONFIG_KEXEC=y CONFIG_CRASH_DUMP=y CONFIG_PROC_VMCORE=y /root # xm info host : kdump-testing release : 2.6.32.24-dom0 version : #1 SMP PREEMPT Fri Feb 10 14:46:15 PST 2012 machine : x86_64 nr_cpus : 4 nr_nodes : 1 cores_per_socket : 4 threads_per_core : 1 cpu_mhz : 2666 hw_caps : bfebfbff:28100800:00000000:00003b40:0098e3fd:00000000:00000001:00000000 virt_caps : hvm total_memory : 8151 free_memory : 6915 free_cpus : 0 xen_major : 4 xen_minor : 1 xen_extra : .2 xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 xen_scheduler : credit xen_pagesize : 4096 platform_params : virt_start=0xffff800000000000 xen_changeset : unavailable xen_commandline : BOOT_IMAGE=linux-2.6.32-dom0 ro loglvl=all guest_loglvl=all dom0_mem=1024M crashkernel=128M cc_compiler : collect2: ld returned 1 exit status cc_compile_by : eric cc_compile_domain : camachat cc_compile_date : Fri Feb 10 15:02:23 PST 2012 xend_config_format : 4 /root # xm info|grep commandline xen_commandline : BOOT_IMAGE=linux-2.6.32-dom0 ro loglvl=all guest_loglvl=all dom0_mem=1024M crashkernel=128M /root # xm dmesg|grep Kdump (XEN) Kdump: 128MB (131072kB) at 0x236dd0000 /root # cat /proc/cmdline noinitrd root=/dev/sda8 ro console=ttyS0,19200 /root # cat /proc/iomem 00000000-0000ffff : reserved 00010000-0009a3ff : System RAM 0009a400-000fffff : reserved 00100000-3fffffff : System RAM 01000000-01401a1f : Kernel code 01401a20-0163653f : Kernel data 016bc000-017309c3 : Kernel bss bd780000-bd78dfff : ACPI Tables bd78e000-bd7cffff : ACPI Non-volatile Storage bd7d0000-bd7dffff : reserved bd7ed000-bdffffff : reserved e0000000-efffffff : PCI MMCONFIG 0 [00-ff] e0000000-efffffff : pnp 00:0c fbec0000-fbedffff : 0000:00:19.0 fbec0000-fbedffff : e1000e fbef0000-fbef07ff : 0000:00:1f.2 fbef0000-fbef07ff : ahci fbef2000-fbef23ff : 0000:00:1d.0 fbef2000-fbef23ff : ehci_hcd fbef4000-fbef7fff : 0000:00:1b.0 fbef8000-fbef83ff : 0000:00:1a.0 fbef8000-fbef83ff : ehci_hcd fbefa000-fbefafff : 0000:00:19.0 fbefa000-fbefafff : e1000e fbefc000-fbefcfff : 0000:00:16.3 fbeff800-fbeff8ff : 0000:00:1f.3 fbeffc00-fbeffc0f : 0000:00:16.0 fbf00000-fbffffff : PCI Bus 0000:03 fbfdc000-fbfdffff : 0000:03:00.0 fbfdc000-fbfdffff : e1000e fbfe0000-fbffffff : 0000:03:00.0 fbfe0000-fbffffff : e1000e fc000000-fcffffff : pnp 00:01 fd000000-fdffffff : pnp 00:01 fe000000-febfffff : pnp 00:01 fec00000-fec00fff : IOAPIC 0 fec00000-fec00fff : reserved fed00000-fed003ff : HPET 0 fed14000-fed19fff : pnp 00:01 fed1c000-fed1ffff : pnp 00:08 fed20000-fed3ffff : pnp 00:08 fed40000-fed8ffff : pnp 00:08 fee00000-fee00fff : reserved fee00000-fee00fff : pnp 00:0a ffa00000-ffffffff : reserved
Hello, On Tuesday 14 February 2012 02:09:37 Eric Camachat wrote:> I followed xen-4.1.2/docs/misc/kexec_and_kdump.txt, but I cannot see > "Crash kernel" in /dev/iomem. > Is this a known issue?As far as I know crashdump only works with a non-pv-ops-dom0-kernels (2.6.18 or 2.6.26), but not with the newer pv-ops-som0-kernels. Thats the important information missing in all those documentations I read, including that file you mentioned above. Sincerely Philipp Hahn PS: See my "RFH: Xen crash behaviour Reboot → Stop?" mail from end of January. -- Philipp Hahn Open Source Software Engineer hahn@univention.de Univention GmbH Linux for Your Business fon: +49 421 22 232- 0 Mary-Somerville-Str.1 D-28359 Bremen fax: +49 421 22 232-99 http://www.univention.de/ _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Tue, Feb 14, 2012 at 12:07 AM, Philipp Hahn <hahn@univention.de> wrote:> Hello, > > On Tuesday 14 February 2012 02:09:37 Eric Camachat wrote: >> I followed xen-4.1.2/docs/misc/kexec_and_kdump.txt, but I cannot see >> "Crash kernel" in /dev/iomem. >> Is this a known issue? > > As far as I know crashdump only works with a non-pv-ops-dom0-kernels (2.6.18 > or 2.6.26), but not with the newer pv-ops-som0-kernels. Thats the important > information missing in all those documentations I read, including that file > you mentioned above. >Thanks for your information! It''s true, no where mentioned that even xen/docs. Eric
Eric Camachat
2012-Feb-16 01:22 UTC
Re: [Xen-users] crashkernel doesn''t work with linux-2.6.32-dom0
On Tue, Feb 14, 2012 at 10:07 AM, Eric Camachat <eric.camachat@gmail.com> wrote:> On Tue, Feb 14, 2012 at 12:07 AM, Philipp Hahn <hahn@univention.de> wrote: >> Hello, >> >> On Tuesday 14 February 2012 02:09:37 Eric Camachat wrote: >>> I followed xen-4.1.2/docs/misc/kexec_and_kdump.txt, but I cannot see >>> "Crash kernel" in /dev/iomem. >>> Is this a known issue? >> >> As far as I know crashdump only works with a non-pv-ops-dom0-kernels (2.6.18 >> or 2.6.26), but not with the newer pv-ops-som0-kernels. Thats the important >> information missing in all those documentations I read, including that file >> you mentioned above. >> > > Thanks for your information! > It's true, no where mentioned that even xen/docs. > > EricTry to use HYPERVISOR_kexec_op() to find out where crash buffer is. But it returned address that outside of total memory! Test bed: Xen-4.1.2, Linux-2.6.32.24, x86_64 Test result: found SMP MP-table at [ffff8800000ff780] ff780 Found 128MB of memory at 9069MB for crashkernel (System RAM: 7802MB) Found 1MB of memory at 3027MB of XEN hypervisor (NCPUS = 4/4). Found 0MB of vmcore at 3028MB of XEN hypervisor. Zone PFN ranges: My code: xen_kexec_range_t range; xen_platform_op_t op; struct resource *res; unsigned int k = 0, nr = 0; int rc; if (xen_start_info->flags & SIF_INITDOMAIN) { /* fill in crashk_res if range is reserved by hypervisor */ memset(&range, 0, sizeof(range)); range.range = KEXEC_RANGE_MA_CRASH; if (HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &range) || !range.size) { printk(KERN_INFO "No CRASH range!\n"); return; } crashk_res.start = range.start; crashk_res.end = range.start + range.size - 1; printk(KERN_INFO "Found %ldMB of memory at %ldMB " "for crashkernel (System RAM: %ldMB)\n", (unsigned long)(range.size >> 20), (unsigned long)(range.start >> 20), (unsigned long)(get_total_mem() >> 20)); _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Philipp Hahn
2012-Feb-16 07:29 UTC
Re: [Xen-users] crashkernel doesn''t work with linux-2.6.32-dom0
Hello, Am Donnerstag 16 Februar 2012 02:22:30 schrieben Sie:> On Tue, Feb 14, 2012 at 10:07 AM, Eric Camachat <eric.camachat@gmail.com>wrote:> > On Tue, Feb 14, 2012 at 12:07 AM, Philipp Hahn <hahn@univention.de> wrote: > Try to use HYPERVISOR_kexec_op() to find out where crash buffer is. > But it returned address that outside of total memory!Yes, because the Hyervisor (which is running below your dom0 Linux kernel) reserves the memory, so not even the dom0 kernel should be able to scribble it. That''s why you have to use the HYPERVIROS_OPs. I''ve spend some time investigating this a month ago but finally did gave up. Here''re some of my notes: - it should be possible to write a user-space tool (like kexec), which uses HYPERVISOR_kexec_op() to load a crash-dump kernel. - you would need to copy some code from the linux-kernel to fill in some data structures. - the Linux kernel prepends the crash kernel with some assembly code, which moves it to the final location on execution. This trampolin code would possibly be needed in your tool as well. The other option I see would be to modify the current Linux kernel to use HYPERVISOR_kexec_op() when used as a dom0 kernel. Sincerely Philipp -- Philipp Hahn Open Source Software Engineer hahn@univention.de Univention GmbH Linux for Your Business fon: +49 421 22 232- 0 Mary-Somerville-Str.1 D-28359 Bremen fax: +49 421 22 232-99 http://www.univention.de/ _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jan Beulich
2012-Feb-16 09:01 UTC
Re: [Xen-users] crashkernel doesn''t work with linux-2.6.32-dom0
>>> On 16.02.12 at 08:29, Philipp Hahn <hahn@univention.de> wrote: > Hello, > > Am Donnerstag 16 Februar 2012 02:22:30 schrieben Sie: >> On Tue, Feb 14, 2012 at 10:07 AM, Eric Camachat <eric.camachat@gmail.com> > wrote: >> > On Tue, Feb 14, 2012 at 12:07 AM, Philipp Hahn <hahn@univention.de> wrote: >> Try to use HYPERVISOR_kexec_op() to find out where crash buffer is. >> But it returned address that outside of total memory! > > Yes, because the Hyervisor (which is running below your dom0 Linux kernel) > reserves the memory, so not even the dom0 kernel should be able to scribble > it. That''s why you have to use the HYPERVIROS_OPs. > > I''ve spend some time investigating this a month ago but finally did gave up. > > Here''re some of my notes: > - it should be possible to write a user-space tool (like kexec), which uses > HYPERVISOR_kexec_op() to load a crash-dump kernel. > - you would need to copy some code from the linux-kernel to fill in some > data > structures. > - the Linux kernel prepends the crash kernel with some assembly code, which > moves it to the final location on execution. This trampolin code would > possibly be needed in your tool as well. > > The other option I see would be to modify the current Linux kernel to use > HYPERVISOR_kexec_op() when used as a dom0 kernel.You may want to get in touch with Daniel, who iirc started looking at adding kexec support to the pv-ops kernel some time last year. Jan
Daniel Kiper
2012-Feb-16 14:23 UTC
Re: [Xen-users] crashkernel doesn''t work with linux-2.6.32-dom0
On Thu, Feb 16, 2012 at 09:01:20AM +0000, Jan Beulich wrote:> >>> On 16.02.12 at 08:29, Philipp Hahn <hahn@univention.de> wrote: > > Hello, > > > > Am Donnerstag 16 Februar 2012 02:22:30 schrieben Sie: > >> On Tue, Feb 14, 2012 at 10:07 AM, Eric Camachat <eric.camachat@gmail.com> > > wrote: > >> > On Tue, Feb 14, 2012 at 12:07 AM, Philipp Hahn <hahn@univention.de> wrote: > >> Try to use HYPERVISOR_kexec_op() to find out where crash buffer is. > >> But it returned address that outside of total memory! > > > > Yes, because the Hyervisor (which is running below your dom0 Linux kernel) > > reserves the memory, so not even the dom0 kernel should be able to scribble > > it. That''s why you have to use the HYPERVIROS_OPs. > > > > I''ve spend some time investigating this a month ago but finally did gave up. > > > > Here''re some of my notes: > > - it should be possible to write a user-space tool (like kexec), which uses > > HYPERVISOR_kexec_op() to load a crash-dump kernel. > > - you would need to copy some code from the linux-kernel to fill in some > > data > > structures. > > - the Linux kernel prepends the crash kernel with some assembly code, which > > moves it to the final location on execution. This trampolin code would > > possibly be needed in your tool as well. > > > > The other option I see would be to modify the current Linux kernel to use > > HYPERVISOR_kexec_op() when used as a dom0 kernel. > > You may want to get in touch with Daniel, who iirc started looking at > adding kexec support to the pv-ops kernel some time last year.... and I still work on it. To be precise I have working kexec for domU PV guest running very ancient Linux Kernel Ver. 2.6.18 (it is not based on current 2.6.18 tree). I am starting work on kdump for domU. Work on kexec/kdump for dom0 is postponed until I finnish work on kexec/kdump for domU. After that I would like to prepare relevant patches for Xen, mainline Linux Kernel and kexec-tools and publish them as a complete solution for dom0 and domU (I am going to do that on March or April, however, ... You know...). I am not going to prepare support/backport for Linux Kernel Ver. 2.6.32 (or even 2.6.18), however, if it be required by quite large number of users I will think about that. Regarding kexec/kdump documentation please look into my presentation prepared for Xen Summit 2011 (http://xen.org/files/xensummit_santaclara11/aug3/7_DanielK_Kexec_KDump.pdf). I do not mention documentation which you could find in Linux Kernel source code. However, if you need some more explanation drop me a line. Daniel
Eric Camachat
2012-Feb-16 18:36 UTC
Re: [Xen-users] crashkernel doesn''t work with linux-2.6.32-dom0
On Thu, Feb 16, 2012 at 6:23 AM, Daniel Kiper <dkiper@net-space.pl> wrote:> On Thu, Feb 16, 2012 at 09:01:20AM +0000, Jan Beulich wrote: >> >>> On 16.02.12 at 08:29, Philipp Hahn <hahn@univention.de> wrote: >> > Hello, >> > >> > Am Donnerstag 16 Februar 2012 02:22:30 schrieben Sie: >> >> On Tue, Feb 14, 2012 at 10:07 AM, Eric Camachat <eric.camachat@gmail.com> >> > wrote: >> >> > On Tue, Feb 14, 2012 at 12:07 AM, Philipp Hahn <hahn@univention.de> wrote: >> >> Try to use HYPERVISOR_kexec_op() to find out where crash buffer is. >> >> But it returned address that outside of total memory! >> > >> > Yes, because the Hyervisor (which is running below your dom0 Linux kernel) >> > reserves the memory, so not even the dom0 kernel should be able to scribble >> > it. That's why you have to use the HYPERVIROS_OPs. >> > >> > I've spend some time investigating this a month ago but finally did gave up. >> > >> > Here're some of my notes: >> > - it should be possible to write a user-space tool (like kexec), which uses >> > HYPERVISOR_kexec_op() to load a crash-dump kernel. >> > - you would need to copy some code from the linux-kernel to fill in some >> > data >> > structures. >> > - the Linux kernel prepends the crash kernel with some assembly code, which >> > moves it to the final location on execution. This trampolin code would >> > possibly be needed in your tool as well. >> > >> > The other option I see would be to modify the current Linux kernel to use >> > HYPERVISOR_kexec_op() when used as a dom0 kernel. >> >> You may want to get in touch with Daniel, who iirc started looking at >> adding kexec support to the pv-ops kernel some time last year. > > ... and I still work on it. To be precise I have working kexec for > domU PV guest running very ancient Linux Kernel Ver. 2.6.18 (it is > not based on current 2.6.18 tree). I am starting work on kdump for domU. > Work on kexec/kdump for dom0 is postponed until I finnish work on > kexec/kdump for domU. After that I would like to prepare relevant patches > for Xen, mainline Linux Kernel and kexec-tools and publish them as a complete > solution for dom0 and domU (I am going to do that on March or April, > however, ... You know...). I am not going to prepare support/backport for > Linux Kernel Ver. 2.6.32 (or even 2.6.18), however, if it be required > by quite large number of users I will think about that. > > Regarding kexec/kdump documentation please look into my presentation > prepared for Xen Summit 2011 (http://xen.org/files/xensummit_santaclara11/aug3/7_DanielK_Kexec_KDump.pdf). > I do not mention documentation which you could find in Linux Kernel source > code. However, if you need some more explanation drop me a line. > > DanielAt beginning, I though there are some hypervisor calls to find out the crash buffer, put image into it, excute it. But it seems not. I have to study kexec/kdump in both linux and xen to figure out how to support kdump. Thank you guys. Eric _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Daniel Kiper
2012-Feb-16 20:16 UTC
Re: [Xen-users] crashkernel doesn''t work with linux-2.6.32-dom0
On Thu, Feb 16, 2012 at 10:36:14AM -0800, Eric Camachat wrote: [...]> At beginning, I though there are some hypervisor calls to find out the > crash buffer, put image into it, excute it. But it seems not. > I have to study kexec/kdump in both linux and xen to figure out how to > support kdump.HYPERVISOR_kexec_op() hypercall is used in dom0 only (more or less for things you mentioned). Look into include/xen/interface/kexec.h in Xen Linux Kernel Ver. 2.6.18 for details. kexec/kdump for domU does not use that hypercall. Daniel