All of lore.kernel.org
 help / color / mirror / Atom feed
From: takahiro.akashi@linaro.org (AKASHI Takahiro)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v26 0/7] arm64: add kdump support
Date: Wed, 5 Oct 2016 14:41:12 +0900	[thread overview]
Message-ID: <20161005054111.GA19531@linaro.org> (raw)
In-Reply-To: <57F37A73.3030105@arm.com>

On Tue, Oct 04, 2016 at 10:46:27AM +0100, James Morse wrote:
> Hi Manish,
> 
> On 03/10/16 13:41, Manish Jaggi wrote:
> > On 10/03/2016 04:34 PM, AKASHI Takahiro wrote:
> >> On Mon, Oct 03, 2016 at 01:24:34PM +0530, Manish Jaggi wrote:
> >>> With the v26 kdump and v3 kexec-tools and top of tree crash.git, below are the tests done
> >>> Attached is a patch in crash.git (symbols.c) to make crash utility work on my setup.
> >>> Can you please have a look and provide your comments.
> >>>
> >>> To generate a panic, i have a kernel module which on init calls panic.
> 
> ... modules ... I haven't tested that. I bet it causes some problems!
> We probably need to include module_alloc_base as an elf note in the vmcore file...

No, I don't think so :)
I created some test module as Manish implied and tested kdump:
(My kernel here even enables KASLR.)
===8<===
$ crash vmlinux vmcore
...
please wait... (gathering module symbol data)
...
crash> mod -S
     MODULE       NAME      SIZE  OBJECT FILE
ffff04d78f4b8000  testmod  16384  /opt/buildroot/15.11_64/root/kexec/testmod.ko 
crash> bt
PID: 1102   TASK: ffffb4da8e910000  CPU: 0   COMMAND: "insmod"
 #0 [ffffb4da8e9afa30] __crash_kexec at ffff0e0045020a54
 #1 [ffffb4da8e9afb90] panic at ffff0e004505523c
 #2 [ffffb4da8e9afc50] testmod_init at ffff04d78f4b6014 [testmod]
 #3 [ffffb4da8e9afb40] do_one_initcall at ffff0e0044f7333c
--- <Exception in user> ---
     PC: 0000000a  LR: 00000000  SP: ffff04d78f4b6000  PSTATE: 7669726420656c75
    X12: ffffb4da8e9ac000 X11: ffff04d78f4b6018 X10: ffffb4da8e9afc50  X9: 20676e6973756143
     X8: 00000000  X7: ffff0e0045e5ce00  X6: ffff0e0045e5c000  X5: 600001c5
     X4: ffff0e0045020a58  X3: ffffb4da8e9afa30  X2: ffff0e004502098c  X1: ffffb4da8e9afa30
     X0: 00000124
crash> disas testmod_init
Dump of assembler code for function testmod_init:
   0xffff04d78f4b6000 <+0>:     stp     x29, x30, [sp,#-16]!
   0xffff04d78f4b6004 <+4>:     mov     x29, sp
   0xffff04d78f4b6008 <+8>:     ldr     x0, 0xffff04d78f4b6018
   0xffff04d78f4b600c <+12>:    bl      0xffff04d78f4b6090
   0xffff04d78f4b6010 <+16>:    ldr     x0, 0xffff04d78f4b6020
   0xffff04d78f4b6014 <+20>:    bl      0xffff04d78f4b6080
End of assembler dump.
===>8===
(I see some issue in disassembled code, though.)

> 
> 
> >>> First kernel is booted with mem=2G crashkernel=1G command line option.
> >>> While the system has 64G memory.
> 
> >> Are you saying that "mem=..." doesn't have any effect?
> > What I am saying it that If the first kernel is booted using mem= option and crashkernel= option
> > the memory for second kernel has to be withing the crashkernel size.
> > As per /proc/iomem System RAM the information is correct, but the /proc/meminfo is showing total memory
> > much more than the first kernel had in first place.
> 
> So your second crashkernel has 63G of memory? Unless you provide the same 'mem='
> to the kdump kernel, this is the expected behaviour. The
> DT:/reserved-memory/crash_dump describes the memory not to use.
> 
> On your first boot with 'mem=2G' memblock_mem_limit_remove_map() called from
> arm64_memblock_init() removed the top 62G of memory. Neither the first kernel
> nor kexec-tools know about the top 62G.
> When you run kexec-tools, it describes what it sees in /proc/iomem in the
> DT:/reserved-memory/crash_dump, which is just the remaining 1G of memory.
> 
> When we crash and reboot, the crash kernel discovers all 64G of memory from the
> EFI memory map.
> kexec-tools described the 1G of memory that the first kernel was using in the
> DT:/reserved-memory/crash_dump node, so early_init_fdt_scan_reserved_mem()
> reserves the 1G of memory the first kernel used. This leaves us with 63G of memory.

Thank you very much for elaborating this on behalf of myself!

> This may change with the next version of kdump if it switches back to using
> DT:/chosen/linux,usable-memory-range.

Indeed.
We need to talk to Rob.

Thanks,
-Takahiro AKASHI

> If you need v26 to avoid the top 62G of memory, you need to provide the same
> 'mem=' to the first and second kernel.
>
> 
> >>> 1.2 Live crash dump fails with error
> 
> ... do we expect this to work? I don't think it has anything to do with this
> series...
> 
> 
> Thanks,
> 
> James
> 

WARNING: multiple messages have this Message-ID (diff)
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: James Morse <james.morse@arm.com>
Cc: mark.rutland@arm.com, Manish Jaggi <mjaggi@caviumnetworks.com>,
	geoff@infradead.org, catalin.marinas@arm.com,
	will.deacon@arm.com, "Kapoor,
	Prasun" <Prasun.Kapoor@caviumnetworks.com>,
	bauerman@linux.vnet.ibm.com, dyoung@redhat.com,
	kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v26 0/7] arm64: add kdump support
Date: Wed, 5 Oct 2016 14:41:12 +0900	[thread overview]
Message-ID: <20161005054111.GA19531@linaro.org> (raw)
In-Reply-To: <57F37A73.3030105@arm.com>

On Tue, Oct 04, 2016 at 10:46:27AM +0100, James Morse wrote:
> Hi Manish,
> 
> On 03/10/16 13:41, Manish Jaggi wrote:
> > On 10/03/2016 04:34 PM, AKASHI Takahiro wrote:
> >> On Mon, Oct 03, 2016 at 01:24:34PM +0530, Manish Jaggi wrote:
> >>> With the v26 kdump and v3 kexec-tools and top of tree crash.git, below are the tests done
> >>> Attached is a patch in crash.git (symbols.c) to make crash utility work on my setup.
> >>> Can you please have a look and provide your comments.
> >>>
> >>> To generate a panic, i have a kernel module which on init calls panic.
> 
> ... modules ... I haven't tested that. I bet it causes some problems!
> We probably need to include module_alloc_base as an elf note in the vmcore file...

No, I don't think so :)
I created some test module as Manish implied and tested kdump:
(My kernel here even enables KASLR.)
===8<===
$ crash vmlinux vmcore
...
please wait... (gathering module symbol data)
...
crash> mod -S
     MODULE       NAME      SIZE  OBJECT FILE
ffff04d78f4b8000  testmod  16384  /opt/buildroot/15.11_64/root/kexec/testmod.ko 
crash> bt
PID: 1102   TASK: ffffb4da8e910000  CPU: 0   COMMAND: "insmod"
 #0 [ffffb4da8e9afa30] __crash_kexec at ffff0e0045020a54
 #1 [ffffb4da8e9afb90] panic at ffff0e004505523c
 #2 [ffffb4da8e9afc50] testmod_init at ffff04d78f4b6014 [testmod]
 #3 [ffffb4da8e9afb40] do_one_initcall at ffff0e0044f7333c
--- <Exception in user> ---
     PC: 0000000a  LR: 00000000  SP: ffff04d78f4b6000  PSTATE: 7669726420656c75
    X12: ffffb4da8e9ac000 X11: ffff04d78f4b6018 X10: ffffb4da8e9afc50  X9: 20676e6973756143
     X8: 00000000  X7: ffff0e0045e5ce00  X6: ffff0e0045e5c000  X5: 600001c5
     X4: ffff0e0045020a58  X3: ffffb4da8e9afa30  X2: ffff0e004502098c  X1: ffffb4da8e9afa30
     X0: 00000124
crash> disas testmod_init
Dump of assembler code for function testmod_init:
   0xffff04d78f4b6000 <+0>:     stp     x29, x30, [sp,#-16]!
   0xffff04d78f4b6004 <+4>:     mov     x29, sp
   0xffff04d78f4b6008 <+8>:     ldr     x0, 0xffff04d78f4b6018
   0xffff04d78f4b600c <+12>:    bl      0xffff04d78f4b6090
   0xffff04d78f4b6010 <+16>:    ldr     x0, 0xffff04d78f4b6020
   0xffff04d78f4b6014 <+20>:    bl      0xffff04d78f4b6080
End of assembler dump.
===>8===
(I see some issue in disassembled code, though.)

> 
> 
> >>> First kernel is booted with mem=2G crashkernel=1G command line option.
> >>> While the system has 64G memory.
> 
> >> Are you saying that "mem=..." doesn't have any effect?
> > What I am saying it that If the first kernel is booted using mem= option and crashkernel= option
> > the memory for second kernel has to be withing the crashkernel size.
> > As per /proc/iomem System RAM the information is correct, but the /proc/meminfo is showing total memory
> > much more than the first kernel had in first place.
> 
> So your second crashkernel has 63G of memory? Unless you provide the same 'mem='
> to the kdump kernel, this is the expected behaviour. The
> DT:/reserved-memory/crash_dump describes the memory not to use.
> 
> On your first boot with 'mem=2G' memblock_mem_limit_remove_map() called from
> arm64_memblock_init() removed the top 62G of memory. Neither the first kernel
> nor kexec-tools know about the top 62G.
> When you run kexec-tools, it describes what it sees in /proc/iomem in the
> DT:/reserved-memory/crash_dump, which is just the remaining 1G of memory.
> 
> When we crash and reboot, the crash kernel discovers all 64G of memory from the
> EFI memory map.
> kexec-tools described the 1G of memory that the first kernel was using in the
> DT:/reserved-memory/crash_dump node, so early_init_fdt_scan_reserved_mem()
> reserves the 1G of memory the first kernel used. This leaves us with 63G of memory.

Thank you very much for elaborating this on behalf of myself!

> This may change with the next version of kdump if it switches back to using
> DT:/chosen/linux,usable-memory-range.

Indeed.
We need to talk to Rob.

Thanks,
-Takahiro AKASHI

> If you need v26 to avoid the top 62G of memory, you need to provide the same
> 'mem=' to the first and second kernel.
>
> 
> >>> 1.2 Live crash dump fails with error
> 
> ... do we expect this to work? I don't think it has anything to do with this
> series...
> 
> 
> Thanks,
> 
> James
> 

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

  parent reply	other threads:[~2016-10-05  5:41 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-07  4:29 [PATCH v26 0/7] arm64: add kdump support AKASHI Takahiro
2016-09-07  4:29 ` AKASHI Takahiro
2016-09-07  4:29 ` [PATCH v26 1/7] arm64: kdump: reserve memory for crash dump kernel AKASHI Takahiro
2016-09-07  4:29   ` AKASHI Takahiro
2016-09-22 10:23   ` Matthias Bruger
2016-09-22 10:23     ` Matthias Bruger
2016-09-23  8:37     ` AKASHI Takahiro
2016-09-23  8:37       ` AKASHI Takahiro
2016-09-07  4:29 ` [PATCH v26 2/7] arm64: kdump: implement machine_crash_shutdown() AKASHI Takahiro
2016-09-07  4:29   ` AKASHI Takahiro
2016-09-14 18:09   ` James Morse
2016-09-14 18:09     ` James Morse
2016-09-15  8:13     ` Marc Zyngier
2016-09-15  8:13       ` Marc Zyngier
2016-09-16  3:21     ` AKASHI Takahiro
2016-09-16  3:21       ` AKASHI Takahiro
2016-09-16 14:49       ` James Morse
2016-09-16 14:49         ` James Morse
2016-09-20  7:36         ` AKASHI Takahiro
2016-09-20  7:36           ` AKASHI Takahiro
2016-09-07  4:29 ` [PATCH v26 3/7] arm64: kdump: add kdump support AKASHI Takahiro
2016-09-07  4:29   ` AKASHI Takahiro
2016-09-16 14:50   ` James Morse
2016-09-16 14:50     ` James Morse
2016-09-20  7:46     ` AKASHI Takahiro
2016-09-20  7:46       ` AKASHI Takahiro
2016-09-22 15:50   ` Matthias Brugger
2016-09-22 15:50     ` Matthias Brugger
2016-09-07  4:29 ` [PATCH v26 4/7] arm64: kdump: add VMCOREINFO's for user-space coredump tools AKASHI Takahiro
2016-09-07  4:29   ` AKASHI Takahiro
2016-09-16 16:04   ` James Morse
2016-09-16 16:04     ` James Morse
2016-09-07  4:29 ` [PATCH v26 5/7] arm64: kdump: enable kdump in the arm64 defconfig AKASHI Takahiro
2016-09-07  4:29   ` AKASHI Takahiro
2016-09-07  4:29 ` [PATCH v26 6/7] arm64: kdump: update a kernel doc AKASHI Takahiro
2016-09-07  4:29   ` AKASHI Takahiro
2016-09-16 16:08   ` James Morse
2016-09-16 16:08     ` James Morse
2016-09-20  8:27     ` AKASHI Takahiro
2016-09-20  8:27       ` AKASHI Takahiro
2016-09-26 17:21     ` Matthias Brugger
2016-09-26 17:21       ` Matthias Brugger
     [not found] ` <20160907042908.6232-1-takahiro.akashi-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-09-07  4:32   ` [PATCH v26 7/7] Documentation: dt: chosen properties for arm64 kdump AKASHI Takahiro
2016-09-07  4:32     ` AKASHI Takahiro
2016-09-07  4:32     ` AKASHI Takahiro
     [not found]     ` <20160907043203.6309-1-takahiro.akashi-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-09-16 13:03       ` Rob Herring
2016-09-16 13:03         ` Rob Herring
2016-09-16 13:03         ` Rob Herring
2016-09-07  4:37 ` [PATCH v26 0/7] arm64: add kdump support AKASHI Takahiro
2016-09-07  4:37   ` AKASHI Takahiro
2016-09-16 16:04 ` James Morse
2016-09-16 16:04   ` James Morse
2016-09-16 20:17   ` Ard Biesheuvel
2016-09-16 20:17     ` Ard Biesheuvel
2016-09-19 16:05     ` James Morse
2016-09-19 16:05       ` James Morse
2016-09-19 16:10       ` Ard Biesheuvel
2016-09-19 16:10         ` Ard Biesheuvel
2016-09-21  7:42       ` AKASHI Takahiro
2016-09-21  7:42         ` AKASHI Takahiro
2016-09-21  7:33   ` AKASHI Takahiro
2016-09-21  7:33     ` AKASHI Takahiro
2016-10-03  7:54 ` Manish Jaggi
2016-10-03  7:54   ` Manish Jaggi
2016-10-03 11:04   ` AKASHI Takahiro
2016-10-03 11:04     ` AKASHI Takahiro
2016-10-03 12:41     ` Manish Jaggi
2016-10-03 12:41       ` Manish Jaggi
2016-10-04  2:56       ` AKASHI Takahiro
2016-10-04  2:56         ` AKASHI Takahiro
2016-10-04  9:46       ` James Morse
2016-10-04  9:46         ` James Morse
2016-10-04 10:05         ` Manish Jaggi
2016-10-04 10:05           ` Manish Jaggi
2016-10-04 10:53           ` James Morse
2016-10-04 10:53             ` James Morse
2016-10-04 13:23             ` Manish Jaggi
2016-10-04 13:23               ` Manish Jaggi
2016-10-05  5:48               ` AKASHI Takahiro
2016-10-05  5:48                 ` AKASHI Takahiro
2016-10-05  5:41         ` AKASHI Takahiro [this message]
2016-10-05  5:41           ` AKASHI Takahiro
2016-10-04 10:18       ` Mark Rutland
2016-10-04 10:18         ` Mark Rutland
2016-10-17 15:41 ` Ruslan Bilovol
2016-10-17 15:41   ` Ruslan Bilovol
2016-10-18  6:26   ` AKASHI Takahiro
2016-10-18  6:26     ` AKASHI Takahiro
2016-11-01 12:19     ` Ruslan Bilovol
2016-11-01 12:19       ` Ruslan Bilovol

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161005054111.GA19531@linaro.org \
    --to=takahiro.akashi@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.