Patchwork target-arm: Fix CP15 based WFI

login
register
mail settings
Submitter Paul Brook
Date July 1, 2012, 7:59 p.m.
Message ID <1341172777-14373-1-git-send-email-paul@codesourcery.com>
Download mbox | patch
Permalink /patch/168459/
State New
Headers show

Comments

Paul Brook - July 1, 2012, 7:59 p.m.
The coprocessor register rework broke cp15 based WFI instructions.
We incorrectly fall through the normal register write case, which
incorrectly adds a forced block termination.  We've already done
a special version of this (DISAS_WFI), so return immediately.

Signed-off-by: Paul Brook <paul@codesourcery.com>
---
 target-arm/translate.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Peter Maydell - July 1, 2012, 9:35 p.m.
On 1 July 2012 20:59, Paul Brook <paul@codesourcery.com> wrote:
> The coprocessor register rework broke cp15 based WFI instructions.
> We incorrectly fall through the normal register write case, which
> incorrectly adds a forced block termination.  We've already done
> a special version of this (DISAS_WFI), so return immediately.
>
> Signed-off-by: Paul Brook <paul@codesourcery.com>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

Thanks for the catch.

-- PMM

Patch

diff --git a/target-arm/translate.c b/target-arm/translate.c
index a2a0ecd..f39b9ca 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -6236,7 +6236,7 @@  static int disas_coproc_insn(CPUARMState * env, DisasContext *s, uint32_t insn)
             }
             gen_set_pc_im(s->pc);
             s->is_jmp = DISAS_WFI;
-            break;
+            return 0;
         default:
             break;
         }