From: Sascha Hauer <s.hauer@pengutronix.de>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>, barebox@lists.infradead.org
Subject: Re: [PATCH] arm: Disable unaligned access if MMU is switched off
Date: Tue, 29 Sep 2015 09:32:25 +0200 [thread overview]
Message-ID: <20150929073225.GQ7858@pengutronix.de> (raw)
In-Reply-To: <1443086443.8476.7.camel@pengutronix.de>
On Thu, Sep 24, 2015 at 11:20:43AM +0200, Lucas Stach wrote:
> Am Mittwoch, den 23.09.2015, 20:17 -0700 schrieb Andrey Smirnov:
> > Form reading ARM architecture related documentation if appears that
> > while unaligned memory access is supported by the processor in general
> > it is not supported if MMU is disabled.
> >
> > The problem in question can be easilty reproduced by building the code
> > without this patch, MMU disabled and trying to run 'memtest'
> > command. Which would in turn call mem_test() which would eventually
> > call show_progress(). That last function, if build without
> > -mno-unaligned-access would result in unaligned memory access which
> > would result in Barebox hanging.
> >
> The reasoning given here seems sound. Unaligned accesses do only work on
> cached memory on ARMv7.
>
> > This patch is a very conservative attempt to make sure that any code
> > that can potentially be executed with MMU disabled is built with
> > unaligned memory accesses disabled.
>
> The patch looks good as is, but I'm not sure we want to make this
> distinction in behavior between the different config options. Given that
> we should only have a very small amount of unaligned accesses anyway I
> think it might make sense to enable the compiler workaround always. But
> that would be for Sascha to decide.
Even with MMU enabled in the config we still run some initial portions
of the code with MMU disabled, so it seems safer to enable this option
unconditionally.
On the other hand disabling unaligned accesses makes the image around
1.5% bigger (tested with imx_v7_defconfig), so the compiler really makes
use of this option.
Ok, better safe than sorry, so I vote for always passing
-mno-unaligned-accesses.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2015-09-29 7:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-24 3:17 Andrey Smirnov
2015-09-24 9:20 ` Lucas Stach
2015-09-29 7:32 ` Sascha Hauer [this message]
2015-09-29 17:53 ` Andrey Smirnov
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=20150929073225.GQ7858@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=andrew.smirnov@gmail.com \
--cc=barebox@lists.infradead.org \
--cc=l.stach@pengutronix.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