public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: selftests: Fix build on on non-x86 architectures
@ 2024-10-21 22:11 Mark Brown
  2024-10-21 22:50 ` Linus Torvalds
  2024-10-22 12:10 ` Vitaly Kuznetsov
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Brown @ 2024-10-21 22:11 UTC (permalink / raw)
  To: Paolo Bonzini, Shuah Khan, Vitaly Kuznetsov, Linus Torvalds
  Cc: kvm, linux-kselftest, linux-kernel, 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")
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/kvm/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index e6b7e01d57080b304b21120f0d47bda260ba6c43..156fbfae940feac649f933dc6e048a2e2926542a 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -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,
-- 
Mark Brown <broonie@kernel.org>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: selftests: Fix build on on non-x86 architectures
  2024-10-21 22:11 [PATCH] KVM: selftests: Fix build on on non-x86 architectures Mark Brown
@ 2024-10-21 22:50 ` Linus Torvalds
  2024-10-22 12:10 ` Vitaly Kuznetsov
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Torvalds @ 2024-10-21 22:50 UTC (permalink / raw)
  To: Mark Brown
  Cc: Paolo Bonzini, Shuah Khan, Vitaly Kuznetsov, kvm, linux-kselftest,
	linux-kernel

On Mon, 21 Oct 2024 at 15:16, Mark Brown <broonie@kernel.org> wrote:
>
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: selftests: Fix build on on non-x86 architectures
  2024-10-21 22:11 [PATCH] KVM: selftests: Fix build on on non-x86 architectures Mark Brown
  2024-10-21 22:50 ` Linus Torvalds
@ 2024-10-22 12:10 ` Vitaly Kuznetsov
  1 sibling, 0 replies; 3+ messages in thread
From: Vitaly Kuznetsov @ 2024-10-22 12:10 UTC (permalink / raw)
  To: Mark Brown
  Cc: kvm, linux-kselftest, linux-kernel, Paolo Bonzini, Shuah Khan,
	Linus Torvalds

Mark Brown <broonie@kernel.org> writes:

> 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")
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>  tools/testing/selftests/kvm/Makefile | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
> index e6b7e01d57080b304b21120f0d47bda260ba6c43..156fbfae940feac649f933dc6e048a2e2926542a 100644
> --- a/tools/testing/selftests/kvm/Makefile
> +++ b/tools/testing/selftests/kvm/Makefile
> @@ -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,

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

Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>

Thanks for the quick fixup!

-- 
Vitaly


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-22 12:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-21 22:11 [PATCH] KVM: selftests: Fix build on on non-x86 architectures Mark Brown
2024-10-21 22:50 ` Linus Torvalds
2024-10-22 12:10 ` Vitaly Kuznetsov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox