[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v5 05/14] x86/HVM: eliminate custom #MF/#XM handling



On Thu, Mar 15, 2018 at 07:06:36AM -0600, Jan Beulich wrote:
> @@ -8478,7 +8411,8 @@ x86_emulate(
>      }
>  
>   complete_insn: /* Commit shadow register state. */
> -    put_fpu(&fic, false, state, ctxt, ops);
> +    put_fpu(fpu_type, false, state, ctxt, ops);
> +    fpu_type = X86EMUL_FPU_none;
>  
>      /* Zero the upper 32 bits of %rip if not in 64-bit mode. */
>      if ( !mode_64bit() )
> @@ -8502,13 +8436,22 @@ x86_emulate(
>      ctxt->regs->eflags &= ~X86_EFLAGS_RF;
>  
>   done:
> -    put_fpu(&fic, fic.insn_bytes > 0 && dst.type == OP_MEM, state, ctxt, 
> ops);
> +    put_fpu(fpu_type, insn_bytes > 0 && dst.type == OP_MEM, state, ctxt, 
> ops);
>      put_stub(stub);
>      return rc;
>  #undef state
>  
>  #ifdef __XEN__
>   emulation_stub_failure:
> +    generate_exception_if(stub_exn.info.fields.trapnr == EXC_MF, EXC_MF);
> +    if ( stub_exn.info.fields.trapnr == EXC_XM )
> +    {
> +        unsigned long cr4;
> +
> +        if ( !ops->read_cr || !ops->read_cr(4, &cr4, ctxt) == X86EMUL_OKAY )

Is the second expression in the above line missing parentheses:

if ( !ops->read_cr || !(ops->read_cr(4, &cr4, ctxt) == X86EMUL_OKAY) )

Or should this be:

if ( !ops->read_cr || ops->read_cr(4, &cr4, ctxt) != X86EMUL_OKAY )

clang complains with:

In file included from x86_emulate.c:44:
./x86_emulate/x86_emulate.c:8665:31: error: logical not is only applied to the 
left hand side of
      this comparison [-Werror,-Wlogical-not-parentheses]
        if ( !ops->read_cr || !ops->read_cr(4, &cr4, ctxt) == X86EMUL_OKAY )
                              ^                            ~~
./x86_emulate/x86_emulate.c:8665:31: note: add parentheses after the '!' to 
evaluate the comparison
      first
        if ( !ops->read_cr || !ops->read_cr(4, &cr4, ctxt) == X86EMUL_OKAY )
                              ^
                               (                                          )
./x86_emulate/x86_emulate.c:8665:31: note: add parentheses around left hand 
side expression to
      silence this warning
        if ( !ops->read_cr || !ops->read_cr(4, &cr4, ctxt) == X86EMUL_OKAY )
                              ^
                              (                           )
1 error generated.

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.