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

login
register
mail settings
Submitter Alex Zuepke
Date March 25, 2011, 10:54 a.m.
Message ID <4D8C745F.2000304@sysgo.com>
Download mbox | patch
Permalink /patch/88367/
State New
Headers show

Comments

Alex Zuepke - March 25, 2011, 10:54 a.m.
Hi,

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.

Best Regards,
Alex
Peter Maydell - March 25, 2011, 11:39 a.m.
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.

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 ;-)

-- PMM

Patch

 target-arm: BKPT instructions should raise prefetch aborts with IFSR type 00010
 diff against qemu 0.14.0
 Signed-off-by: Alex Zuepke <azuepke@sysgo.com>
--- qemu-0.14.0.orig/target-arm/translate.c	2011-02-16 15:44:05.000000000 +0100
+++ qemu-0.14.0/target-arm/translate.c	2011-03-25 11:22:03.000000000 +0100
@@ -6389,6 +6389,7 @@ 
                 goto illegal_op;
             }
             /* bkpt */
+            env->cp15.c5_insn = 2;
             gen_exception_insn(s, 4, EXCP_BKPT);
             break;
         case 0x8: /* signed multiply */
@@ -8930,6 +8931,7 @@ 
             break;
 
         case 0xe: /* bkpt */
+            env->cp15.c5_insn = 2;
             gen_exception_insn(s, 2, EXCP_BKPT);
             break;