All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Zhong <yang.zhong@intel.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: yang.zhong@intel.com, andrew.cooper3@citrix.com, xen-devel@lists.xen.org
Subject: Re: [PATCH v3 1/4] x86emul: Support GFNI insns
Date: Thu, 14 Dec 2017 21:57:59 +0800	[thread overview]
Message-ID: <20171214135759.GC10966@yangzhon-Virtual> (raw)
In-Reply-To: <5A1C407502000078001926F2@prv-mh.provo.novell.com>

On Mon, Nov 27, 2017 at 08:42:29AM -0700, Jan Beulich wrote:
> >>> On 10.11.17 at 11:36, <yang.zhong@intel.com> wrote:
> > Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> 
> First and foremost - did you try out your own patch? There not being
> any (minimal) test added makes this at least questionable.
> 
> > --- a/xen/arch/x86/x86_emulate/x86_emulate.c
> > +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
> > @@ -385,6 +385,7 @@ static const struct {
> >      [0x40] = { .simd_size = simd_packed_int },
> >      [0x41] = { .simd_size = simd_packed_int, .two_op = 1 },
> >      [0xc8 ... 0xcd] = { .simd_size = simd_other },
> > +    [0xcf] = { .simd_size = simd_other },
> 
> Why simd_other? And if that's really the right choice, where do you
> set op_bytes, which is required for this attribute due to
> 
>     if ( state->simd_size )
>     {
>         generate_exception_if(!op_bytes, EXC_UD);
> 
>?

  Hello Jan,

  Thanks for review patch!
  I checked the Galois Field related theorem, this should be simd_size = simd_packed_int.

  I will change this, thanks!

  Regards,

  Yang

> 
> > @@ -7356,6 +7359,14 @@ x86_emulate(
> >          op_bytes = 16;
> >          goto simd_0f38_common;
> >  
> > +    case X86EMUL_OPC_66(0x0f38, 0xcf):       /* gf2p8mulb xmm/m128,xmm*/
> > +    case X86EMUL_OPC_VEX_66(0x0f38, 0xcf):   /* vgf2p8mulb xmm/m128,xmm*/
> 
> Please provide correct comments - the VEX variant comes with two
> sizes. Also please add the missing blanks at the end.

  I will change those comments, thanks!
> 
> > +        host_and_vcpu_must_have(gfni);
> > +        if ( vex.opcx == vex_none )
> > +            goto simd_0f38_common;
> > +        else
> 
> Pointless else.

  Thanks, this else is not useful.
> 
> > +            goto simd_0f_avx;
> 
> vex.w needs to be checked before this goto.

  I checked the document again, there is no vex.w exception to check.
  If vex.w is necessary, i will add this check in here. thanks!

> 
> > @@ -7741,6 +7752,17 @@ x86_emulate(
> >          op_bytes = 16;
> >          goto simd_0f3a_common;
> >  
> > +    case X86EMUL_OPC_66(0x0f3a, 0xce):     /* gf2p8affineqb $imm8,xmm/m128,xmm*/
> > +    case X86EMUL_OPC_VEX_66(0x0f3a, 0xce): /* vgf2p8affineqb $imm8,xmm/m128,xmm*/
> > +    case X86EMUL_OPC_66(0x0f3a, 0xcf):     /* gf2p8affineinvqb $imm8,xmm/m128,xmm*/
> > +    case X86EMUL_OPC_VEX_66(0x0f3a, 0xcf): /* vgf2p8affineinvqb $imm8,xmm/m128,xmm*/
> > +        host_and_vcpu_must_have(gfni);
> > +        if ( vex.opcx == vex_none )
> > +            goto simd_0f3a_common;
> > +        else
> > +            goto simd_0f_imm8_avx;
> 
> Similar comments apply here.

  I will remove else and add vex.w check here as above, thanks!
> 
> > +
> > +
> 
> Please don't introduce double blank lines.

  thanks, i will be care of this.
> 
> Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2017-12-14 13:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-10 10:36 [PATCH v3 0/4] x86/cpuid: enable new cpu features Yang Zhong
2017-11-10 10:36 ` [PATCH v3 1/4] x86emul: Support GFNI insns Yang Zhong
2017-11-27 15:42   ` Jan Beulich
2017-12-14 13:57     ` Yang Zhong [this message]
2017-11-10 10:36 ` [PATCH v3 2/4] x86emul: Support vpclmulqdq Yang Zhong
2017-11-27 15:53   ` Jan Beulich
2017-12-14 13:49     ` Yang Zhong
2017-11-10 10:36 ` [PATCH v3 3/4] x86emul: Support vaes insns Yang Zhong
2017-11-27 16:30   ` Jan Beulich
2017-12-14 13:40     ` Yang Zhong
2017-11-10 10:36 ` [PATCH v3 4/4] x86/cpuid: Enable new SSE/AVX/AVX512 cpu features Yang Zhong
2017-11-10 10:46   ` Jan Beulich
2017-11-10 10:44 ` [PATCH v3 0/4] x86/cpuid: enable new " Jan Beulich

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=20171214135759.GC10966@yangzhon-Virtual \
    --to=yang.zhong@intel.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=xen-devel@lists.xen.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.