Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaud Ferraris <arnaud.ferraris.external@sigfox.com>
To: Bhupesh Sharma <bhsharma@redhat.com>
Cc: Simon Horman <horms@verge.net.au>,
	kexec mailing list <kexec@lists.infradead.org>
Subject: Re: [RFC] fitImage support on ARM64
Date: Thu, 14 Jun 2018 15:52:40 +0200	[thread overview]
Message-ID: <fa0b5a48-0ec1-e7db-fe4b-856f020d80fa@sigfox.com> (raw)
In-Reply-To: <CACi5LpM9E0OfCZaeMDUc_eC5uqM=0dBpZ1ouTVQcBrH+TK=WmA@mail.gmail.com>

Hello Bhupesh,

Thanks for your answer.

On 14/06/2018 07:50, Bhupesh Sharma wrote:
> FIT is a u-boot construct - so one question to understand the
> background better - are you using u-boot bootloader to boot the Linux
> kernel on your arm64 platforms?
We are indeed using u-boot (this is a Marvell Armada 3700-based board).

> If yes, can you please confirm that it is not a product targeting
> server markets?
It is not, actually we are building an IoT gateway.

> For the normal kexec -p operation (i.e. not the kexec file_load
> operation), we rely on passing the device tree to the crashkernel via
> dtb= option (which is done by kexec-tools), so how do you plan to
> handle the same?
I added 2 fields to the kexec_info structure for the dtb, and another 2 
for the initrd:

     char *initrd;
     off_t initrd_size;
     char *dtb;
     off_t dtb_size;

While parsing the FIT image, I just fill these fields with the right 
data pointers & size, and for arm64 these are to be used within the 
arm64_load_other_segments function in kexec-arm64.c:

      if (arm64_opts.dtb) {
          dtb.name = "dtb_user";
          dtb.buf = slurp_file(arm64_opts.dtb, &dtb.size);
+    } else if (info->dtb) {
+        dtb.name = "dtb_fit";
+        dtb.buf = info->dtb;
+        dtb.size = info->dtb_size;
      } else {
          result = read_1st_dtb(&dtb);

Same kind of processing is used for the initrd.

For this architecture at least, FIT image support is only a few lines of 
arch-specific code ; the big part (FIT image parsing and binary blobs 
extraction) can be shared, just like the code for uImage support is.

> If we need to bring out the dtb from the FIT image to support the
> current design, do we really require the piecemeal FIT image support
> in kexec-tools?
It doesn't look like a huge piece of dev to me, actually I already have 
a working implementation (a basic one, only extracting the 
kernel/dtb/initrd binary blobs from the FIT image and feeding them to 
kexec_load, with no hash or signature checking) using the libfdt 
currently included in kexec-tools.

Regards,
Arnaud

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

      reply	other threads:[~2018-06-14 13:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12 13:35 [RFC] fitImage support on ARM64 Arnaud Ferraris
2018-06-14  5:50 ` Bhupesh Sharma
2018-06-14 13:52   ` Arnaud Ferraris [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=fa0b5a48-0ec1-e7db-fe4b-856f020d80fa@sigfox.com \
    --to=arnaud.ferraris.external@sigfox.com \
    --cc=bhsharma@redhat.com \
    --cc=horms@verge.net.au \
    --cc=kexec@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