[intel-tdx:kvm-upstream-workaround 150/308] arch/x86/kvm/mmu/mmu.c:7276 __mem_attr_is_mixed() error: uninitialized symbol 'entry'.

From: Dan Carpenter
Date: Thu Aug 18 2022 - 06:49:41 EST


tree: https://github.com/intel/tdx.git kvm-upstream-workaround
head: 85c097fdd1667a842a9e75d8f658fc16bd72981a
commit: a3b11dafa9058bdecc235b9c02aaae2d6b39c24d [150/308] KVM: Update lpage info when private/shared memory are mixed
config: x86_64-randconfig-m001-20220815 (https://download.01.org/0day-ci/archive/20220817/202208170542.XpJ3DGlU-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

smatch warnings:
arch/x86/kvm/mmu/mmu.c:7276 __mem_attr_is_mixed() error: uninitialized symbol 'entry'.

vim +/entry +7276 arch/x86/kvm/mmu/mmu.c

a3b11dafa9058b Chao Peng 2022-07-20 7265 static bool __mem_attr_is_mixed(struct kvm *kvm, gfn_t start, gfn_t end)
a3b11dafa9058b Chao Peng 2022-07-20 7266 {
a3b11dafa9058b Chao Peng 2022-07-20 7267 XA_STATE(xas, &kvm->mem_attr_array, start);
a3b11dafa9058b Chao Peng 2022-07-20 7268 bool mixed = false;
a3b11dafa9058b Chao Peng 2022-07-20 7269 gfn_t gfn = start;
a3b11dafa9058b Chao Peng 2022-07-20 7270 void *s_entry;
a3b11dafa9058b Chao Peng 2022-07-20 7271 void *entry;
a3b11dafa9058b Chao Peng 2022-07-20 7272
a3b11dafa9058b Chao Peng 2022-07-20 7273 rcu_read_lock();
a3b11dafa9058b Chao Peng 2022-07-20 7274 s_entry = xas_load(&xas);
a3b11dafa9058b Chao Peng 2022-07-20 7275 while (gfn < end) {
a3b11dafa9058b Chao Peng 2022-07-20 @7276 if (xas_retry(&xas, entry))
^^^^^
Uninitialized

a3b11dafa9058b Chao Peng 2022-07-20 7277 continue;
a3b11dafa9058b Chao Peng 2022-07-20 7278
a3b11dafa9058b Chao Peng 2022-07-20 7279 KVM_BUG_ON(gfn != xas.xa_index, kvm);
a3b11dafa9058b Chao Peng 2022-07-20 7280
a3b11dafa9058b Chao Peng 2022-07-20 7281 entry = xas_next(&xas);
a3b11dafa9058b Chao Peng 2022-07-20 7282 if (entry != s_entry) {
a3b11dafa9058b Chao Peng 2022-07-20 7283 mixed = true;
a3b11dafa9058b Chao Peng 2022-07-20 7284 break;
a3b11dafa9058b Chao Peng 2022-07-20 7285 }
a3b11dafa9058b Chao Peng 2022-07-20 7286 gfn++;
a3b11dafa9058b Chao Peng 2022-07-20 7287 }
a3b11dafa9058b Chao Peng 2022-07-20 7288 rcu_read_unlock();
a3b11dafa9058b Chao Peng 2022-07-20 7289 return mixed;
a3b11dafa9058b Chao Peng 2022-07-20 7290 }

--
0-DAY CI Kernel Test Service
https://01.org/lkp