[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87froctrgv.fsf@redhat.com>
Date: Thu, 31 Oct 2024 12:57:36 +0100
From: Vitaly Kuznetsov <vkuznets@...hat.com>
To: Sean Christopherson <seanjc@...gle.com>, Paolo Bonzini
<pbonzini@...hat.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org, Sean Christopherson
<seanjc@...gle.com>
Subject: Re: [PATCH] KVM: selftests: Don't force -march=x86-64-v2 if it's
unsupported
Sean Christopherson <seanjc@...gle.com> writes:
> Force -march=x86-64-v2 to avoid SSE/AVX instructions if and only if the
> uarch definition is supported by the compiler, e.g. gcc 7.5 only supports
> x86-64.
>
> Fixes: 9a400068a158 ("KVM: selftests: x86: Avoid using SSE/AVX instructions")
> Cc: Vitaly Kuznetsov <vkuznets@...hat.com>
> Signed-off-by: Sean Christopherson <seanjc@...gle.com>
> ---
>
> My big ol' AVX enabling series ain't looking so bad now ;-)
Smaller the change, bigger the troubles :-)
>
> tools/testing/selftests/kvm/Makefile | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
> index 156fbfae940f..5fa282643cff 100644
> --- a/tools/testing/selftests/kvm/Makefile
> +++ b/tools/testing/selftests/kvm/Makefile
> @@ -249,8 +249,10 @@ ifeq ($(ARCH),s390)
> CFLAGS += -march=z10
> endif
> ifeq ($(ARCH),x86)
> +ifeq ($(shell echo "void foo(void) { }" | $(CC) -march=x86-64-v2 -x c - -c -o /dev/null 2>/dev/null; echo "$$?"),0)
With this test, the outer "ifeq ($(ARCH),x86)" check is not really
needed anymore I guess?
> CFLAGS += -march=x86-64-v2
> endif
> +endif
> ifeq ($(ARCH),arm64)
> tools_dir := $(top_srcdir)/tools
> arm64_tools_dir := $(tools_dir)/arch/arm64/tools/
>
> base-commit: 81983758430957d9a5cb3333fe324fd70cf63e7e
Reviewed-and-tested-by: Vitaly Kuznetsov <vkuznets@...hat.com>
--
Vitaly
Powered by blists - more mailing lists