Yeah, I think we should perhaps remove the nop insn counting hack all together...
Cheers, Edgar --- Sent from my phone -------- Original Message -------- Subject: Re: [PULL v1 16/38] target-microblaze: Break out trap_illegal() From: Peter Maydell <peter.mayd...@linaro.org> Date: Jun 4, 2018, 20:12 To: "Edgar E. Iglesias" <edgar.igles...@gmail.com> On 29 May 2018 at 11:49, Edgar E. Iglesias <edgar.igles...@gmail.com> wrote: > From: "Edgar E. Iglesias" <edgar.igles...@xilinx.com> > > Break out trap_illegal() to handle illegal operation traps. > We now generally stop translation of the current insn if > it's not valid. > > Reviewed-by: Richard Henderson <richard.hender...@linaro.org> > Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org> > Signed-off-by: Edgar E. Iglesias <edgar.igles...@xilinx.com> > @@ -1552,13 +1537,7 @@ static inline void decode(DisasContext *dc, uint32_t > ir) > if (dc->ir) > dc->nr_nops = 0; > else { > - if ((dc->tb_flags & MSR_EE_FLAG) > - && (dc->cpu->env.pvr.regs[2] & PVR2_ILL_OPCODE_EXC_MASK) > - && (dc->cpu->env.pvr.regs[2] & PVR2_OPCODE_0x0_ILL_MASK)) { > - tcg_gen_movi_i32(cpu_SR[SR_ESR], ESR_EC_ILLEGAL_OP); > - t_gen_raise_exception(dc, EXCP_HW_EXCP); > - return; > - } > + trap_illegal(dc, dc->cpu->env.pvr.regs[2] & > PVR2_OPCODE_0x0_ILL_MASK); > > LOG_DIS("nr_nops=%d\t", dc->nr_nops); > dc->nr_nops++; Here we used to return early in the "illegal insn" case, but in the new code we don't. Coverity warns about this (CID 1391443) because the trap_illegal() function's return code is checked in the other 9 places where it is called. thanks -- PMM