All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	kvm@vger.kernel.org, clang-built-linux@googlegroups.com,
	linux-kernel@vger.kernel.org, Kai Huang <kai.huang@intel.com>
Subject: Re: [PATCH] KVM: x86: Fix implicit enum conversion goof in scattered reverse CPUID code
Date: Fri, 23 Apr 2021 01:27:54 -0400	[thread overview]
Message-ID: <110961.1619155674@turing-police> (raw)
In-Reply-To: <YIBcd+5NKJFnkTC1@archlinux-ax161>

[-- Attachment #1: Type: text/plain, Size: 1692 bytes --]

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).


[-- Attachment #2: Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2021-04-23  5:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21  1:08 [PATCH] KVM: x86: Fix implicit enum conversion goof in scattered reverse CPUID code Sean Christopherson
2021-04-21 17:10 ` Nathan Chancellor
2021-04-23  5:27   ` Valdis Klētnieks [this message]
2021-04-23  7:08   ` Paolo Bonzini
2021-04-23  7:06 ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=110961.1619155674@turing-police \
    --to=valdis.kletnieks@vt.edu \
    --cc=clang-built-linux@googlegroups.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kai.huang@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.