[arm-gnu] Invalid unaligned access support for ARM Cortex-A8 in Sourcery G++ Lite 2011.03-41.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[arm-gnu] Invalid unaligned access support for ARM Cortex-A8 in Sourcery G++ Lite 2011.03-41.



Hi,

Preconditions:
Build system: Linux mgalemin-ThinkPad-R51e 2.6.39-1-generic-pae #6-Ubuntu SMP Fri May 6 07:11:44 UTC 2011 i686 i686 i386 GNU/Linux
Cross-compiler: Sourcery G++ Lite 2011.03-41
Host kernel: 2.6.37-rc7 (from git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git, tag "v2.6.39-rc7") with default config for OMAP3 - "omap2plus_defconfig"
Host hardware: Beagleboard-xM

Execution:
1. Checkout Linux kernel (tag "v2.6.39-rc7");
2. Make default kernel configuration for OMAP3 using "omap2plus_defconfig" target;
3. Build kernel using Sourcery G++ Lite 2011.03-41 cross-compiler:
    make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm uImage

Expected results:
Kernel boots.

Results:
Kernel crashes with "Unhandled fault: alignment exception" (please see attachment for details).

Workaround 1:
Force structures to be aligned. For example, for exception from the attachment change size of "empty_str" array in function "pcpu_dump_alloc_info" (file "mm/percpu.c") from:
char empty_str[] = "--------";
to:
char empty_str[16] = "--------";

Workaround 2:
Compile kernel with disabled "Unaligned access support":
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm EXTRA_CFLAGS=-mno-unaligned-access uImage


Cheers,
Max.
[ 0.000000] Linux version 2.6.39-rc7 (mgalemin@mgalemin-ThinkPad-R51e) (gcc version 4.5.2 (Sourcery G++ Lite 2011.03-41) ) #1 SMP Sun May 15 20:40:04 EST 2011
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7f
[ 0.000000] CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine: OMAP3 Beagle Board
[ 0.000000] bootconsole [earlycon0] enabled
[ 0.000000] Reserving 12582912 bytes SDRAM for VRAM
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] OMAP3630 ES1.0 (l2cache iva sgx neon isp 192mhz_clk )
[ 0.000000] SRAM: Mapped pa 0x40200000 to va 0xfe400000 size: 0x10000
[ 0.000000] Clocking rate (Crystal/Core/MPU): 26.0/332/600 MHz
[ 0.000000] Reprogramming SDRC clock to 332000000 Hz
[ 0.000000] PERCPU: Embedded 7 pages/cpu @c0f6e000 s8160 r8192 d12320 u32768
[ 0.000000] Unhandled fault: alignment exception (0x001) at 0xc0501a19
[ 0.000000] Internal error: : 1 [#1] SMP
[ 0.000000] last sysfs file: 
[ 0.000000] Modules linked in:
[ 0.000000] CPU: 0 Not tainted (2.6.39-rc7 #1)
[ 0.000000] PC is at pcpu_dump_alloc_info+0xc/0x248
[ 0.000000] LR is at pcpu_setup_first_chunk+0x438/0x71c
[ 0.000000] pc : [<c010dd2c>] lr : [<c001f978>] psr: 200001d3
[ 0.000000] sp : c058fed8 ip : 00000001 fp : 00008000
[ 0.000000] r10: c0f75000 r9 : c0f75060 r8 : c0f75040
[ 0.000000] r7 : c05a467c r6 : c0f6e000 r5 : 00003020 r4 : c0f6b1e0
[ 0.000000] r3 : c0501a19 r2 : 00000002 r1 : c0f6b1e0 r0 : c0501ce0
[ 0.000000] Flags: nzCv IRQs off FIQs off Mode SVC_32 ISA ARM Segment kernel
[ 0.000000] Control: 10c5387f Table: 80004019 DAC: 00000017
[ 0.000000] Process swapper (pid: 0, stack limit = 0xc058e2f8)
[ 0.000000] Stack: (0xc058fed8 to 0xc0590000)
[ 0.000000] fec0: 00001000 c0047e88
[ 0.000000] fee0: 00000000 00000000 00000004 00000000 00000020 00000000 00000000 c0020ec0
[ 0.000000] ff00: 00000000 00000020 bfffffff 00000004 00003020 c0f6b1e0 00003020 c0f6e000
[ 0.000000] ff20: c05a467c c0f75040 c0f75060 c0f75000 00008000 c001f978 c0f6b1e0 00003020
[ 0.000000] ff40: c0f6e000 c05a3988 c0f75020 00000001 c0f6b1ec c0f6b1e0 c0f6c1e0 c0f6e000
[ 0.000000] ff60: c0f76000 c0f6b1f8 c0f6b1e0 c0f6b1ec 00000001 c00202a4 00002000 00003020
[ 0.000000] ff80: 00008000 00000000 000000ae c0f6b1e0 00001000 00007000 00008000 00001000
[ 0.000000] ffa0: 00000000 c060f760 c0034ac4 c0f6b120 c05a8144 80000000 413fc082 00000000
[ 0.000000] ffc0: 00000000 c0020360 c001f4a4 c001f49c c060f760 c0008888 10c53c7f 0000060a
[ 0.000000] ffe0: 80000100 c0034ac4 10c53c7d c05a38dc c0034ac0 8000803c 00000000 00000000
[ 0.000000] [<c010dd2c>] (pcpu_dump_alloc_info+0xc/0x248) from [<c001f978>] (pcpu_setup_first_chunk+0x438/0x71c)
[ 0.000000] [<c001f978>] (pcpu_setup_first_chunk+0x438/0x71c) from [<c00202a4>] (pcpu_embed_first_chunk+0x648/0x6dc)
[ 0.000000] [<c00202a4>] (pcpu_embed_first_chunk+0x648/0x6dc) from [<c0020360>] (setup_per_cpu_areas+0x28/0xb0)
[ 0.000000] [<c0020360>] (setup_per_cpu_areas+0x28/0xb0) from [<c0008888>] (start_kernel+0xdc/0x2ec)
[ 0.000000] [<c0008888>] (start_kernel+0xdc/0x2ec) from [<8000803c>] (0x8000803c)
[ 0.000000] Code: c0b49838 e59f3220 e92d4ff0 e24dd03c (e5932000)