Update: 
The following patch fix this issue, additional byteswap instructions in thumb2 
mode.
http://lists.infradead.org/pipermail/linux-arm-kernel/2014-January/225283.html

diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index b3fb8c9..1879e8d 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -451,9 +451,11 @@ __und_usr_thumb:
        .arch   armv6t2
 #endif
 2:     ldrht   r5, [r4]
+ARM_BE8(rev16  r5, r5)                         @ little endian instruction
        cmp     r5, #0xe800                     @ 32bit instruction if xx != 0
        blo     __und_usr_fault_16              @ 16bit undefined instruction
 3:     ldrht   r0, [r2]
+ARM_BE8(rev16  r0, r0)                         @ little endian instruction
        add     r2, r2, #2                      @ r2 is PC + 2, make it PC + 4
        str     r2, [sp, #S_PC]                 @ it's a 2x16bit instr, update
        orr     r0, r0, r5, lsl #16

-----Original Message-----
From: Will Newton [mailto:will.new...@linaro.org] 
Sent: Thursday, June 26, 2014 12:12 PM
To: Joel (Xi Zhou) Zhou
Cc: linaro-toolchain@lists.linaro.org
Subject: Re: VFP in BE mode - undefined instruction vstmia

On 26 June 2014 16:27, Joel (Xi Zhou) Zhou <joel.z...@broadcom.com> wrote:
> Hi all,
>
>
>
> I’m working on booting Linaro LSK 3.10.40 kernel in be8 mode on our
> Cortex-A9 system.
>
> There is an issue related to VFP instruction. It complain “vstmia” is an
> undefined instruction.
>
> The VFP is supported in CPU and CONFIG_VFP and CONFIG_VFPv3 are enabled in
> kernel config.
>
> Are there any patch need to be done for VFP in BE mode?
>
>
>
> The booting log show as following:
>
> call sys_access(/init)
>
> Freeing unused kernel memory: 2832K (c0600000 - c08c4000)
>
> kernel_init: try to execute '/init' (ramdisk_execute_command)
>
> en->run_init_process(/init)
>
> init (1): undefined instruction: pc=0000aab8
>
> Code: f00f dff8 2a20 1268 (acec) 108b
>
> Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
>
>
>
> The disassembly code show the undefined instruction is “vstmia”.
>
> armeb-linux-gnueabihf-objdump -D busybox_unstripped > busy.asm
>
> 0000aa90 <__sigsetjmp>:
>
> ...
>
>     aab6:       6812            ldr     r2, [r2, #0]
>
>     aab8:       ecac 8b10       vstmia  ip!, {d8-d15}
>
>     aabc:       f412 7f00       tst.w   r2, #512        ; 0x200
>
>
>
> The rootfs is busybox 1.22.1 compiled by Linaro BE hard floating toolchain.
>
> https://releases.linaro.org/14.04/components/toolchain/binaries/gcc-linaro-armeb-linux-gnueabihf-4.8-2014.04_linux.tar.xz

The instruction is valid and encoded correctly as far as I can tell. I
would suspect that this exception may be related to the kernel VFP
handling code.

-- 
Will Newton
Toolchain Working Group, Linaro
_______________________________________________
linaro-toolchain mailing list
linaro-toolchain@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-toolchain

Reply via email to