From: Paolo Bonzini <pbonzini@redhat.com>
To: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: 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
Subject: Re: [PATCH] KVM: nVMX: Replace a BUG_ON(1) with BUG() to squash clang warning
Date: Mon, 4 May 2020 17:59:13 +0200 [thread overview]
Message-ID: <5bf03dc1-c5b1-8264-6361-e85c523a2fa4@redhat.com> (raw)
In-Reply-To: <20200504153506.28898-1-sean.j.christopherson@intel.com>
On 04/05/20 17:35, Sean Christopherson wrote:
> Use BUG() in the impossible-to-hit default case when switching on the
> scope of INVEPT to squash a warning with clang 11 due to clang treating
> the BUG_ON() as conditional.
>
> >> arch/x86/kvm/vmx/nested.c:5246:3: warning: variable 'roots_to_free'
> is used uninitialized whenever 'if' condition is false
> [-Wsometimes-uninitialized]
> BUG_ON(1);
>
> Reported-by: kbuild test robot <lkp@intel.com>
> Fixes: ce8fe7b77bd8 ("KVM: nVMX: Free only the affected contexts when emulating INVEPT")
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
> ---
> arch/x86/kvm/vmx/nested.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> index 2c36f3f53108..669445136144 100644
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
> @@ -5249,7 +5249,7 @@ static int handle_invept(struct kvm_vcpu *vcpu)
> roots_to_free = KVM_MMU_ROOTS_ALL;
> break;
> default:
> - BUG_ON(1);
> + BUG();
> break;
> }
>
>
Queued, thanks.
Paolo
prev parent reply other threads:[~2020-05-04 15:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-04 15:35 Sean Christopherson
2020-05-04 15:59 ` Paolo Bonzini [this message]
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=5bf03dc1-c5b1-8264-6361-e85c523a2fa4@redhat.com \
--to=pbonzini@redhat.com \
--cc=clang-built-linux@googlegroups.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sean.j.christopherson@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®