From: Scott Wood <scottwood@freescale.com>
To: Chris Friesen <cbf123@mail.usask.ca>
Cc: Michael Ellerman <michael@ellerman.id.au>,
Paul Mackerras <paulus@samba.org>,
kexec@lists.infradead.org, linuxppc-dev@lists.ozlabs.org,
Vivek Goyal <vgoyal@redhat.com>
Subject: Re: visible memory seems wrong in kexec crash dump kernel
Date: Mon, 29 Jul 2013 18:10:36 -0500 [thread overview]
Message-ID: <1375139436.30721.63@snotra> (raw)
In-Reply-To: <51E0F41A.20904@mail.usask.ca> (from cbf123@mail.usask.ca on Sat Jul 13 01:30:50 2013)
On 07/13/2013 01:30:50 AM, Chris Friesen wrote:
> On 07/12/2013 04:59 PM, Chris Friesen wrote:
>> On 07/12/2013 03:08 PM, Chris Friesen wrote:
>>
>>> I turned on the instrumentation in early_init_dt_scan_memory() and
>>> got
>>> the following when jumping to the capture kernel:
>>>
>>> memory scan node memory, reg size 16, data: 0 0 2 0,
>>> - 0 , 200000000
>>>
>>> That 0x200000000 matches the fact that I'm seeing 8GB of memory
>>> available in the recovery kernel.
>>>
>>> If I boot the original kernel with "crashkernel=224M@32M", should I
>>> expect that only 224MB is marked as "linux,usable-memory" in the
>>> recovery kernel?
>>
>> I started looking at the kexec side of things, and I noticed
>> something a
>> bit odd. In most places dealing with the device tree in kexec it
>> accepts
>> either "memory" or "memory@" for the memory node name. In
>> add_usable_mem_property() in arch/ppc64/fs2dt.c it seems to only
>> accept
>> "memory@".
>>
>> Is this expected behaviour? It seems to be the same in current git
>> versions of kexec-tools.
>>
>> On my system I see "/proc/device-tree/memory".
>>
>> If I modify add_usable_mem_property() to also accept "/memory" then
>> my
>> recovery kernel boots up with
>>
>> physicalMemorySize = 0x10000000
>>
>> which is 256MB (which is still a bit odd since I specified 224MB for
>> the
>> crashkernel).
>>
>> However, it then hits the BUG() call at the end of mark_bootmem() in
>> mm/bootmem.c.
>
> One final thing and I'll stop replying to myself. :)
>
> It looks like the problem is that some board-specific freescale code
> was calling lmb_reserve() with a base address in the 4GB range. It
> seems odd that lmb_reserve() didn't throw some kind of error when the
> recovery kernel was supposed to be limited to 224MB.
>
> Rather than try and fix the bug, I turned off the (unneeded) config
> options related to the above lmb_reserve() calls and was able to
> successfully access the information I needed via /dev/oldmem.
>
> The upshot is that there seems to be a number of things that could be
> improved:
>
> 1) kexec should accept "/memory" and not just "/memory@"
> 2) lmb_reserve() should really respect the crashkernel memory limit
> 3) the freescale stuff really shouldn't assume it can map things
> wherever it feels like
What "board-specific freescale code" are you referring to?
-Scott
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
WARNING: multiple messages have this Message-ID (diff)
From: Scott Wood <scottwood@freescale.com>
To: Chris Friesen <cbf123@mail.usask.ca>
Cc: Paul Mackerras <paulus@samba.org>,
kexec@lists.infradead.org, linuxppc-dev@lists.ozlabs.org,
Vivek Goyal <vgoyal@redhat.com>
Subject: Re: visible memory seems wrong in kexec crash dump kernel
Date: Mon, 29 Jul 2013 18:10:36 -0500 [thread overview]
Message-ID: <1375139436.30721.63@snotra> (raw)
In-Reply-To: <51E0F41A.20904@mail.usask.ca> (from cbf123@mail.usask.ca on Sat Jul 13 01:30:50 2013)
On 07/13/2013 01:30:50 AM, Chris Friesen wrote:
> On 07/12/2013 04:59 PM, Chris Friesen wrote:
>> On 07/12/2013 03:08 PM, Chris Friesen wrote:
>>=20
>>> I turned on the instrumentation in early_init_dt_scan_memory() and =20
>>> got
>>> the following when jumping to the capture kernel:
>>>=20
>>> memory scan node memory, reg size 16, data: 0 0 2 0,
>>> - 0 , 200000000
>>>=20
>>> That 0x200000000 matches the fact that I'm seeing 8GB of memory
>>> available in the recovery kernel.
>>>=20
>>> If I boot the original kernel with "crashkernel=3D224M@32M", should I
>>> expect that only 224MB is marked as "linux,usable-memory" in the
>>> recovery kernel?
>>=20
>> I started looking at the kexec side of things, and I noticed =20
>> something a
>> bit odd. In most places dealing with the device tree in kexec it =20
>> accepts
>> either "memory" or "memory@" for the memory node name. In
>> add_usable_mem_property() in arch/ppc64/fs2dt.c it seems to only =20
>> accept
>> "memory@".
>>=20
>> Is this expected behaviour? It seems to be the same in current git
>> versions of kexec-tools.
>>=20
>> On my system I see "/proc/device-tree/memory".
>>=20
>> If I modify add_usable_mem_property() to also accept "/memory" then =20
>> my
>> recovery kernel boots up with
>>=20
>> physicalMemorySize =3D 0x10000000
>>=20
>> which is 256MB (which is still a bit odd since I specified 224MB for =20
>> the
>> crashkernel).
>>=20
>> However, it then hits the BUG() call at the end of mark_bootmem() in
>> mm/bootmem.c.
>=20
> One final thing and I'll stop replying to myself. :)
>=20
> It looks like the problem is that some board-specific freescale code =20
> was calling lmb_reserve() with a base address in the 4GB range. It =20
> seems odd that lmb_reserve() didn't throw some kind of error when the =20
> recovery kernel was supposed to be limited to 224MB.
>=20
> Rather than try and fix the bug, I turned off the (unneeded) config =20
> options related to the above lmb_reserve() calls and was able to =20
> successfully access the information I needed via /dev/oldmem.
>=20
> The upshot is that there seems to be a number of things that could be =20
> improved:
>=20
> 1) kexec should accept "/memory" and not just "/memory@"
> 2) lmb_reserve() should really respect the crashkernel memory limit
> 3) the freescale stuff really shouldn't assume it can map things =20
> wherever it feels like
What "board-specific freescale code" are you referring to?
-Scott=
next prev parent reply other threads:[~2013-07-29 23:11 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-11 20:55 visible memory seems wrong in kexec crash dump kernel Chris Friesen
2013-07-11 20:55 ` Chris Friesen
2013-07-11 21:22 ` Chris Friesen
2013-07-11 21:22 ` Chris Friesen
2013-07-11 22:46 ` Chris Friesen
2013-07-11 22:46 ` Chris Friesen
2013-07-12 1:21 ` Michael Ellerman
2013-07-12 1:21 ` Michael Ellerman
2013-07-12 21:08 ` Chris Friesen
2013-07-12 21:08 ` Chris Friesen
2013-07-12 22:59 ` Chris Friesen
2013-07-12 22:59 ` Chris Friesen
2013-07-13 6:30 ` Chris Friesen
2013-07-13 6:30 ` Chris Friesen
2013-07-14 4:36 ` Michael Ellerman
2013-07-14 4:36 ` Michael Ellerman
2013-07-14 5:26 ` Benjamin Herrenschmidt
2013-07-14 5:26 ` Benjamin Herrenschmidt
2013-07-14 23:08 ` Chris Friesen
2013-07-14 23:08 ` Chris Friesen
2013-07-14 23:11 ` Benjamin Herrenschmidt
2013-07-14 23:11 ` Benjamin Herrenschmidt
2013-07-29 23:10 ` Scott Wood [this message]
2013-07-29 23:10 ` Scott Wood
2013-07-31 16:40 ` Friesen, Christopher
2013-07-31 16:40 ` Friesen, Christopher
2013-07-31 16:50 ` Scott Wood
2013-07-31 16:50 ` Scott Wood
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=1375139436.30721.63@snotra \
--to=scottwood@freescale.com \
--cc=cbf123@mail.usask.ca \
--cc=kexec@lists.infradead.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=michael@ellerman.id.au \
--cc=paulus@samba.org \
--cc=vgoyal@redhat.com \
/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.