linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: panand@redhat.com (Pratyush Anand)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 2/3] arm64: Add arm64 kexec support
Date: Wed, 10 Aug 2016 09:27:43 +0530	[thread overview]
Message-ID: <20160810035743.GA27500@localhost.localdomain> (raw)
In-Reply-To: <177affa377979b1f10d5bd39107b96fe506eb683.1470693832.git.geoff@infradead.org>

Hi Geoff,

On 08/08/2016:10:19:33 PM, Geoff Levand wrote:
> Add kexec reboot support for ARM64 platforms.
> 
> Signed-off-by: Geoff Levand <geoff@infradead.org>
> ---

> +
> +		arm64_mem.page_offset = ehdr.e_entry - arm64_mem.text_offset;
> +
> +		dbgprintf("%s: e_entry:       %016llx -> %016lx\n", __func__,
> +			ehdr.e_entry,
> +			virt_to_phys(ehdr.e_entry));
> +		dbgprintf("%s: p_vaddr:       %016llx -> %016lx\n", __func__,
> +			phdr->p_vaddr,
> +			virt_to_phys(phdr->p_vaddr));
> +		dbgprintf("%s: header_offset: %016lx\n", __func__,
> +			header_offset);
> +		dbgprintf("%s: text_offset:   %016lx\n", __func__,
> +			arm64_mem.text_offset);
> +		dbgprintf("%s: image_size:    %016lx\n", __func__,
> +			arm64_mem.image_size);
> +		dbgprintf("%s: phys_offset:   %016lx\n", __func__,
> +			arm64_mem.phys_offset);
> +		dbgprintf("%s: page_offset:   %016lx\n", __func__,
> +			arm64_mem.page_offset);

Although it works on mustang, I would like to understand few things:

This is what is being printed by kexec-tools:

elf_arm64_load: e_entry:       fffffc0008080000 -> 0000004000080000
elf_arm64_load: p_vaddr:       fffffc0008080000 -> 0000004000080000
elf_arm64_load: header_offset: 0000000000000000
elf_arm64_load: text_offset:   0000000000080000
elf_arm64_load: image_size:    00000000013a0000
elf_arm64_load: phys_offset:   0000004000000000
elf_arm64_load: page_offset:   fffffc0008000000

kernel is having 42 VA Bits, so a debug print in kernel says that
PAGE_OFFSET=fffffe0000000000. Notice the difference between the values
calculated by kernel and kexec-tools. Isn't it confusing? I think kexec-tools
page_offset is text_page_offset and not the one which kernel uses. So, probably
we can rename it accordingly. Otherwise, we may sync kexec-tools's
virt_to_phys() and vice-versa definitions with that of kernel definitions.

In my case, kernel has kimage_voffset=fffffbc008000000. So kernel translate
virtual address fffffc0008080000 as fffffc0008080000 - fffffbc008000000 =
0000004000080000 which is matching to the one calculated by kexec-tools (for
e_entry).

~Pratyush

  parent reply	other threads:[~2016-08-10  3:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-08 22:19 [PATCH v3 0/3] arm64 kexec-tools patches Geoff Levand
2016-08-08 22:19 ` [PATCH v3 1/3] kexec: Add common device tree routines Geoff Levand
2016-08-08 22:19 ` [PATCH v3 3/3] arm64: Add support for binary image files Geoff Levand
2016-08-08 22:19 ` [PATCH v3 2/3] arm64: Add arm64 kexec support Geoff Levand
2016-08-09  3:05   ` AKASHI Takahiro
2016-08-09 18:30     ` Geoff Levand
2016-08-09 19:05   ` [PATCH v3.1 " Geoff Levand
2016-08-10  3:57   ` Pratyush Anand [this message]
2016-08-10 16:54     ` [PATCH v3 " Geoff Levand

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=20160810035743.GA27500@localhost.localdomain \
    --to=panand@redhat.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).