Skip to contentSkip to conversation

KVM: selftests: Fix build on on non-x86 architectures

PATCH In review Mark Brown 3 participants 3 messages Oct 21, 2024 – Oct 22, 2024

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 KVM: selftests: Fix build on on non-x86 architectures

Commit 9a400068a158 ("KVM: selftests: x86: Avoid using SSE/AVX instructions") unconditionally added -march=x86-64-v2 to the CFLAGS used to build the KVM selftests which does not work on non-x86 architectures:

cc1: error: unknown value ‘x86-64-v2’ for ‘-march’

Fix this by making the addition of this x86 specific command line flag conditional on building for x86.

Fixes 9a400068a158 ("KVM: selftests: x86: Avoid using SSE/AVX instructions")
---
 tools/testing/selftests/kvm/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/testing/selftests/kvm/Makefile +3 -1
index e6b7e01d57080b304b21120f0d47bda260ba6c43..156fbfae940feac649f933dc6e048a2e2926542a 100644
@@ -244,11 +244,13 @@ CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
 	-fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
 	-I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
 	-I$(<D) -Iinclude/$(ARCH_DIR) -I ../rseq -I.. $(EXTRA_CFLAGS) \
-	-march=x86-64-v2 \
 	$(KHDR_INCLUDES)
 ifeq ($(ARCH),s390)
 	CFLAGS += -march=z10
 endif
+ifeq ($(ARCH),x86)
+	CFLAGS += -march=x86-64-v2
+endif
 ifeq ($(ARCH),arm64)
 tools_dir := $(top_srcdir)/tools
 arm64_tools_dir := $(tools_dir)/arch/arm64/tools/

---
base-commit: d129377639907fce7e0a27990e590e4661d3ee02
change-id: 20241021-kvm-build-break-495abedc51e0

Best regards,

Signature · 1 line
Mark Brown <[email protected]>
#1 lore raw
Quoted 3 lines · Mark Brown

Fix this by making the addition of this x86 specific command line flag conditional on building for x86.

Applied directly, just to have this silly thing done with.

Thanks,

Linus

Reviewed-by on v1 1/1
#2 lore raw
In reply to Mark Brown
Quoted 39 lines · Mark Brown

Commit 9a400068a158 ("KVM: selftests: x86: Avoid using SSE/AVX instructions") unconditionally added -march=x86-64-v2 to the CFLAGS used to build the KVM selftests which does not work on non-x86 architectures:

cc1: error: unknown value ‘x86-64-v2’ for ‘-march’

Fix this by making the addition of this x86 specific command line flag conditional on building for x86.

Fixes 9a400068a158 ("KVM: selftests: x86: Avoid using SSE/AVX instructions")
---
 tools/testing/selftests/kvm/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/testing/selftests/kvm/Makefile +3 -2
index e6b7e01d57080b304b21120f0d47bda260ba6c43..156fbfae940feac649f933dc6e048a2e2926542a 100644
@@ -244,11 +244,13 @@ CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
 	-fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \
 	-I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \
 	-I$(<D) -Iinclude/$(ARCH_DIR) -I ../rseq -I.. $(EXTRA_CFLAGS) \
-	-march=x86-64-v2 \
 	$(KHDR_INCLUDES)
 ifeq ($(ARCH),s390)
 	CFLAGS += -march=z10
 endif
+ifeq ($(ARCH),x86)
+	CFLAGS += -march=x86-64-v2
+endif
 ifeq ($(ARCH),arm64)
 tools_dir := $(top_srcdir)/tools
 arm64_tools_dir := $(tools_dir)/arch/arm64/tools/
 
---

base-commit: d129377639907fce7e0a27990e590e4661d3ee02
change-id: 20241021-kvm-build-break-495abedc51e0

Quoted 1 line

Best regards,

I see this patch is already in Linus' tree, but anyway

Thanks for the quick fixup!

Signature · 1 line
Vitaly