qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Eduardo Habkost <ehabkost@redhat.com>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Xiao Guangrong <guangrong.xiao@linux.intel.com>,
	kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH 1/2] target-i386: tcg: Accept clwb instruction
Date: Fri, 6 Nov 2015 12:04:56 +0100	[thread overview]
Message-ID: <563C8958.20709@twiddle.net> (raw)
In-Reply-To: <1446672286-9136-2-git-send-email-ehabkost@redhat.com>

On 11/04/2015 10:24 PM, Eduardo Habkost wrote:
> Accept the clwb instruction (66 0F AE /6) if its corresponding feature
> flag is enabled on CPUID[7].
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>   target-i386/translate.c | 13 ++++++++++++-
>   1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/target-i386/translate.c b/target-i386/translate.c
> index b400d24..bac1685 100644
> --- a/target-i386/translate.c
> +++ b/target-i386/translate.c
> @@ -7716,10 +7716,21 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
>               }
>               break;
>           case 5: /* lfence */
> -        case 6: /* mfence */
>               if ((modrm & 0xc7) != 0xc0 || !(s->cpuid_features & CPUID_SSE2))
>                   goto illegal_op;
>               break;
> +        case 6: /* mfence/clwb */
> +            if (s->prefix & PREFIX_DATA) {
> +                /* clwb */
> +                if (!(s->cpuid_7_0_ebx_features & CPUID_7_0_EBX_CLWB))
> +                    goto illegal_op;
> +                gen_lea_modrm(env, s, modrm);

You should use gen_nop_modrm here, since we're not going to do anything with 
the address.  Otherwise,

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~

  reply	other threads:[~2015-11-06 11:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-04 21:24 [Qemu-devel] [PATCH 0/2] target-i386: tcg: Handle clflushopt/clwb/pcommit instructions Eduardo Habkost
2015-11-04 21:24 ` [Qemu-devel] [PATCH 1/2] target-i386: tcg: Accept clwb instruction Eduardo Habkost
2015-11-06 11:04   ` Richard Henderson [this message]
2015-11-06 13:59     ` Eduardo Habkost
2015-11-06 14:13       ` Richard Henderson
2015-11-04 21:24 ` [Qemu-devel] [PATCH 2/2] target-i386: tcg: Check right CPUID bits for clflushopt/pcommit Eduardo Habkost
2015-11-06 11:07   ` 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=563C8958.20709@twiddle.net \
    --to=rth@twiddle.net \
    --cc=ehabkost@redhat.com \
    --cc=guangrong.xiao@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --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 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).