[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL v1 16/38] target-microblaze: Break out trap_illeg
From: |
Edgar Iglesias |
Subject: |
Re: [Qemu-devel] [PULL v1 16/38] target-microblaze: Break out trap_illegal() |
Date: |
Tue, 5 Jun 2018 17:44:01 +0000 |
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 <address@hidden>
Date: Jun 4, 2018, 20:12
To: "Edgar E. Iglesias" <address@hidden>
On 29 May 2018 at 11:49, Edgar E. Iglesias <address@hidden> wrote:
> From: "Edgar E. Iglesias" <address@hidden>
>
> 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 <address@hidden>
> Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> Signed-off-by: Edgar E. Iglesias <address@hidden>
> @@ -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