From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkzTz-0003mE-Bi for qemu-devel@nongnu.org; Thu, 15 May 2014 13:30:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkzTo-0004rV-MO for qemu-devel@nongnu.org; Thu, 15 May 2014 13:30:15 -0400 Received: from mail-qg0-x234.google.com ([2607:f8b0:400d:c04::234]:63198) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkzTo-0004qH-Iq for qemu-devel@nongnu.org; Thu, 15 May 2014 13:30:04 -0400 Received: by mail-qg0-f52.google.com with SMTP id a108so2319152qge.11 for ; Thu, 15 May 2014 10:30:04 -0700 (PDT) Sender: Richard Henderson Message-ID: <5374F998.3020203@twiddle.net> Date: Thu, 15 May 2014 10:30:00 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1400173453-27705-1-git-send-email-pbonzini@redhat.com> In-Reply-To: <1400173453-27705-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] target-i386: set CC_OP to CC_OP_EFLAGS in cpu_load_eflags List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org 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~