All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
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	[thread overview]
Message-ID: <5374F998.3020203@twiddle.net> (raw)
In-Reply-To: <1400173453-27705-1-git-send-email-pbonzini@redhat.com>

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	other threads:[~2014-05-15 17:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15 17:04 [Qemu-devel] [PATCH] target-i386: set CC_OP to CC_OP_EFLAGS in cpu_load_eflags Paolo Bonzini
2014-05-15 17:30 ` Richard Henderson [this message]
2014-05-16  9:34   ` Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2014-05-16  9:36 Paolo Bonzini
2014-05-16 14:51 ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5374F998.3020203@twiddle.net \
    --to=rth@twiddle.net \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.