[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALMp9eQ8Rr-rSjXiZ_4O0mA=k3kk=hYrfB_NTszu=9DFOwNUaQ@mail.gmail.com>
Date: Wed, 21 Sep 2022 16:32:17 -0700
From: Jim Mattson <jmattson@...gle.com>
To: Vipin Sharma <vipinsh@...gle.com>
Cc: seanjc@...gle.com, pbonzini@...hat.com, vkuznets@...hat.com,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] KVM: selftests: Fix hyperv_features test failure when
built on Clang
On Wed, Sep 21, 2022 at 4:11 PM Vipin Sharma <vipinsh@...gle.com> wrote:
>
> hyperv_features test fails when built on Clang. It throws error:
>
> Failed guest assert: !hcall->ud_expected || res == hcall->expect at
> x86_64/hyperv_features.c:90
>
> On GCC, EAX is set to 0 before the hypercall whereas in Clang it is not,
> this causes EAX to have garbage value when hypercall is returned in Clang
> binary.
>
> Fix by executing the guest assertion only when ud_expected is false.
>
> Fixes: cc5851c6be86 ("KVM: selftests: Use exception fixup for #UD/#GP Hyper-V MSR/hcall tests")
> Signed-off-by: Vipin Sharma <vipinsh@...gle.com>
> Suggested-by: Sean Christopherson <seanjc@...gle.com>
>
> ---
> tools/testing/selftests/kvm/x86_64/hyperv_features.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
In case Sean doesn't point it out, be wary of starting a shortlog with
"Fix." You may later regret it.
Also, I think the "clang" part is a red herring. You are fixing a
latent bug in the code.
Reviewed-by: Jim Mattson <jmattson@...gle.com>
Powered by blists - more mailing lists