Skip to contentSkip to conversation

target-arm: Missed gen_set_condexec() in AA32 translation

PATCH Superseded Sergey Fedorov 2 participants 6 messages Nov 16, 2015 – Nov 17, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover target-arm: Missed gen_set_condexec() in AA32 translation

Sergey Fedorov (2):
target-arm: Update condexec before CP access check in AA32 translation
target-arm: Update condexec before arch BP check in AA32 translation

 target-arm/translate.c | 2 ++
 1 file changed, 2 insertions(+)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 target-arm: Update condexec before CP access check in AA32 translation

Coprocessor access instructions are allowed inside IT block. gen_helper_access_check_cp_reg() can raise an exceptions thus condexec bits should be updated before.

---
 target-arm/translate.c | 1 +
 1 file changed, 1 insertion(+)
target-arm/translate.c +1 -0
index 4351854..f1f8129 100644
@@ -7210,6 +7210,7 @@ static int disas_coproc_insn(DisasContext *s, uint32_t insn)
                 break;
             }
 
+            gen_set_condexec(dc);
             gen_set_pc_im(s, s->pc - 4);
             tmpptr = tcg_const_ptr(ri);
             tcg_syn = tcg_const_i32(syndrome);
Signature · 1 line
1.9.1
#2 lore raw

Re: [Qemu-arm] [PATCH 1/2] target-arm: Update condexec before CP access check in AA32 translation

Quoted 14 lines · Sergey Fedorov

Coprocessor access instructions are allowed inside IT block. gen_helper_access_check_cp_reg() can raise an exceptions thus condexec bits should be updated before.

---
 target-arm/translate.c | 1 +
 1 file changed, 1 insertion(+)
target-arm/translate.c +0 -0
index 4351854..f1f8129 100644

target-arm/translate.c static int disas_coproc_insn(DisasContext *s, uint32_t insn) · line 7213

Quoted 4 lines
target-arm/translate.c +1 -0
@@ -7210,6 +7210,7 @@ static int disas_coproc_insn(DisasContext *s, uint32_t insn)
                 break;
             }
 
+            gen_set_condexec(dc);

Ah, there must be gen_set_condexec(s).

Quoted 3 lines
target-arm/translate.c +0 -0
             gen_set_pc_im(s, s->pc - 4);
             tmpptr = tcg_const_ptr(ri);
             tcg_syn = tcg_const_i32(syndrome);
#3 lore raw

Re: [Qemu-arm] [PATCH 1/2] target-arm: Update condexec before CP access check in AA32 translation

Quoted 18 lines · Sergey Fedorov
Quoted 17 lines · Sergey Fedorov

Coprocessor access instructions are allowed inside IT block. gen_helper_access_check_cp_reg() can raise an exceptions thus condexec bits should be updated before.

---
 target-arm/translate.c | 1 +
 1 file changed, 1 insertion(+)
target-arm/translate.c +0 -0
index 4351854..f1f8129 100644
@@ -7210,6 +7210,7 @@ static int disas_coproc_insn(DisasContext *s, uint32_t insn)
                 break;
             }
 
Quoted 3 lines

target-arm/translate.c static int disas_coproc_insn(DisasContext *s, uint32_t insn) · line 7213

Quoted 1 line
target-arm/translate.c +1 -0
+            gen_set_condexec(dc);

Ah, there must be gen_set_condexec(s).

Yep. Are you going to resend?

thanks
-- PMM

#4 lore raw

Re: [Qemu-arm] [PATCH 1/2] target-arm: Update condexec before CP access check in AA32 translation

Quoted 19 lines · Peter Maydell
Quoted 18 lines · Sergey Fedorov
Quoted 17 lines · Sergey Fedorov

Coprocessor access instructions are allowed inside IT block. gen_helper_access_check_cp_reg() can raise an exceptions thus condexec bits should be updated before.

---
 target-arm/translate.c | 1 +
 1 file changed, 1 insertion(+)
target-arm/translate.c +0 -0
index 4351854..f1f8129 100644
@@ -7210,6 +7210,7 @@ static int disas_coproc_insn(DisasContext *s, uint32_t insn)
                 break;
             }
 
Quoted 3 lines
Quoted 2 lines

target-arm/translate.c static int disas_coproc_insn(DisasContext *s, uint32_t insn) · line 7213

Quoted 1 line
target-arm/translate.c +1 -0
+            gen_set_condexec(dc);

Ah, there must be gen_set_condexec(s).

Yep. Are you going to resend?

I got sort of ahead of myself with the patch. Yes, I will resend it now.

Best,
Sergey

#5 lore raw

PATCH 2/2 target-arm: Update condexec before arch BP check in AA32 translation

In reply to Sergey Fedorov

Architectural breakpoint check could raise an exceptions, thus condexec bits should be updated before calling gen_helper_check_breakpoints().

---
 target-arm/translate.c | 1 +
 1 file changed, 1 insertion(+)
target-arm/translate.c +1 -0
index f1f8129..9e9f851 100644
@@ -11374,6 +11374,7 @@ void gen_intermediate_code(CPUARMState *env, TranslationBlock *tb)
             QTAILQ_FOREACH(bp, &cs->breakpoints, entry) {
                 if (bp->pc == dc->pc) {
                     if (bp->flags & BP_CPU) {
+                        gen_set_condexec(dc);
                         gen_set_pc_im(dc, dc->pc);
                         gen_helper_check_breakpoints(cpu_env);
                         /* End the TB early; it's likely not going to be executed */
Signature · 1 line
1.9.1