U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-Boot,v2] spl: implement CRC check on U-Boot uImage
Date: Sat, 9 Feb 2019 19:43:49 -0500	[thread overview]
Message-ID: <20190210004349.GG16814@bill-the-cat> (raw)
In-Reply-To: <CAAh8qsx=0gN6gYUnRS-4EveT5ASOzhmXhMX3WcxFysu2UMqmCQ@mail.gmail.com>

On Sat, Feb 09, 2019 at 10:56:40PM +0100, Simon Goldschmidt wrote:
> On Fri, Feb 8, 2019 at 10:20 PM Tom Rini <trini@konsulko.com> wrote:
> >
> > On Fri, Feb 08, 2019 at 10:05:41PM +0100, Simon Goldschmidt wrote:
> > > On Fri, Feb 8, 2019 at 8:46 PM Tom Rini <trini@konsulko.com> wrote:
> > > >
> > > > On Wed, Nov 28, 2018 at 09:52:45PM +0100, Simon Goldschmidt wrote:
> > > >
> > > > > SPL currently does not check uImage CRCs when loading U-Boot.
> > > > >
> > > > > This patch adds checking the uImage CRC when SPL loads U-Boot. It does
> > > > > this by reusing the existing config option SPL_CRC32_SUPPORT to allow
> > > > > leaving out the CRC check on boards where the additional code size or
> > > > > boot time is a problem (adding the CRC check currently adds ~1.4 kByte
> > > > > to flash).
> > > > >
> > > > > The SPL_CRC32_SUPPORT config option now gets enabled by default if SPL
> > > > > support for legacy images is enabled to check the CRC on all boards
> > > > > that don't actively take countermeasures.
> > > > >
> > > > > Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
> > > > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > > >
> > > > Really sorry for the delay on this, especially as I've found one or two
> > > > problems.  The first problem is that with this vyasa-rk3288 and a few
> > > > others fail to build due to a number of errors such as:
> > > > ../common/spl/spl.c:269:12: error: 'struct spl_image_info' has no member
> > > > named 'dcrc_data'
> > >
> > > Hmm, let me check what's wrong there.
> 
> OK, so the vyasa-rk3288 uses TPL, that's what I got wrong.
> 
> > > >
> > > > Second, I believe this is causing a number of platforms with very tight
> > > > SPL constraints, namely all of 64bit sunxi, to fail to link as they
> > > > overflow SRAM now.  This can be fixed at least by making the new
> > > > behavior opt-in, but I would fix the vyasa-rk3288 problem first.  Thanks
> > > > in advance!
> > >
> > > Well, I thought it would be better to have it default to 'y' since I think it
> > > is what is expected. Shouldn't we explicitly work on those platforms?
> > > I must say I was pretty shocked to see that SPL did not detect an invalid
> > > CRC...
> > >
> > > Can you point me to a config that fails?
> >
> > In general, pine64_plus_defconfig is one that might (as I re-run my
> > build without this patch, I still see some failures but they've scrolled
> > off screen, but 64bit sunxi _is_ very sensitive to SPL growth).
> 
> And I also did compile that one but I don't see any error message. How
> am I supposed to detect the SRAM overflowing?
> 
> I assume it's .text or .rodata which makes it grow too big? If so, we could
> still check the CRC by using a smaller algorithm that does not rely on a
> precalculated table...

That could have been the other patch then.  Does all of sunxi build for
you?  If so, we're good then.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190209/1284fe30/attachment.sig>

  reply	other threads:[~2019-02-10  0:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-28 20:52 [U-Boot] [PATCH v2] spl: implement CRC check on U-Boot uImage Simon Goldschmidt
2018-12-11  1:07 ` Simon Glass
2019-01-14 15:38   ` Simon Goldschmidt
2019-01-14 16:27     ` Tom Rini
2019-02-01 18:55       ` Simon Goldschmidt
2019-02-08 19:46 ` [U-Boot] [U-Boot,v2] " Tom Rini
2019-02-08 21:05   ` Simon Goldschmidt
2019-02-08 21:19     ` Tom Rini
2019-02-09 21:56       ` Simon Goldschmidt
2019-02-10  0:43         ` Tom Rini [this message]
2019-02-10 13:07           ` Simon Goldschmidt
2019-02-10 13:23             ` Tom Rini

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=20190210004349.GG16814@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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