diff mbox

ARM: BKPT instructions should raise prefetch aborts with IFSR type 00010

Message ID 4D8CA029.20502@sysgo.com
State New
Headers show

Commit Message

Alex Zuepke March 25, 2011, 2:01 p.m. UTC
Hi Peter,

Peter Maydell schrieb:
> On 25 March 2011 10:54, Alex Zuepke <azuepke@sysgo.com> wrote:
>> while digging through some problems with BKPT exceptions on ARM, I
>> discovered that QEMU does not update IFSR on prefetch aborts. This
>> should be done since ARMv6 according to ARM docs. Please include.
> 
> This patch is the wrong approach to fixing this bug -- the
> updating of the IFSR needs to be done when the exception
> is taken, not when we translate the breakpoint instruction.



Something like this? This neither looks good ...

> I'll put this on my todo list. If you happen to have a convenient
> test case demonstrating the problem, that would make a fix happen
> faster ;-)

Testcase is attached.

$ gunzip tc.elf.gz
$ qemu-system-arm.orig -nographic --cpu cortex-a8 -kernel tc.elf
testcase: IFSR undefined on QEMU
got prefetch abort, IFSR is 12345678
test: failed
HALT
Killed
$ qemu-system-arm.fixed -nographic --cpu cortex-a8 -kernel tc.elf
testcase: IFSR undefined on QEMU
got prefetch abort, IFSR is 00000002
test: OK
HALT
Killed

Best Regards,
Alex
diff mbox

Patch

--- qemu-0.14.0.orig/target-arm/helper.c	2011-02-16 15:44:05.000000000 +0100
+++ qemu-0.14.0/target-arm/helper.c	2011-03-25 14:00:31.000000000 +0100
@@ -808,6 +808,8 @@  void do_interrupt(CPUARMState *env)
                 return;
             }
         }
+        /* indicate debug exception in IFSR */
+        env->cp15.c5_insn = 2;
         /* Fall through to prefetch abort.  */
     case EXCP_PREFETCH_ABORT:
         new_mode = ARM_CPU_MODE_ABT;