linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arch/arm64: elfcorehdr should be the first allocation
Date: Mon, 11 Dec 2017 14:07:14 +0000	[thread overview]
Message-ID: <20171211140714.GD2141@arm.com> (raw)
In-Reply-To: <1512970412-5472-1-git-send-email-prabhakar.kushwaha@nxp.com>

On Mon, Dec 11, 2017 at 11:03:32AM +0530, Prabhakar Kushwaha wrote:
> From: Abhimanyu Saini <abhimanyu.saini@nxp.com>
> 
> elfcorehdr_addr is assigned by kexec-utils and device tree of
> dump kernel is fixed in chosen node with parameter "linux,elfcorehdr".
> So, memory should be first reserved for elfcorehdr,
> otherwise overlaps may happen with other memory allocations
> which were done before the allocation of elcorehdr in the crash kernel

What happens in that case? Do you have a crash log we can include in
the commit message?

> Signed-off-by: Guanhua <guanhua.gao@nxp.com>
> Signed-off-by: Poonam Aggrwal <poonam.aggrwal@nxp.com>
> Signed-off-by: Abhimanyu Saini <abhimanyu.saini@nxp.com>
> ---

Really? How on Earth did you get three people co-developing this patch?

>  arch/arm64/mm/init.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
> index 5960bef0170d..551048cfcfff 100644
> --- a/arch/arm64/mm/init.c
> +++ b/arch/arm64/mm/init.c
> @@ -453,6 +453,10 @@ void __init arm64_memblock_init(void)
>  	 * Register the kernel text, kernel data, initrd, and initial
>  	 * pagetables with memblock.
>  	 */
> +
> +	/* make this the first reservation so that there are no chances of
> +	 * overlap */
> +	reserve_elfcorehdr();
>  	memblock_reserve(__pa_symbol(_text), _end - _text);
>  #ifdef CONFIG_BLK_DEV_INITRD
>  	if (initrd_start) {
> @@ -474,8 +478,6 @@ void __init arm64_memblock_init(void)
>  
>  	reserve_crashkernel();
>  
> -	reserve_elfcorehdr();

Why isn't this also a problem for reserve_crashkernel() or any other
static reservations?

Will

  reply	other threads:[~2017-12-11 14:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11  5:33 [PATCH] arch/arm64: elfcorehdr should be the first allocation Prabhakar Kushwaha
2017-12-11 14:07 ` Will Deacon [this message]
2017-12-13 10:46   ` AKASHI Takahiro
2017-12-15 14:20     ` Poonam Aggrwal
2017-12-18  5:33       ` AKASHI Takahiro
2017-12-18  8:20         ` Poonam Aggrwal

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=20171211140714.GD2141@arm.com \
    --to=will.deacon@arm.com \
    --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 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).