[Qemu-devel] [Bug 1182344] Re: ARM: invalid code execution after subs instruction

2013-05-22 Thread Sebastian Huber
Thanks a lot for your help! It is not a Qemu problem. I ported the code from a pre ARMv7 environment. In the assembler code I have this: msr spsr, r5 The GNU as translates this to: msr SPSR_fc, r5 Correct is this: msr SPSR_fsxc, r5 I fixed the assembler source and now all SPSR fields

[Qemu-devel] [Bug 1182344] Re: ARM: invalid code execution after subs instruction

2013-05-22 Thread Peter Maydell
I did a bit of digging, and the reason that QEMU is not taking the branch is that when control returns from the exception handler the CPSR ITSTATE fields are non-zero. This means that the branch instruction is UNPREDICTABLE (and therefore falling through is architecturally valid behaviour for QEMU

[Qemu-devel] [Bug 1182344] Re: ARM: invalid code execution after subs instruction

2013-05-22 Thread Sebastian Huber
If I use this idle thread volatile int sdlkfj = 0; void *_CPU_Thread_Idle_body( uintptr_t ignored ) { while ( true ) { while ( sdlkfj == 0 ) { __asm__ volatile ("wfi; nop; nop; nop"); } __asm__ volatile ("wfi; nop; nop; nop"); } } then the test program seems to run forev

[Qemu-devel] [Bug 1182344] Re: ARM: invalid code execution after subs instruction

2013-05-22 Thread Sebastian Huber
If I replace the idle thread with this code void *_CPU_Thread_Idle_body( uintptr_t ignored ) { while ( true ) { __asm__ volatile ("wfi"); } } void foobarblub(void) { __asm__ volatile ("nop; nop; nop; nop; nop"); bsp_reset(); } then I get also an invalid execution sequence: 0x0001

[Qemu-devel] [Bug 1182344] Re: ARM: invalid code execution after subs instruction

2013-05-21 Thread Sebastian Huber
** Attachment added: "ELF file of the application." https://bugs.launchpad.net/qemu/+bug/1182344/+attachment/3682743/+files/app.exe -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1182344 Title:

[Qemu-devel] [Bug 1182344] Re: ARM: invalid code execution after subs instruction

2013-05-21 Thread Peter Maydell
Can you attach or provide a link to your app.exe test case? Otherwise this is going to be harder to track down and test. Thanks! -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1182344 Title: ARM: in