linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: zonque@gmail.com (Daniel Mack)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC 0/1] ARM: boot: make atags area relocatable
Date: Mon, 14 Oct 2013 15:44:21 +0200	[thread overview]
Message-ID: <1381758262-31159-1-git-send-email-zonque@gmail.com> (raw)

I've been hunting an effect of failed ARM kernel boots when kexec is
used, and here's a RFC for a solution of what I figured out.

kexec currently assumes that the kernel image compression rate is 1:4,
and stuffs the dtb image after what is assumed the end of the kernel
image. However, it does not read in the kernel's symbol table or
anything alike and hence can't know about the size of the bss
section. In my case, it turns out that upon __vet_atags is executed,
the dtb image lies inside the bss area and is hence overridden with
zeros later on.

This patch makes an attempt to fix this problem by detecting the
described condition and relocating the atags/bss section to where
the '_end' symbol is stored.

Disclaimer: I'm really not sure whether my virt_to_phys() approach
and other asm details are fully correct. I'm open to suggestions :)

Successfully tested on a AM335x platform that fails to kexec without
the patch.


Thanks,
Daniel


Daniel Mack (1):
  ARM: head-common.S: relocate atags area if necessary

 arch/arm/kernel/head-common.S | 58 ++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 52 insertions(+), 6 deletions(-)

-- 
1.8.3.1

             reply	other threads:[~2013-10-14 13:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-14 13:44 Daniel Mack [this message]
2013-10-14 13:44 ` [PATCH RFC 1/1] ARM: head-common.S: relocate atags area if necessary Daniel Mack

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=1381758262-31159-1-git-send-email-zonque@gmail.com \
    --to=zonque@gmail.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).