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

Re: [Xen-devel] [PATCH] x86/Rules: Use -mskip-rax-setup if the compiler supports it



>>> On 08.01.18 at 11:46, <andrew.cooper3@xxxxxxxxxx> wrote:
> This option is available from GCC 5 onwards, and was specifically introduced
> as an optimisation for Linux.  When using varadic functions, the caller 
> needs
> to know how many floating point arguments were passed.  Xen, like Linux,
> doesn't uses floating point arguments, so doesn't need to emit code to 
> inform
> varadic functions such as printk() that there are zero arguments.
> 
> The net delta for a release build is:
> 
>   add/remove: 0/0 grow/shrink: 35/625 up/down: 603/-5489 (-4886)
> 
> with the single biggest change being:
> 
>   x86_emulate                               101933  101751    -182

What variadic function(s) are being used there? I can spot a couple
of calls to printk() and one call to cpu_has_amd_erratum(), but
that can hardly account to 182 saved bytes.

> --- a/xen/arch/x86/Rules.mk
> +++ b/xen/arch/x86/Rules.mk
> @@ -30,3 +30,7 @@ CFLAGS += -fno-asynchronous-unwind-tables
>  ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n)
>  CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
>  endif
> +
> +# Xen doesn't ever pass SSE arguments.  Discard the SSE setup
> +# (i.e. `xor %eax, %eax`) before varadic function calls if possible.
> +$(call cc-option-add,CFLAGS,CC,-mskip-rax-setup)

Considering the gcc documentation for the option, I think this wants
to sit right next to -mno-sse. Also I think it is "variadic" (and then in
the description as well). With that
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan


_______________________________________________
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®.