qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Richard Henderson <rth@twiddle.net>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] target-i386: set CC_OP to CC_OP_EFLAGS in cpu_load_eflags
Date: Fri, 16 May 2014 11:34:32 +0200	[thread overview]
Message-ID: <5375DBA8.9050701@redhat.com> (raw)
In-Reply-To: <5374F998.3020203@twiddle.net>

Il 15/05/2014 19:30, Richard Henderson ha scritto:
> 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.

That's what I tried to do, but my wording was awful.

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

Much better.

>> --- 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?

Yes.

Paolo

  reply	other threads:[~2014-05-16  9:34 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
2014-05-16  9:34   ` Paolo Bonzini [this message]
  -- 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=5375DBA8.9050701@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).