[PATCH] x86/boot: Optimise 32 bit C source code

Frediano Ziglio posted 1 patch 2 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20240909100428.47102-2-frediano.ziglio@cloud.com
There is a newer version of this series
xen/arch/x86/boot/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] x86/boot: Optimise 32 bit C source code
Posted by Frediano Ziglio 2 months, 1 week ago
The various filters are removing all optimisations.
No need to have all optimisations turned off.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/boot/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile
index 8f5bbff0cc..26737ce25b 100644
--- a/xen/arch/x86/boot/Makefile
+++ b/xen/arch/x86/boot/Makefile
@@ -13,7 +13,7 @@ $(obj)/head.o: $(head-bin-objs:.o=.bin)
 
 CFLAGS_x86_32 := $(subst -m64,-m32 -march=i686,$(XEN_TREEWIDE_CFLAGS))
 $(call cc-options-add,CFLAGS_x86_32,CC,$(EMBEDDED_EXTRA_CFLAGS))
-CFLAGS_x86_32 += -Werror -fno-builtin -g0 -msoft-float -mregparm=3
+CFLAGS_x86_32 += -Werror -fno-builtin -g0 -msoft-float -mregparm=3 -O2
 CFLAGS_x86_32 += -nostdinc -include $(filter %/include/xen/config.h,$(XEN_CFLAGS))
 CFLAGS_x86_32 += $(filter -I%,$(XEN_CFLAGS))
 
-- 
2.34.1
Re: [PATCH] x86/boot: Optimise 32 bit C source code
Posted by Jan Beulich 2 months, 1 week ago
On 09.09.2024 12:04, Frediano Ziglio wrote:
> The various filters are removing all optimisations.
> No need to have all optimisations turned off.

Yet also no reason to optimize more than the rest of the build, using -O1
for debug builds (and iirc we meant to switch to using -Og when available).

Jan