kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: viremana@linux.microsoft.com
Cc: kvm@vger.kernel.org
Subject: [bug report] KVM: SVM: hyper-v: Enlightened MSR-Bitmap support
Date: Fri, 25 Jun 2021 13:21:14 +0300	[thread overview]
Message-ID: <YNWuGlKfZwZeN8CR@mwanda> (raw)

Hello Vineeth Pillai,

This is a semi-automatic email about new static checker warnings.

The patch c4327f15dfc7: "KVM: SVM: hyper-v: Enlightened MSR-Bitmap 
support" from Jun 3, 2021, leads to the following Smatch complaint:

    arch/x86/kvm/svm/svm_onhyperv.h:92 svm_hv_vmcb_dirty_nested_enlightenments()
    warn: variable dereferenced before check 'vmcb' (see line 84)

arch/x86/kvm/svm/svm_onhyperv.h
    83		struct hv_enlightenments *hve =
    84			(struct hv_enlightenments *)vmcb->control.reserved_sw;
                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^
Dereferenced

    85	
    86		/*
    87		 * vmcb can be NULL if called during early vcpu init.
                   ^^^^^^^^^^^^^^^^
Probably shouldn't be Dereferenced

    88		 * And its okay not to mark vmcb dirty during vcpu init
    89		 * as we mark it dirty unconditionally towards end of vcpu
    90		 * init phase.
    91		 */
    92		if (vmcb && vmcb_is_clean(vmcb, VMCB_HV_NESTED_ENLIGHTENMENTS) &&
                    ^^^^

    93		    hve->hv_enlightenments_control.msr_bitmap)
    94			vmcb_mark_dirty(vmcb, VMCB_HV_NESTED_ENLIGHTENMENTS);

regards,
dan carpenter

                 reply	other threads:[~2021-06-25 10:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=YNWuGlKfZwZeN8CR@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=viremana@linux.microsoft.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;
as well as URLs for NNTP newsgroup(s).