From: dave.martin@linaro•org (Dave Martin)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH] ARM: decompressor: clear SCTLR.A bit for v7 cores
Date: Mon, 5 Nov 2012 10:48:50 +0000 [thread overview]
Message-ID: <20121105104839.GA2005@linaro.org> (raw)
In-Reply-To: <20121025150816.GA3874@sig21.net>
On Thu, Oct 25, 2012 at 05:08:16PM +0200, Johannes Stezenbach wrote:
> On Thu, Oct 25, 2012 at 09:25:06AM -0500, Rob Herring wrote:
> > On 10/25/2012 09:16 AM, Johannes Stezenbach wrote:
> > > On Thu, Oct 25, 2012 at 07:41:45AM -0500, Rob Herring wrote:
> > >> On 10/25/2012 04:34 AM, Johannes Stezenbach wrote:
> > >>> On Thu, Oct 11, 2012 at 07:43:22AM -0500, Rob Herring wrote:
> > >>>
> > >>>> While v6 can support unaligned accesses, it is optional and current
> > >>>> compilers won't emit unaligned accesses. So we don't clear the A bit for
> > >>>> v6.
> > >>>
> > >>> not true according to the gcc changes page
> > >>
> > >> What are you going to believe: documentation or what the compiler
> > >> emitted? At least for ubuntu/linaro 4.6.3 which has the unaligned access
> > >> support backported and 4.7.2, unaligned accesses are emitted for v7
> > >> only. I guess default here means it is the default unless you change the
> > >> default in your build of gcc.
> > >
> > > Since ARMv6 can handle unaligned access in the same way as ARMv7
> > > it seems a clear bug in gcc which might hopefully get fixed.
> > > Thus in this case I think it is reasonable to follow the
> > > gcc documentation, otherwise the code would break for ARMv6
> > > when gcc gets fixed.
> >
> > But the compiler can't assume the state of the U bit. I think it is
> > still legal on v6 to not support unaligned accesses, but on v7 it is
> > required. All the standard v6 ARM cores support it, but I'm not sure
> > about custom cores or if there are SOCs with buses that don't support
> > unaligned accesses properly.
>
> Well, I read the "...since Linux version 2.6.28" comment
> in the gcc changes page in the way that they assume the
> U-bit is set. (Although I'm not sure it really is???)
Actually, the kernel checks the arch version and the U bit on boot,
and chooses the appropriate setting for the A bit depending on the
result. (See arch/arm/mm/alignment.c:alignment_init().)
Currently, we depend on the CPU reset behaviour or firmware/
bootloader to set the U bit for v6, but the behaviour should be
correct either way, though unaligned accesses will obviously
perform (much) better with U=1.
>From the compiler's point of view we have always implemented the
U=1 behaviour, but it has to be done via the alignment fault
handler prior to v6 or with U=0.
> Looking at it from another side, if using the hw unaligned
> access capability gives a performance benefit then it
> would be useful to support it even if gcc doesn't
> behave as documented. One could still use a special
> unaligned.h for ARMv6 to get the performance benefit.
> (If it doesn't give performance benfit, then why
> bother, let's just use -mno-unaligned-access for v7, too.)
For v7, we should definitely use -munaligned-access where available
(unless it's the default?)
For v6, the question is whether there is any legitimate reason
ever to run the kernel with U=0. If not, could we explicitly
set it early and build with -munaligned-access where the compiler
supports this?
The only counterargument I can think of is that some people might
be running some ancient userspace which actually relies on the U=0
behaviour. I don't know whether anyone is actually doing that on
v6, though.
Cheers
---Dave
> In the ARMv6 ARM unaligned support and the U-bit is
> not optional, so you could use the same SoC bus argument
> for some hypothetical v7 SoCs.
>
>
> Johannes
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2012-11-05 10:48 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-05 1:23 [PATCH v2 0/5] Use more asm-generic headers Rob Herring
2012-08-05 1:23 ` [PATCH v2 1/5] ARM: use generic version of identical asm headers Rob Herring
2012-08-05 1:23 ` [PATCH v2 2/5] ARM: add strstr declaration for decompressors Rob Herring
2012-08-05 1:23 ` [PATCH v2 3/5] ARM: use generic unaligned.h Rob Herring
2012-10-08 16:43 ` Shawn Guo
2012-10-08 20:34 ` Rob Herring
2012-10-08 23:28 ` Shawn Guo
2012-10-09 2:27 ` Rob Herring
2012-10-09 2:45 ` Shawn Guo
2012-10-09 4:01 ` Nicolas Pitre
2012-10-10 13:29 ` Rob Herring
2012-10-10 13:57 ` Nicolas Pitre
2012-10-11 12:43 ` [PATCH] ARM: decompressor: clear SCTLR.A bit for v7 cores Rob Herring
2012-10-11 13:09 ` Russell King - ARM Linux
2012-10-11 13:31 ` Rob Herring
2012-10-11 13:41 ` Russell King - ARM Linux
2012-10-11 15:44 ` Nicolas Pitre
2012-10-23 20:32 ` Gregory CLEMENT
2012-10-25 12:07 ` Russell King - ARM Linux
2012-10-11 13:59 ` Russell King - ARM Linux
2012-10-11 15:58 ` Nicolas Pitre
2012-10-25 9:34 ` Johannes Stezenbach
2012-10-25 12:41 ` Rob Herring
2012-10-25 13:30 ` Arnd Bergmann
2012-10-25 14:16 ` Johannes Stezenbach
2012-10-25 14:25 ` Rob Herring
2012-10-25 15:02 ` Nicolas Pitre
2012-10-25 15:08 ` Johannes Stezenbach
2012-11-05 10:48 ` Dave Martin [this message]
2012-11-05 11:13 ` Russell King - ARM Linux
2012-11-05 13:02 ` Dave Martin
2012-11-05 13:43 ` Johannes Stezenbach
2012-11-05 15:39 ` Russell King - ARM Linux
2012-11-05 16:13 ` Nicolas Pitre
2012-11-05 17:26 ` Dave Martin
2012-11-05 17:44 ` Rob Herring
2012-11-05 20:02 ` Nicolas Pitre
2012-11-05 17:46 ` Nicolas Pitre
2012-11-05 13:48 ` Rob Herring
2012-11-05 22:02 ` Michael Hope
2013-02-20 14:56 ` Johannes Stezenbach
2013-02-20 15:07 ` Johannes Stezenbach
2012-08-05 1:23 ` [PATCH v2 4/5] ARM: use generic termios.h Rob Herring
2012-08-05 1:24 ` [PATCH v2 5/5] ARM: convert asm/irqflags.h to use asm-generic/irqflags.h Rob Herring
2012-08-05 9:34 ` [PATCH v2 0/5] Use more asm-generic headers Thomas Petazzoni
2012-08-06 14:35 ` Arnd Bergmann
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=20121105104839.GA2005@linaro.org \
--to=dave.martin@linaro$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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