From: Milton Miller <miltonm@bga.com>
To: michael@ellerman.id.au
Cc: linux-ppc <linuxppc-dev@ozlabs.org>,
"M. Mohan Kumar" <mohan@in.ibm.com>,
kexec@lists.infradead.org
Subject: Re: [PATCH] powerpc: check crash_base for relocatable kernel
Date: Wed, 7 Jan 2009 08:57:13 -0600 [thread overview]
Message-ID: <f378ca9151a64ea3cead1b7354e8153c@bga.com> (raw)
In-Reply-To: <1231285442.8292.10.camel@localhost>
[removed Paul from cc and fixed Mohan's email]
On Jan 6, 2009, at 5:44 PM, Michael Ellerman wrote:
> On Fri, 2009-01-02 at 14:46 -0600, Milton Miller wrote:
>> @@ -94,10 +95,35 @@ void __init reserve_crashkernel(void)
>> KDUMP_KERNELBASE);
>>
>> crashk_res.start = KDUMP_KERNELBASE;
>> +#else
>> + if (!crashk_res.start) {
>> + /*
>> + * unspecified address, choose a region of specified size
>> + * can overlap with initrd (ignoring corruption when retained)
>> + * ppc64 requires kernel and some stacks to be in first segemnt
>> + */
>> + crashk_res.start = KDUMP_KERNELBASE;
>> + }
>> +
>> + crash_base = PAGE_ALIGN(crashk_res.start);
>> + if (crash_base != crashk_res.start) {
>> + printk("Crash kernel base must be aligned to 0x%lx\n",
>> + PAGE_SIZE);
>> + crashk_res.start = crash_base;
>> + }
>> +
>> #endif
>> crash_size = PAGE_ALIGN(crash_size);
>> crashk_res.end = crashk_res.start + crash_size - 1;
>>
>> + /* The crash region must not overlap the current kernel */
>> + if (overlaps_crashkernel(__pa(_stext), _end - _stext)) {
>> + printk(KERN_WARNING
>> + "Crash kernel can not overlap current kernel\n");
>> + crashk_res.start = crashk_res.end = 0;
>> + return;
>> + }
>
> I think we can be smarter here. Why don't we adjust the crash kernel
> region so that it doesn't overlap the first kernel? ie. move it up a
> bit.
How much? In addition to the size of the kernel, we have to allocate
(1) the emergeency stacks as we use them to bring up secondary cpus (2)
the irq stacks in the first segment. While the second could be met
easier on systems with 1TB slbs we don't take advantage of that yet.
>
> There's also the issue of the RMO, I'm not sure what we should do
> there,
> but I think the kernel needs some smarts otherwise users are going to
> shoot themselves in the foot.
I was looking at the code in kexec-tools for the rmo, and it seems
extremely broken (ie it sets rmo_top on every memory block instead of
the lowest; the clamp to 768M is the savior for systems with multiple
blocks).
Do we care about loading a kernel below a relocated kernel (between the
interrupt vectors and the new kernel)? I ignored that for now,
arguing that we always run the first kernel at 0.
>
> We could ignore the @x setting and split the RMO between both kernels
> somewhat intelligently.
>
> What might work is multiple crash regions, that way we could have some
> space in the RMO for the second kernel (say 32MB?), but the rest
> outside
> - leaving some RMO for the first kernel. But I think that would require
> some serious surgery.
>
Other archs have this, i guess because they read the memory out of
/proc/iomem. The trick is knowing what has to be put in real space
and what can go abvoe the rmo. Also, we have those horrible hard-code
rmo to 768M max because some platform (one of the cell ones?) didn't
make the device tree to show it. Maybe we can track it down and add
linux,usable-mem-ranges to fix it up?
Does the generic code support loading into the split regions, or is it
just for giving the kernel room to run?
So while all of these are nice, what do you think about merging this as
an interm measure, especially for backporting to 2.6.28 stable (and any
distro that wants to pick up relocatable kdump)?
milton
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2009-01-07 14:50 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-02 20:42 [PATCH 0/5 + 2] kexec updates Milton Miller
2009-01-02 20:46 ` [PATCH] powerpc: make dummy section a valid note header Milton Miller
2009-01-02 20:46 ` [PATCH] powerpc: check crash_base for relocatable kernel Milton Miller
2009-01-06 23:44 ` Michael Ellerman
2009-01-07 14:57 ` Milton Miller [this message]
2009-01-08 3:35 ` Michael Ellerman
2009-01-02 21:00 ` Milton Miller
2009-01-02 21:00 ` Milton Miller
2009-01-02 21:00 ` Milton Miller
2009-01-02 21:00 ` Milton Miller
2009-01-02 21:04 ` [PATCH kexec-tools 1/5] ppc64: always check number of ranges when adding Milton Miller
2009-01-07 2:42 ` Michael Ellerman
2009-01-07 14:34 ` Milton Miller
2009-01-08 12:33 ` [PATCH kexec-tools v2] ppc64: always check number of ranges when adding them Milton Miller
2009-01-02 21:04 ` [PATCH kexec-tools 2/5] ppc64: update kdump for 2.6.28 relocatable kernel Milton Miller
2009-01-02 21:04 ` [PATCH kexec-tools 4/5] ppc64: cleanups Milton Miller
2009-01-02 21:04 ` [PATCH kexec-tools 5/5] entry wants to be void * Milton Miller
2009-01-12 6:24 ` [PATCH 0/5 + 2] kexec updates Simon Horman
2009-01-13 4:15 ` M. Mohan Kumar
2009-01-13 15:59 ` Milton Miller
2009-01-15 22:43 ` Simon Horman
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=f378ca9151a64ea3cead1b7354e8153c@bga.com \
--to=miltonm@bga.com \
--cc=kexec@lists.infradead.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=michael@ellerman.id.au \
--cc=mohan@in.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox