Skip to contentSkip to conversation

x86_64: Use the x86-64 level for purgatory

PATCH In review Ross Lagerwall 2 participants 3 messages Apr 17, 2025 – Apr 23, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86_64: Use the x86-64 level for purgatory

The compiler may be configured by default to use a newer microarchitecture level such as x86-64-v3. Set purgatory to compile using the baseline x86-64 level since the environment isn't set up correctly to use SSE and AVX instructions. At the same time, be a bit paranoid and add some additional flags to ensure that the compiler doesn't use any such instructions.

---
 purgatory/arch/x86_64/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
purgatory/arch/x86_64/Makefile +1 -1
index b0e277a365b2..fd19229a2bf4 100644
@@ -24,5 +24,5 @@ x86_64_PURGATORY_SRCS += purgatory/arch/i386/vga.c
 x86_64_PURGATORY_SRCS += purgatory/arch/i386/pic.c
 
 ifneq ($(SUBARCH),x32)
-x86_64_PURGATORY_EXTRA_CFLAGS = -mcmodel=large
+x86_64_PURGATORY_EXTRA_CFLAGS = -mcmodel=large -march=x86-64 -mno-mmx -mno-sse -mno-sse2 -mno-avx
 endif
Signature · 1 line
2.49.0
#1 lore raw
Quoted 8 lines · Ross Lagerwall

The compiler may be configured by default to use a newer microarchitecture level such as x86-64-v3. Set purgatory to compile using the baseline x86-64 level since the environment isn't set up correctly to use SSE and AVX instructions. At the same time, be a bit paranoid and add some additional flags to ensure that the compiler doesn't use any such instructions.

Thanks Ross, applied for inclusion in v2.0.32.

#2 lore raw
Quoted 11 lines · Simon Horman
Quoted 8 lines · Ross Lagerwall

The compiler may be configured by default to use a newer microarchitecture level such as x86-64-v3. Set purgatory to compile using the baseline x86-64 level since the environment isn't set up correctly to use SSE and AVX instructions. At the same time, be a bit paranoid and add some additional flags to ensure that the compiler doesn't use any such instructions.

Thanks Ross, applied for inclusion in v2.0.32.

Sorry, I forgot to add this yesterday (I am not a robot :). The patch can be found at:

- x86_64: Use the x86-64 level for purgatory
https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?id=14f48ea80e51