* [PATCH] ARM: Allow kernel unaligned accesses on ARMv6+ processors
@ 2011-11-05 10:41 Catalin Marinas
2011-11-05 15:59 ` Nicolas Pitre
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Catalin Marinas @ 2011-11-05 10:41 UTC (permalink / raw)
To: linux-arm-kernel
Recent gcc versions generate unaligned accesses by default on ARMv6 and
later processors. This patch ensures that the SCTLR.A bit is always
cleared on such processors to avoid kernel traping before
alignment_init() is called.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: John Linn <John.Linn@xilinx.com>
---
arch/arm/kernel/head.S | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index a400a4d..1768db2 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -394,7 +394,7 @@ __secondary_data:
* r13 = *virtual* address to jump to upon completion
*/
__enable_mmu:
-#ifdef CONFIG_ALIGNMENT_TRAP
+#if defined(CONFIG_ALIGNMENT_TRAP) && __LINUX_ARM_ARCH__ < 6
orr r0, r0, #CR_A
#else
bic r0, r0, #CR_A
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] ARM: Allow kernel unaligned accesses on ARMv6+ processors
2011-11-05 10:41 [PATCH] ARM: Allow kernel unaligned accesses on ARMv6+ processors Catalin Marinas
@ 2011-11-05 15:59 ` Nicolas Pitre
2011-11-07 2:11 ` John Linn
[not found] ` <1d0610da-0dc0-4130-9d14-8524820b9846@WA4EHSMHS001.ehs.local>
2 siblings, 0 replies; 4+ messages in thread
From: Nicolas Pitre @ 2011-11-05 15:59 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, 5 Nov 2011, Catalin Marinas wrote:
> Recent gcc versions generate unaligned accesses by default on ARMv6 and
> later processors. This patch ensures that the SCTLR.A bit is always
> cleared on such processors to avoid kernel traping before
> alignment_init() is called.
>
> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> Cc: John Linn <John.Linn@xilinx.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
> ---
> arch/arm/kernel/head.S | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
> index a400a4d..1768db2 100644
> --- a/arch/arm/kernel/head.S
> +++ b/arch/arm/kernel/head.S
> @@ -394,7 +394,7 @@ __secondary_data:
> * r13 = *virtual* address to jump to upon completion
> */
> __enable_mmu:
> -#ifdef CONFIG_ALIGNMENT_TRAP
> +#if defined(CONFIG_ALIGNMENT_TRAP) && __LINUX_ARM_ARCH__ < 6
> orr r0, r0, #CR_A
> #else
> bic r0, r0, #CR_A
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ARM: Allow kernel unaligned accesses on ARMv6+ processors
2011-11-05 10:41 [PATCH] ARM: Allow kernel unaligned accesses on ARMv6+ processors Catalin Marinas
2011-11-05 15:59 ` Nicolas Pitre
@ 2011-11-07 2:11 ` John Linn
[not found] ` <1d0610da-0dc0-4130-9d14-8524820b9846@WA4EHSMHS001.ehs.local>
2 siblings, 0 replies; 4+ messages in thread
From: John Linn @ 2011-11-07 2:11 UTC (permalink / raw)
To: linux-arm-kernel
> -----Original Message-----
> From: Catalin Marinas [mailto:catalin.marinas at gmail.com] On Behalf Of
> Catalin Marinas
> Sent: Saturday, November 05, 2011 3:41 AM
> To: linux-arm-kernel at lists.infradead.org
> Cc: John Linn
> Subject: [PATCH] ARM: Allow kernel unaligned accesses on ARMv6+
> processors
>
> Recent gcc versions generate unaligned accesses by default on ARMv6
and
> later processors. This patch ensures that the SCTLR.A bit is always
> cleared on such processors to avoid kernel traping before
> alignment_init() is called.
>
> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> Cc: John Linn <John.Linn@xilinx.com>
It worked great, thanks Catalin. I'd love to see a solution merged in
the mainline and this seems reasonable.
I'm being pushed to newer tools which require a solution.
Tested-by: John Linn <john.linn@xilinx.com>
> ---
> arch/arm/kernel/head.S | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
> index a400a4d..1768db2 100644
> --- a/arch/arm/kernel/head.S
> +++ b/arch/arm/kernel/head.S
> @@ -394,7 +394,7 @@ __secondary_data:
> * r13 = *virtual* address to jump to upon completion
> */
> __enable_mmu:
> -#ifdef CONFIG_ALIGNMENT_TRAP
> +#if defined(CONFIG_ALIGNMENT_TRAP) && __LINUX_ARM_ARCH__ < 6
> orr r0, r0, #CR_A
> #else
> bic r0, r0, #CR_A
**** Please ignore the following footer which I'm still working on
getting removed, this IS open source information ***
This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ARM: Allow kernel unaligned accesses on ARMv6+ processors
[not found] ` <1d0610da-0dc0-4130-9d14-8524820b9846@WA4EHSMHS001.ehs.local>
@ 2011-11-07 17:07 ` Catalin Marinas
0 siblings, 0 replies; 4+ messages in thread
From: Catalin Marinas @ 2011-11-07 17:07 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Nov 07, 2011 at 02:11:24AM +0000, John Linn wrote:
> > -----Original Message-----
> > From: Catalin Marinas [mailto:catalin.marinas at gmail.com] On Behalf Of
> > Catalin Marinas
> > Sent: Saturday, November 05, 2011 3:41 AM
> > To: linux-arm-kernel at lists.infradead.org
> > Cc: John Linn
> > Subject: [PATCH] ARM: Allow kernel unaligned accesses on ARMv6+
> > processors
> >
> > Recent gcc versions generate unaligned accesses by default on ARMv6
> and
> > later processors. This patch ensures that the SCTLR.A bit is always
> > cleared on such processors to avoid kernel traping before
> > alignment_init() is called.
> >
> > Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> > Cc: John Linn <John.Linn@xilinx.com>
>
> It worked great, thanks Catalin. I'd love to see a solution merged in
> the mainline and this seems reasonable.
> I'm being pushed to newer tools which require a solution.
>
> Tested-by: John Linn <john.linn@xilinx.com>
Thanks. I pushed it to Russell's patch system as:
http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7150/1
--
Catalin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-11-07 17:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-05 10:41 [PATCH] ARM: Allow kernel unaligned accesses on ARMv6+ processors Catalin Marinas
2011-11-05 15:59 ` Nicolas Pitre
2011-11-07 2:11 ` John Linn
[not found] ` <1d0610da-0dc0-4130-9d14-8524820b9846@WA4EHSMHS001.ehs.local>
2011-11-07 17:07 ` Catalin Marinas
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).