From: kernel test robot <lkp@intel.com>
To: aubrey.li@linux.intel.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [anolis-intel-cloud:devel-6.6 0/94] arch/x86/kvm/svm/csv.c:774:6: warning: variable 'pfn' is used uninitialized whenever 'if' condition is true
Date: Sat, 10 May 2025 13:54:25 +0800 [thread overview]
Message-ID: <202505101324.MRXaYYFi-lkp@intel.com> (raw)
tree: https://gitee.com/anolis/intel-cloud-kernel.git devel-6.6
head: a79e0786f3fa90fd521f198ac6ccf6b11dbf67c2
commit: c0bfce1e4fad37d7dd413e3ef813e18edd738d4f [0/94] anolis: KVM: SVM: CSV: Manage CSV3 guest's nested page table
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250510/202505101324.MRXaYYFi-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
rustc: rustc 1.73.0 (cc66ad468 2023-10-03)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250510/202505101324.MRXaYYFi-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505101324.MRXaYYFi-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> arch/x86/kvm/svm/csv.c:774:6: warning: variable 'pfn' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
774 | if (error_code & PFERR_PRESENT_MASK)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/kvm/svm/csv.c:787:15: note: uninitialized use occurs here
787 | &psp_ret, pfn, level);
| ^~~
arch/x86/kvm/svm/csv.c:774:2: note: remove the 'if' if its condition is always false
774 | if (error_code & PFERR_PRESENT_MASK)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
775 | level = CSV3_PG_LEVEL_4K;
| ~~~~~~~~~~~~~~~~~~~~~~~~~
776 | else {
| ~~~~
arch/x86/kvm/svm/csv.c:771:15: note: initialize the variable 'pfn' to silence this warning
771 | kvm_pfn_t pfn;
| ^
| = 0
1 warning generated.
vim +774 arch/x86/kvm/svm/csv.c
764
765 static int csv3_page_fault(struct kvm_vcpu *vcpu, struct kvm_memory_slot *slot,
766 gfn_t gfn, u32 error_code)
767 {
768 int ret = 0;
769 int psp_ret = 0;
770 int level;
771 kvm_pfn_t pfn;
772 struct kvm_csv_info *csv = &to_kvm_svm_csv(vcpu->kvm)->csv_info;
773
> 774 if (error_code & PFERR_PRESENT_MASK)
775 level = CSV3_PG_LEVEL_4K;
776 else {
777 mutex_lock(&csv->shared_page_block_lock);
778 ret = csv3_pin_shared_memory(vcpu, slot, gfn, &pfn);
779 mutex_unlock(&csv->shared_page_block_lock);
780 if (ret)
781 goto exit;
782
783 level = csv3_mapping_level(vcpu, gfn, pfn, slot);
784 }
785
786 ret = __csv3_page_fault(vcpu, gfn << PAGE_SHIFT, error_code, slot,
787 &psp_ret, pfn, level);
788
789 if (psp_ret != SEV_RET_SUCCESS)
790 ret = -EFAULT;
791 exit:
792 return ret;
793 }
794
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-05-10 5:54 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=202505101324.MRXaYYFi-lkp@intel.com \
--to=lkp@intel.com \
--cc=aubrey.li@linux.intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.