All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Xen-users] crashkernel doesn't work with linux-2.6.32-dom0
       [not found]   ` <CACeEFf5AXELd+C701RG1X7iRAgoyansFjd4oJSDXMnqPjNq9Vw@mail.gmail.com>
@ 2012-02-16  1:22     ` Eric Camachat
  2012-02-16  7:29       ` Philipp Hahn
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Camachat @ 2012-02-16  1:22 UTC (permalink / raw)
  To: Philipp Hahn, xen-users; +Cc: xen-devel

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.
>
> Eric

Try 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

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

* Re: [Xen-users] crashkernel doesn't work with linux-2.6.32-dom0
  2012-02-16  1:22     ` [Xen-users] crashkernel doesn't work with linux-2.6.32-dom0 Eric Camachat
@ 2012-02-16  7:29       ` Philipp Hahn
  2012-02-16  9:01         ` Jan Beulich
  0 siblings, 1 reply; 6+ messages in thread
From: Philipp Hahn @ 2012-02-16  7:29 UTC (permalink / raw)
  To: Eric Camachat, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1561 bytes --]

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/

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

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

* Re: [Xen-users] crashkernel doesn't work with linux-2.6.32-dom0
  2012-02-16  7:29       ` Philipp Hahn
@ 2012-02-16  9:01         ` Jan Beulich
  2012-02-16 14:23           ` Daniel Kiper
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Beulich @ 2012-02-16  9:01 UTC (permalink / raw)
  To: Eric Camachat, Philipp Hahn; +Cc: xen-devel, Daniel Kiper

>>> 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

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

* Re: [Xen-users] crashkernel doesn't work with linux-2.6.32-dom0
  2012-02-16  9:01         ` Jan Beulich
@ 2012-02-16 14:23           ` Daniel Kiper
  2012-02-16 18:36             ` Eric Camachat
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Kiper @ 2012-02-16 14:23 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Eric Camachat, Daniel Kiper, Philipp Hahn

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

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

* Re: [Xen-users] crashkernel doesn't work with linux-2.6.32-dom0
  2012-02-16 14:23           ` Daniel Kiper
@ 2012-02-16 18:36             ` Eric Camachat
  2012-02-16 20:16               ` Daniel Kiper
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Camachat @ 2012-02-16 18:36 UTC (permalink / raw)
  To: Daniel Kiper; +Cc: xen-devel, Jan Beulich, Philipp Hahn

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.
>
> Daniel

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.

Thank you guys.

Eric

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

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

* Re: [Xen-users] crashkernel doesn't work with linux-2.6.32-dom0
  2012-02-16 18:36             ` Eric Camachat
@ 2012-02-16 20:16               ` Daniel Kiper
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Kiper @ 2012-02-16 20:16 UTC (permalink / raw)
  To: Eric Camachat; +Cc: xen-devel, Jan Beulich, Daniel Kiper, Philipp Hahn

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

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

end of thread, other threads:[~2012-02-16 20:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CACeEFf4c0MFWtoN8StcMS3cg0=6yd3ZuVZCynAjd5D0OqmvsSQ@mail.gmail.com>
     [not found] ` <201202140907.44528.hahn@univention.de>
     [not found]   ` <CACeEFf5AXELd+C701RG1X7iRAgoyansFjd4oJSDXMnqPjNq9Vw@mail.gmail.com>
2012-02-16  1:22     ` [Xen-users] crashkernel doesn't work with linux-2.6.32-dom0 Eric Camachat
2012-02-16  7:29       ` Philipp Hahn
2012-02-16  9:01         ` Jan Beulich
2012-02-16 14:23           ` Daniel Kiper
2012-02-16 18:36             ` Eric Camachat
2012-02-16 20:16               ` Daniel Kiper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.