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

Re: [Xen-devel] [PATCH] x86: use gcc6'es flags asm() output support



> From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
> Sent: Friday, July 01, 2016 11:02 PM
> 
> ..., rendering affected code more efficient and smaller.
> 
> Note that in atomic.h this at once does away with the redundant output
> and input specifications of the memory location touched.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> TBD: Do we want to abstract the pattern
>       asm ( "...; set<cc> %<out>" : "=<cons>" (var) ... )
> matching
>       asm ( "..." : "=@cc<cc>" (var) ... )
> via some macro? While this would eliminate many (all?) of the
> conditionals added here, it would result in the : no longer being
> visible in the actual source, making the asm()s look somewhat odd.
> Otherwise, to limit code duplication, it may be preferable to put
> the #ifdef-s inside the asm()s instead of around them.
> 
> --- a/xen/include/asm-x86/hvm/vmx/vmx.h
> +++ b/xen/include/asm-x86/hvm/vmx/vmx.h
> @@ -406,12 +406,17 @@ static inline bool_t __vmread_safe(unsig
>                     VMREAD_OPCODE MODRM_EAX_ECX
>  #endif
>                     /* CF==1 or ZF==1 --> rc = 0 */
> +#ifdef __GCC_ASM_FLAG_OUTPUTS__
> +                   : "=@ccnbe" (okay),
> +#else
>                     "setnbe %0"
> +                   : "=qm" (okay),
> +#endif
>  #ifdef HAVE_GAS_VMX
> -                   : "=qm" (okay), "=rm" (*value)
> +                     "=rm" (*value)
>                     : "r" (field));
>  #else
> -                   : "=qm" (okay), "=c" (*value)
> +                     "=c" (*value)
>                     : "a" (field));
>  #endif
> 
> 

Acked-by: Kevin Tian <kevin.tian@xxxxxxxxx> for VMX part.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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