linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Milton Miller <miltonm@bga.com>
Cc: linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>,
	kexec@lists.infradead.org, "M.MohanK" <"umar mohan"@in.ibm.com>
Subject: Re: [PATCH] powerpc: check crash_base for relocatable kernel
Date: Wed, 07 Jan 2009 10:44:02 +1100	[thread overview]
Message-ID: <1231285442.8292.10.camel@localhost> (raw)
In-Reply-To: <kexec-29-1-7.miltonm@bga.com>

[-- Attachment #1: Type: text/plain, Size: 2049 bytes --]

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.

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.

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.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

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

  reply	other threads:[~2009-01-06 23:44 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:44 ` Milton Miller
2009-01-02 20:44 ` Milton Miller
2009-01-02 20:44 ` Milton Miller
2009-01-02 20:44 ` 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 [this message]
2009-01-07 14:57     ` Milton Miller
2009-01-08  3:35       ` Michael Ellerman
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=1231285442.8292.10.camel@localhost \
    --to=michael@ellerman.id.au \
    --cc="umar mohan"@in.ibm.com \
    --cc=kexec@lists.infradead.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=miltonm@bga.com \
    --cc=paulus@samba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).