qemu-devel
[Top][All Lists]
Advanced

[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: Peter Maydell
Subject: Re: [Qemu-devel] [PULL v1 16/38] target-microblaze: Break out trap_illegal()
Date: Mon, 4 Jun 2018 14:12:24 +0100

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]