[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <110961.1619155674@turing-police>
Date: Fri, 23 Apr 2021 01:27:54 -0400
From: "Valdis Klētnieks" <valdis.kletnieks@...edu>
To: Nathan Chancellor <nathan@...nel.org>
Cc: Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
clang-built-linux@...glegroups.com, linux-kernel@...r.kernel.org,
Kai Huang <kai.huang@...el.com>
Subject: Re: [PATCH] KVM: x86: Fix implicit enum conversion goof in scattered reverse CPUID code
On Wed, 21 Apr 2021 10:10:15 -0700, Nathan Chancellor said:
> Unfortunately, gcc's -Wenum-conversion is behind -Wextra rather than
> -Wall like clang. If you explicitly enable it with
> KCFLAGS=-Wenum-conversion to your make invocation, it will warn in the
> exact same way as clang:
>
> arch/x86/kvm/cpuid.c: In function 'kvm_set_cpu_caps':
> arch/x86/kvm/cpuid.c:499:29: warning: implicit conversion from 'enum kvm_only_cpuid_leafs' to 'enum cpuid_leafs' [-Wenum-conversion]
> 499 | kvm_cpu_cap_init_scattered(CPUID_12_EAX,
> | ^~~~~~~~~~~~
> arch/x86/kvm/cpuid.c: In function '__do_cpuid_func':
> arch/x86/kvm/cpuid.c:837:31: warning: implicit conversion from 'enum kvm_only_cpuid_leafs' to 'enum cpuid_leafs' [-Wenum-conversion]
> 837 | cpuid_entry_override(entry, CPUID_12_EAX);
> | ^~~~~~~~~~~~
>
> clang's warning for comparison/posterity:
>
> arch/x86/kvm/cpuid.c:499:29: warning: implicit conversion from enumeration type 'enum kvm_only_cpuid_leafs' to different enumeration type 'enum cpuid_leafs'
[-Wenum-conversion]
> kvm_cpu_cap_init_scattered(CPUID_12_EAX,
> ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~
> arch/x86/kvm/cpuid.c:837:31: warning: implicit conversion from enumeration type 'enum kvm_only_cpuid_leafs' to different enumeration type 'enum cpuid_leafs'
[-Wenum-conversion]
> cpuid_entry_override(entry, CPUID_12_EAX);
> ~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~
> 2 warnings generated.
Note that this will kill the build if you have CONFIG_KVM_WERROR=y in effect
(which was a reasonable thing to do when KVM built just fine with it in effect).
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists