From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: arm64 boot requirements
Date: Thu, 3 Dec 2015 12:29:44 +0000 [thread overview]
Message-ID: <20151203122943.GD28731@leverpostej> (raw)
In-Reply-To: <1449083028.6139.25.camel@infradead.org>
On Wed, Dec 02, 2015 at 11:03:48AM -0800, Geoff Levand wrote:
> Hi,
>
> On Tue, 2015-12-01 at 11:02 +0000, Mark Rutland wrote:
> > Pratyush, Geoff, I understood you were loading the kernel vmlinux for
> > kexec. Do you parse the Image header to figure out where to place
> > things?
>
> Yes, in the kexec user tools we use text_offset to make
> enough room for the kernel, but there is also the need for
> page_offset.
>
> We need to know the page_offset to be able to do virtual to
> physical address conversions. We can calculate the page_offset
> for a vmlinux image as page_offset = phdr->p_vaddr - text_offset.
I don't understadn why you need to do that.
Is that just just so you can figure out where to load the segments
physically?
> The binary Image currently has no info about page_offset or
> virtual addressing. We have a kexec-tools option for the
> user to specify a page_offset. If that option is not provided
> we try to look at the running kernel's symbols, and if that
> fails, fall back to a default page_offset. This is less than
> ideal, and certainly makes the binary Image less appealing to
> use with kexec.
I don't follow at all why this complication is necessary. I don't think
that the kexec tools should be looking at the kernel symbols in that
manner, and I don't think that we need to expose the page offset via the
Image header.
The first loaded address in the vmlinux corresponds to PHYS_OFFSET +
TEXT_OFFSET. If you know that, you can figure out an offset to apply to
VAs to convert them to PAs when loading.
What am I missing?
Thanks,
Mark.
prev parent reply other threads:[~2015-12-03 12:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-30 1:45 arm64 boot requirements Carl van Schaik
2015-12-01 11:02 ` Mark Rutland
2015-12-01 11:52 ` Ard Biesheuvel
2015-12-01 22:09 ` Christopher Covington
2015-12-02 10:26 ` Mark Rutland
2015-12-02 13:46 ` Carl van Schaik
2015-12-03 12:24 ` Mark Rutland
2015-12-01 12:50 ` Pratyush Anand
2015-12-02 19:03 ` Geoff Levand
2015-12-03 12:29 ` Mark Rutland [this message]
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=20151203122943.GD28731@leverpostej \
--to=mark.rutland@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