qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v11 10/29] target/i386: [tcg] Refactor translate


From: Lluís Vilanova
Subject: Re: [Qemu-devel] [PATCH v11 10/29] target/i386: [tcg] Refactor translate_insn
Date: Fri, 07 Jul 2017 19:05:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Richard Henderson writes:

> On 07/06/2017 11:25 PM, Lluís Vilanova wrote:
>>>> /* convert one instruction. s->base.is_jmp is set if the translation must
>>>> be stopped. Return the next pc value */
>>>> -static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
>>>> -                               target_ulong pc_start)
>>>> +static target_ulong disas_insn(DisasContextBase *dcbase, CPUState *cpu)
>>>> {
>>>> +    DisasContext *s = container_of(dcbase, DisasContext, base);
>>>> +    CPUX86State *env = cpu->env_ptr;
>> 
>>> Minor nit: you can pass dc (*s) here directly, no need for container_of
>> [...]
>> 
>> I prefer not to so that the code will work in the future (i.e., not assuming 
>> the
>> location of base inside disascontext).

> There's clearly a misunderstanding here.

> Emilio is saying that disas_insn is not a hook and private to the
> front-end. Therefore the argument to the function should be "DisasContet *s" 
> and
> not "DisasContextBase *dcbase".

> And I agree.  Passing DisasContext should be preferred where possible.

Woooops, my bad! :)


Thanks,
  Lluis



reply via email to

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