x86/build: Fix -mskip-rax-setup handling
diff mbox series

Message ID 20200221185550.30545-1-andrew.cooper3@citrix.com
State New
Headers show
Series
  • x86/build: Fix -mskip-rax-setup handling
Related show

Commit Message

Andrew Cooper Feb. 21, 2020, 6:55 p.m. UTC
The way -mskip-rax-setup is currently specified results in compiler support
being evaluated per translation unit, rather than per subdir.  Switch to using
cc-add-option instead.

This drops the number of callouts from 428 to 60.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Anthony PERARD <anthony.perard@citrix.com>

This drops about 0.5s from my ccache-accelerated but otherwise-clean build,
and will likely have a more pronounced difference on older hardware.  If it
wants backporting, it wants to go back in this form.

Alternatively, it would be nice to get this moved to Kconfig time.  Anthony:
Do you have any part of your series already doing this, or any suggestions on
how best to do it without colliding with your work?
---
 xen/arch/x86/Rules.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Anthony PERARD Feb. 21, 2020, 7:53 p.m. UTC | #1
On Fri, Feb 21, 2020 at 06:55:50PM +0000, Andrew Cooper wrote:
> The way -mskip-rax-setup is currently specified results in compiler support
> being evaluated per translation unit, rather than per subdir.  Switch to using
> cc-add-option instead.
> 
> This drops the number of callouts from 428 to 60.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Wei Liu <wl@xen.org>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Anthony PERARD <anthony.perard@citrix.com>
> 
> This drops about 0.5s from my ccache-accelerated but otherwise-clean build,
> and will likely have a more pronounced difference on older hardware.  If it
> wants backporting, it wants to go back in this form.
> 
> Alternatively, it would be nice to get this moved to Kconfig time.  Anthony:
> Do you have any part of your series already doing this, or any suggestions on
> how best to do it without colliding with your work?

The version of my series that I've sent some time ago (v2) already do
better than this :-P, since that would get call only once in
xen/Makefile (instead of everytime Rules.mk is called again).

I don't have a better suggestion that could work without colliding with
my series, but it won't be too hard to rebase.

Thanks,
Jan Beulich Feb. 25, 2020, 1:53 p.m. UTC | #2
On 21.02.2020 19:55, Andrew Cooper wrote:
> The way -mskip-rax-setup is currently specified results in compiler support
> being evaluated per translation unit, rather than per subdir.  Switch to using
> cc-add-option instead.
> 
> This drops the number of callouts from 428 to 60.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

I have to admit that I find it odd that you post such a patch
when earlier on you've objected to my "x86: determine HAVE_AS_*
just once" because Anthony already having this work in progress.
I'm happy to see this go in independently, especially if you
really think ...

> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Wei Liu <wl@xen.org>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Anthony PERARD <anthony.perard@citrix.com>
> 
> This drops about 0.5s from my ccache-accelerated but otherwise-clean build,
> and will likely have a more pronounced difference on older hardware.  If it
> wants backporting, it wants to go back in this form.

... it may want backporting (of which I'm not convinced), and
seeing Anthony would be okay to re-base over it:

Reviewed-by: Jan Beulich <jbeulich@suse.com>

But then I'd like to ask you to re-consider your objection to
my patch as well. In particular, if this one was worth
backporting, then I guess the other one would be, too.

Jan

Patch
diff mbox series

diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index e69b8e697c..78fa312d38 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -63,7 +63,8 @@  CFLAGS += -mno-red-zone -fpic -fno-asynchronous-unwind-tables
 
 # Xen doesn't use SSE interally.  If the compiler supports it, also skip the
 # SSE setup for variadic function calls.
-CFLAGS += -mno-sse $(call cc-option,$(CC),-mskip-rax-setup)
+CFLAGS += -mno-sse
+$(call cc-option-add,CFLAGS,CC,-mskip-rax-setup)
 
 # Compile with thunk-extern, indirect-branch-register if avaiable.
 ifeq ($(CONFIG_INDIRECT_THUNK),y)