linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug report] x86/hyperv: Add Write/Read MSR registers via ghcb page
@ 2023-01-16  8:37 Dan Carpenter
  2023-01-17 10:56 ` Jinank Jain
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2023-01-16  8:37 UTC (permalink / raw)
  To: Tianyu.Lan; +Cc: linux-hyperv, Jinank Jain

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-17 11:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2023-01-17 11:00   ` Dan Carpenter
2023-01-17 11:06     ` Dan Carpenter

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