Skip to contentSkip to conversation

x86/boot: Optimise 32 bit C source code

PATCH In review Frediano Ziglio 2 participants 3 messages Sep 9, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/2 x86/boot: Optimise 32 bit C source code

The various filters are removing all optimisations. No need to have all optimisations turned off.

---
 xen/arch/x86/boot/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

---
Changes since v2:
- combine filter calls together;
- added additional patch.

xen/arch/x86/boot/Makefile +1 -1
index 8f5bbff0cc..dfe3cb7034 100644
@@ -15,7 +15,7 @@ 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 += -nostdinc -include $(filter %/include/xen/config.h,$(XEN_CFLAGS))
-CFLAGS_x86_32 += $(filter -I%,$(XEN_CFLAGS))
+CFLAGS_x86_32 += $(filter -I% -O%,$(XEN_CFLAGS))
 
 # override for 32bit binaries
 $(head-bin-objs): CFLAGS_stack_boundary :=
Signature · 1 line
2.34.1
#1 lore raw

PATCH v4 2/2 x86/boot: Add missing __XEN__ definition

We are compiling Xen source code so we should define __XEN__ macro. We don't want to import all definitions from XEN_CFLAGS (as done for other options) because most of them are processor dependent and do not apply to 32 bit.

---
 xen/arch/x86/boot/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

---
Changes since v3:
- improve commit message.

xen/arch/x86/boot/Makefile +1 -1
index dfe3cb7034..ff0f965876 100644
@@ -15,7 +15,7 @@ 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 += -nostdinc -include $(filter %/include/xen/config.h,$(XEN_CFLAGS))
-CFLAGS_x86_32 += $(filter -I% -O%,$(XEN_CFLAGS))
+CFLAGS_x86_32 += $(filter -I% -O%,$(XEN_CFLAGS)) -D__XEN__
 
 # override for 32bit binaries
 $(head-bin-objs): CFLAGS_stack_boundary :=
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v4 2/2] x86/boot: Add missing __XEN__ definition

Quoted 6 lines · Frediano Ziglio

We are compiling Xen source code so we should define __XEN__ macro. We don't want to import all definitions from XEN_CFLAGS (as done for other options) because most of them are processor dependent and do not apply to 32 bit.

Both Acked-by: Andrew Cooper <[email protected]> and queued.