Skip to contentSkip to conversation

x86/build: Fix -mskip-rax-setup handling

PATCH In review Andrew Cooper 3 participants 3 messages Feb 21, 2020 – Feb 25, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/build: Fix -mskip-rax-setup handling

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.

---
CC: Jan Beulich <[email protected]>
CC: Wei Liu <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Anthony PERARD <[email protected]>

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(-)
xen/arch/x86/Rules.mk +2 -1
index e69b8e697c..78fa312d38 100644
@@ -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)
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw
Quoted 13 lines · Andrew Cooper

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.

---
CC: Jan Beulich <[email protected]>
CC: Wei Liu <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Anthony PERARD <[email protected]>

Quoted 7 lines

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,

Signature · 6 lines
Anthony PERARD

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v1 1/1
#2 lore raw
In reply to Andrew Cooper
Quoted 7 lines · Andrew Cooper

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.

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

Quoted 9 lines

---
CC: Jan Beulich <[email protected]>
CC: Wei Liu <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Anthony PERARD <[email protected]>

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:

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

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel