From: Reuben Dowle <reuben.dowle@4rf.com>
To: u-boot@lists.denx.de
Subject: [PATCH] Fix data abort caused by mis-aligning fit data in
Date: Mon, 24 Aug 2020 21:18:40 +0000 [thread overview]
Message-ID: <a6171a58fcdd4bcf89fa4db0a78a2b9b@4rf.com> (raw)
In-Reply-To: <20200824203944.GK20605@bill-the-cat>
I can see that arm64 requires 8 bytes. That is stated in section 2 of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/arm64/booting.rst.
I can't see a similar requirement for arm, although my search was not exhaustive. More generally I can see that all device trees must be at least 4 byte aligned (from section II.2 of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/booting-without-of.rst)
So it does seem that 8 bytes would work for at least both of these. I would be happy with hard-coding that, as I doubt it would cause any problems with other architectures.
I don't have anything to add on the ability to relocate the device tree. In my case the device tree is for the next stage u-boot, so won't need relocating. This might become an issue if this was booting direct to linux from the SPL perhaps.
> -----Original Message-----
> From: Tom Rini <trini@konsulko.com>
> Sent: Tuesday, 25 August 2020 8:40 am
> To: Reuben Dowle <reuben.dowle@4rf.com>
> Cc: u-boot at lists.denx.de
> Subject: Re: [PATCH] Fix data abort caused by mis-aligning fit data in
>
> On Mon, Aug 24, 2020 at 08:05:24PM +0000, Reuben Dowle wrote:
>
> > Should I submit a new patch with the alignment set to 8 bytes? I would
> think a hard coded 8 bytes would not be the best solution, since not all
> architectures will need that much alignment. I suspect some would work with
> any alignment, and most 32-bit archs would be fine with 4-byte alignment.
> >
> > Our released software is actually using a patch to align to 4096 bytes, but I
> knew that was unnecessarily large. I was not really sure what would be an
> appropriate value here, and took a guess at ARCH_DMA_MINALIGN when I
> cleaned it up for submitting upstream. Is there a better define to use?
> >
> > I am also interested to know where the 8 byte alignment requirement is
> documented.
>
> So we're talking about the device tree file, and only that, in this part
> of the code, right? In the Linux kernel documentation, both arm and
> arm64 document that the device tree must be on an 8-byte aligned
> address. That is the bare minimum. If we aren't further relocating it
> (as fdt_high is set to 0xffffffff for example, which in general is wrong
> and bad), that's still the best we can do. It would be good to allow
> for further relocation down the line as we aren't making sure it
> wouldn't be overwritten by the kernel BSS, etc.
>
> --
> Tom
next prev parent reply other threads:[~2020-08-24 21:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-24 5:19 [PATCH] Fix data abort caused by mis-aligning fit data in Reuben Dowle
2020-08-24 14:26 ` Tom Rini
2020-08-24 20:05 ` Reuben Dowle
2020-08-24 20:39 ` Tom Rini
2020-08-24 21:18 ` Reuben Dowle [this message]
2020-08-24 21:22 ` 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=a6171a58fcdd4bcf89fa4db0a78a2b9b@4rf.com \
--to=reuben.dowle@4rf.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