Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix unaligned access with newer GCC #8

Merged
merged 1 commit into from

2 participants

@GNUtoo

Without that fix we have(with meta-bug and unwinding desactivated):

[    0.000000] Unhandled fault: alignment exception (0x001) at 0xc0670622
[    0.000000] Internal error: : 1 [#1]
[    0.000000] last sysfs file:
[    0.000000] Modules linked in:
[    0.000000] CPU: 0    Not tainted  (2.6.35.10-r121+gitrb940b37db6d76200b482013342bf21de5579fc95 #3)
[    0.000000] PC is at omap_hwmod_init+0x40/0xa0
[    0.000000] LR is at omap3xxx_hwmod_init+0x14/0x1c
[    0.000000] pc : [<c0050a0c>]    lr : [<c0010e8c>]    psr: a00001d3
[    0.000000] sp : c0661f58  ip : c0661f78  fp : c0661f74
[    0.000000] r10: 00000000  r9 : 411fc083  r8 : 80031ed4
[    0.000000] r7 : c0664c0c  r6 : c0fc1d80  r5 : c0038164  r4 : c06705d0
[    0.000000] r3 : c0825470  r2 : 00000001  r1 : 00000000  r0 : c0038164
[    0.000000] Flags: NzCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
[    0.000000] Control: 10c5387f  Table: 80004019  DAC: 00000015
[    0.000000] Process swapper (pid: 0, stack limit = 0xc06602f0)
[    0.000000] Stack: (0xc0661f58 to 0xc0662000)
[    0.000000] 1f40:                                                       c004f734 c06708f0
[    0.000000] 1f60: c06708f0 c06708f0 c0661f84 c0661f78 c0010e8c c00509d8 c0661f9c c0661f88
[    0.000000] 1f80: c000e6e0 c0010e84 00000192 c07e8b08 c0661fac c0661fa0 c0011060 c000e6c0
[    0.000000] 1fa0: c0661fc4 c0661fb0 c000b7ec c0011054 c0824840 c0034048 c0661ff4 c0661fc8
[    0.000000] 1fc0: c00089c8 c000b7ac c00084f4 00000000 00000000 c0034048 00000000 10c53c7d
[    0.000000] 1fe0: c0824bb0 c0034044 00000000 c0661ff8 80008034 c0008870 00000000 00000000
[    0.000000] Backtrace:
[    0.000000] [<c00509cc>] (omap_hwmod_init+0x0/0xa0) from [<c0010e8c>] (omap3xxx_hwmod_init+0x14/0x1c)
[    0.000000]  r5:c06708f0 r4:c06708f0
[    0.000000] [<c0010e78>] (omap3xxx_hwmod_init+0x0/0x1c) from [<c000e6e0>] (omap2_init_common_hw+0x2c/0xd8)
[    0.000000] [<c000e6b4>] (omap2_init_common_hw+0x0/0xd8) from [<c0011060>] (bugbase_omap_init_irq+0x18/0x30)
[    0.000000]  r5:c07e8b08 r4:00000192
[    0.000000] [<c0011048>] (bugbase_omap_init_irq+0x0/0x30) from [<c000b7ec>] (init_IRQ+0x4c/0x58)
[    0.000000] [<c000b7a0>] (init_IRQ+0x0/0x58) from [<c00089c8>] (start_kernel+0x164/0x2dc)
[    0.000000]  r5:c0034048 r4:c0824840
[    0.000000] [<c0008864>] (start_kernel+0x0/0x2dc) from [<80008034>] (0x80008034)
[    0.000000]  r6:c0034044 r5:c0824bb0 r4:10c53c7d
[    0.000000] Code: 11a05000 1a000010 e3a00000 ea000012 (e5940052)

unwinding is also broken, I'll send a new meta-bug patch when this one is in.

Catalin Marinas ARM: 7150/1: 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>
Tested-by: John Linn <John.Linn@xilinx.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Cc: stable@vger.kernel.org
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
6922ae2
@theterg theterg merged commit 37efe9e into buglabs:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 18, 2012
  1. @GNUtoo

    ARM: 7150/1: Allow kernel unaligned accesses on ARMv6+ processors

    Catalin Marinas authored GNUtoo committed
    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>
    Tested-by: John Linn <John.Linn@xilinx.com>
    Acked-by: Nicolas Pitre <nico@linaro.org>
    Cc: stable@vger.kernel.org
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  arch/arm/kernel/head.S
View
2  arch/arm/kernel/head.S
@@ -158,7 +158,7 @@ __secondary_data:
* registers.
*/
__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
Something went wrong with that request. Please try again.