[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4ce5ed1c-78e5-8150-65cd-288f1023c7a0@redhat.com>
Date: Thu, 24 Feb 2022 15:23:12 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Sean Christopherson <seanjc@...gle.com>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>
Cc: Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
llvm@...ts.linux.dev, linux-kernel@...r.kernel.org,
Like Xu <like.xu.linux@...il.com>
Subject: Re: [PATCH] KVM: x86: Fix pointer mistmatch warning when patching
RET0 static calls
On 2/23/22 17:23, Sean Christopherson wrote:
> Cast kvm_x86_ops.func to 'void *' when updating KVM static calls that are
> conditionally patched to __static_call_return0(). clang complains about
> using mismatching pointers in the ternary operator, which breaks the
> build when compiling with CONFIG_KVM_WERROR=y.
>
> >> arch/x86/include/asm/kvm-x86-ops.h:82:1: warning: pointer type mismatch
> ('bool (*)(struct kvm_vcpu *)' and 'void *') [-Wpointer-type-mismatch]
>
> Fixes: 5be2226f417d ("KVM: x86: allow defining return-0 static calls")
> Reported-by: Like Xu <like.xu.linux@...il.com>
> Reported-by: kernel test robot <lkp@...el.com>
> Signed-off-by: Sean Christopherson <seanjc@...gle.com>
> ---
> arch/x86/include/asm/kvm_host.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
> index 713e08f62385..f285ddb8b66b 100644
> --- a/arch/x86/include/asm/kvm_host.h
> +++ b/arch/x86/include/asm/kvm_host.h
> @@ -1547,8 +1547,8 @@ static inline void kvm_ops_static_call_update(void)
> WARN_ON(!kvm_x86_ops.func); __KVM_X86_OP(func)
> #define KVM_X86_OP_OPTIONAL __KVM_X86_OP
> #define KVM_X86_OP_OPTIONAL_RET0(func) \
> - static_call_update(kvm_x86_##func, kvm_x86_ops.func ? : \
> - (void *) __static_call_return0);
> + static_call_update(kvm_x86_##func, (void *)kvm_x86_ops.func ? : \
> + (void *)__static_call_return0);
> #include <asm/kvm-x86-ops.h>
> #undef __KVM_X86_OP
> }
>
> base-commit: f4bc051fc91ab9f1d5225d94e52d369ef58bec58
Queued, thanks.
Paolo
Powered by blists - more mailing lists