From: "Måns Rullgård" <mans@mansr.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] arm: Switch to -mno-unaligned-access when supported by the compiler
Date: Tue, 11 Feb 2014 18:21:26 +0000 [thread overview]
Message-ID: <yw1xtxc58q8p.fsf@unicorn.mansr.com> (raw)
In-Reply-To: <20140211181803.2F3ED380BED@gemini.denx.de> (Wolfgang Denk's message of "Tue, 11 Feb 2014 19:18:03 +0100")
Wolfgang Denk <wd@denx.de> writes:
> Dear M?ns Rullg?rd,
>
> In message <yw1xfvnpaclm.fsf@unicorn.mansr.com> you wrote:
>>
>> > With application code you don't really care whether a variable is
>> > read/written in one piece or broken down into several smaller
>> > reads/writes - except when you notice that performance suffers.
>> >
>> > When accessing hardware, it often makes a fundamental difference
>> > whether you access a device register with it's correct size or not.
>> > Usually breaking down an access into smaller ones results in crashes
>> > or incorrect data or other errors.
>>
>> I'm well aware of this, but it has nothing to do with the issue at hand.
>
> This is by your definition, or based on which exact rationale?
>
>> Device registers are always aligned. In properly written code these are
>> accessed using pointers the compiler knows to be aligned and thus does
>> the right thing.
>
> Maybe the device registers you have seen so far have always been
> perfectly aligned. Lucky you. Note that there are a number of
> designs around (that I do not hesitate to call broken) which have
> such properties. And when we include external hardware into the
> discussion like PCI attached devices or customer-designed FPGAs,
> it becomes even more "interesting".
Please explain how you would access an unaligned register from a CPU
that doesn't allow unaligned accesses. Clearly such a combination of
hardware can never work, so there is no use trying to cater for it in
haphazard ways that end up breaking perfectly normal systems.
--
M?ns Rullg?rd
mans at mansr.com
next prev parent reply other threads:[~2014-02-11 18:21 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-04 17:05 [U-Boot] [PATCH v2] arm: Switch to -mno-unaligned-access when supported by the compiler Tom Rini
2014-02-04 17:35 ` Måns Rullgård
2014-02-10 9:24 ` Albert ARIBAUD
2014-02-10 13:21 ` Tom Rini
2014-02-10 14:57 ` Albert ARIBAUD
2014-02-10 15:14 ` Måns Rullgård
2014-02-10 15:40 ` Måns Rullgård
2014-02-10 16:12 ` Albert ARIBAUD
2014-02-10 16:21 ` Måns Rullgård
2014-02-10 16:24 ` Tom Rini
2014-02-10 17:26 ` Albert ARIBAUD
2014-02-10 18:54 ` Wolfgang Denk
2014-02-10 21:26 ` Tom Rini
2014-02-10 22:17 ` Wolfgang Denk
2014-02-10 22:28 ` Tom Rini
2014-02-11 8:19 ` Wolfgang Denk
2014-02-11 12:37 ` Måns Rullgård
2014-02-11 14:43 ` Wolfgang Denk
2014-02-11 15:33 ` Måns Rullgård
2014-02-11 16:37 ` Albert ARIBAUD
2014-02-11 16:44 ` Måns Rullgård
2014-02-11 17:11 ` Albert ARIBAUD
2014-02-11 17:21 ` Albert ARIBAUD
2014-02-12 14:35 ` Tom Rini
2014-02-12 16:19 ` Albert ARIBAUD
2014-02-17 15:45 ` Tom Rini
2014-02-17 15:55 ` Albert ARIBAUD
2014-02-11 18:18 ` Wolfgang Denk
2014-02-11 18:21 ` Måns Rullgård [this message]
2014-02-11 8:44 ` Albert ARIBAUD
2014-02-12 14:25 ` Tom Rini
2014-02-12 15:51 ` Wolfgang Denk
2014-02-10 15:21 ` 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=yw1xtxc58q8p.fsf@unicorn.mansr.com \
--to=mans@mansr.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