From: Jerry Van Baren <gvb.uboot@gmail.com>
To: Linuxppc-dev@ozlabs.org
Subject: Re: [PATCH dtc] Implement the -R option and add a -S option.
Date: Sat, 14 Apr 2007 22:41:48 -0400 [thread overview]
Message-ID: <462190EC.5010302@gmail.com> (raw)
In-Reply-To: <20070415022244.GA12016@localhost.localdomain>
David Gibson wrote:
> On Sat, Apr 14, 2007 at 10:13:49PM -0400, Jerry Van Baren wrote:
>> David Gibson wrote:
>>> On Sat, Apr 14, 2007 at 08:58:49AM -0400, Jerry Van Baren wrote:
>> [snip]
>>
>>>> On an unrelated related note, I don't believe my -R additions are
>>>> actually putting out additional reserve map slots (easiest to see using
>>>> the asm format output). I'm still trying to understand why not, it
>>>> seemed pretty straight-forward. When I implemented it, I was looking at
>>>> hexdumps of the dtb binary format and looking at the header and thought
>>>> I had it working... using it with my u-boot mods shows no extra reserved
>>>> slots. I'm looking into where I went wrong.
>>> Be careful to check the actual offsets. Bear in mind that objdump may
>>> elide zero words. Also bear in mind that the only way a reader of the
>>> device tree has of counting the number of reserve entries is stepping
>>> through until it hits the terminating (0,0), so the extra entries will
>>> just look like an early termination of the list. In this sense -R
>>> doesn't add "extra slots", but just ensures that there is space after
>>> the reserve map to add more entries.
>> Hi David,
>>
>> It actually is OK, went back and verified it. I needed to modify the
>> asm output to implement the -R extra slots which was confusing me (patch
>> that you didn't like the calloc in ;-).
>>
>> The calloc change was actually window dressing, I was just being
>> paranoid about a binary blob that is bigger than its contents (has extra
>> space). The unused space is unused, so it doen't really matter if it is
>> non-zero. I'll roll a new version.
>
> Oh, I think zeroing it is correct, I'd just prefer it was done at the
> callsite, rather than within xmalloc(). Strictly speaking you're
> right, what's in the extra area shouldn't matter, but I don't like the
> idea of potentially leaking random memory contents to file, which I
> think could happen without a memset(). Because dtc is unpriveleged it
> shouldn't actually matter, but it's ugly and a bad habit to establish.
Where I got concerned was a conversion of a .dtb input into a .dts or
.asm output (or even a .dtb output). I've run it and verified that the
extra space (which is potentially random garbage) is not copied to the
output - the size in the header is what it is and the data output is
only the actual data (no major surprise there).
Generating a text output format actually strips the extra size/data
because dtc turns it back into a symbolic form and padding is outside of
the symbolic form, if you follow my drift (there isn't a way to
represent extra blob padding in a dts format).
gvb
next prev parent reply other threads:[~2007-04-15 2:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-05 2:04 [PATCH dtc] Implement the -R option and add a -S option Jerry Van Baren
2007-04-05 15:03 ` Jon Loeliger
2007-04-05 15:17 ` Jerry Van Baren
2007-04-05 16:11 ` Scott Wood
2007-04-05 17:10 ` Jerry Van Baren
2007-04-12 6:51 ` David Gibson
2007-04-14 12:58 ` Jerry Van Baren
2007-04-14 16:43 ` Jerry Van Baren
2007-04-15 0:42 ` David Gibson
2007-04-15 2:13 ` Jerry Van Baren
2007-04-15 2:22 ` David Gibson
2007-04-15 2:41 ` Jerry Van Baren [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-04-05 2:29 [PATCH: " Jerry Van Baren
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=462190EC.5010302@gmail.com \
--to=gvb.uboot@gmail.com \
--cc=Linuxppc-dev@ozlabs.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).