From: Jinank Jain <jinankjain@linux.microsoft.com>
To: Dan Carpenter <error27@gmail.com>, Tianyu.Lan@microsoft.com
Cc: linux-hyperv@vger.kernel.org
Subject: Re: [bug report] x86/hyperv: Add Write/Read MSR registers via ghcb page
Date: Tue, 17 Jan 2023 16:26:13 +0530 [thread overview]
Message-ID: <ac8ee542-1f60-fa66-99f5-d716cd2dff33@linux.microsoft.com> (raw)
In-Reply-To: <Y8UM59rdoCD0D6V2@kili>
Does making 0 as the default value makes sense?
Regards,
Jinank
On 1/16/2023 2:07 PM, Dan Carpenter wrote:
> Hello Tianyu Lan,
>
> The patch faff44069ff5: "x86/hyperv: Add Write/Read MSR registers via
> ghcb page" from Oct 25, 2021, leads to the following Smatch static
> checker warning:
>
> arch/x86/kernel/cpu/mshyperv.c:73 hv_get_non_nested_register()
> error: uninitialized symbol 'value'.
>
> arch/x86/kernel/cpu/mshyperv.c
> 63
> 64 #if IS_ENABLED(CONFIG_HYPERV)
> 65 u64 hv_get_non_nested_register(unsigned int reg)
> 66 {
> 67 u64 value;
> 68
> 69 if (hv_is_synic_reg(reg) && hv_isolation_type_snp())
> 70 hv_ghcb_msr_read(reg, &value);
> ^^^^^^
> There are three places in hv_ghcb_msr_read() which don't initialize
> value.
>
> 71 else
> 72 rdmsrl(reg, value);
> --> 73 return value;
> 74 }
>
> regards,
> dan carpenter
next prev parent reply other threads:[~2023-01-17 10:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-16 8:37 [bug report] x86/hyperv: Add Write/Read MSR registers via ghcb page Dan Carpenter
2023-01-17 10:56 ` Jinank Jain [this message]
2023-01-17 11:00 ` Dan Carpenter
2023-01-17 11:06 ` Dan Carpenter
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=ac8ee542-1f60-fa66-99f5-d716cd2dff33@linux.microsoft.com \
--to=jinankjain@linux.microsoft.com \
--cc=Tianyu.Lan@microsoft.com \
--cc=error27@gmail.com \
--cc=linux-hyperv@vger.kernel.org \
/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).