qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] target-i386: set CC_OP to CC_OP_EFLAGS in cpu_l


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH] target-i386: set CC_OP to CC_OP_EFLAGS in cpu_load_eflags
Date: Thu, 15 May 2014 10:30:00 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 05/15/2014 10:04 AM, Paolo Bonzini wrote:
> There is no reason to keep that out of the function.  The comment refers
> to the disassembler's cc_op state rather than the CPUState field.

Yes, but...

> -/* NOTE: CC_OP must be modified manually to CC_OP_EFLAGS */
> +/* NOTE: set CC_OP to CC_OP_EFLAGS after calling a helper that uses this! */
>  static inline void cpu_load_eflags(CPUX86State *env, int eflags,
>                                     int update_mask)
>  {
>      CC_SRC = eflags & (CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
> +    CC_OP = CC_OP_EFLAGS;
>      env->df = 1 - (2 * ((eflags >> 10) & 1));

... we'd do well to reflect that in the comment here, rather than
in the commit message.  Because by itself it looks like the comment
is out of date.

How about

/* NOTE: the translator must set DisasContext.cc_op to CC_OP_EFLAGS
   after generating a call to a helper that uses this.  */

> --- a/target-i386/svm_helper.c
> +++ b/target-i386/svm_helper.c
> @@ -260,7 +260,6 @@ void helper_vmrun(CPUX86State *env, int aflag, int 
> next_eip_addend)
>                                    env->vm_vmcb + offsetof(struct vmcb,
>                                                            save.rflags)),
>                      ~(CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C | DF_MASK));
> -    CC_OP = CC_OP_EFLAGS;
>  
>      svm_load_seg_cache(env, env->vm_vmcb + offsetof(struct vmcb, save.es),
>                         R_ES);
> -- 

I see two sets of CC_OP in svm_helper.c.  Missed one?


r~



reply via email to

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