[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202204230602.MCSINBa4-lkp@intel.com>
Date: Sat, 23 Apr 2022 06:51:39 +0800
From: kernel test robot <lkp@...el.com>
To: Isaku Yamahata <isaku.yamahata@...el.com>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org
Subject: [intel-tdx:kvm-upstream-workaround 190/293]
arch/x86/virt/vmx/tdx/tdx_debug.c:38:6: warning: variable 'ret' is used
uninitialized whenever 'if' condition is false
tree: https://github.com/intel/tdx.git kvm-upstream-workaround
head: d32e9a403c5c4f16dc577cbe92148e5b80f79d59
commit: eed43994431837da508aed7b50717777818c1837 [190/293] [REVERTME] debugfs to operation on TDX debug op
config: x86_64-allmodconfig (https://download.01.org/0day-ci/archive/20220423/202204230602.MCSINBa4-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5bd87350a5ae429baf8f373cb226a57b62f87280)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel/tdx/commit/eed43994431837da508aed7b50717777818c1837
git remote add intel-tdx https://github.com/intel/tdx.git
git fetch --no-tags intel-tdx kvm-upstream-workaround
git checkout eed43994431837da508aed7b50717777818c1837
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> arch/x86/virt/vmx/tdx/tdx_debug.c:38:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (debugconfig_supported) {
^~~~~~~~~~~~~~~~~~~~~
arch/x86/virt/vmx/tdx/tdx_debug.c:46:10: note: uninitialized use occurs here
return ret;
^~~
arch/x86/virt/vmx/tdx/tdx_debug.c:38:2: note: remove the 'if' if its condition is always true
if (debugconfig_supported) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/virt/vmx/tdx/tdx_debug.c:36:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
1 warning generated.
vim +38 arch/x86/virt/vmx/tdx/tdx_debug.c
32
33 static inline u64 tddebugconfig(u64 subleaf, u64 param1, u64 param2)
34 {
35 static bool debugconfig_supported = true;
36 int ret;
37
> 38 if (debugconfig_supported) {
39 ret = __seamcall(SEAMCALL_TDDEBUGCONFIG, subleaf, param1, param2, 0, NULL);
40 if (ret) {
41 pr_info("DEBUGCONFIG SEAMCALL isn't supported.\n");
42 debugconfig_supported = false;
43 }
44 }
45
46 return ret;
47 }
48
--
0-DAY CI Kernel Test Service
https://01.org/lkp
Powered by blists - more mailing lists