From: kernel test robot <lkp@intel.com>
To: Yifan Zhang <yifan1.zhang@amd.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>,
Alex Deucher <alexander.deucher@amd.com>
Subject: [linux-next:master 10184/11353] drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_device_queue_manager.c:508:6: warning: variable 'vmid' is used uninitialized whenever 'if' condition is false
Date: Wed, 9 Mar 2022 03:14:30 +0800 [thread overview]
Message-ID: <202203090313.LRIlHhjL-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: cb153b68ff91cbc434f3de70ac549e110543e1bb
commit: c8b0507f40deea3d5014b5b4989b6a06ffedde70 [10184/11353] drm/amdkfd: judge get_atc_vmid_pasid_mapping_info before call
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20220309/202203090313.LRIlHhjL-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e)
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
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=c8b0507f40deea3d5014b5b4989b6a06ffedde70
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout c8b0507f40deea3d5014b5b4989b6a06ffedde70
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/gpu/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_device_queue_manager.c:508:6: warning: variable 'vmid' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (dev->kfd2kgd->get_atc_vmid_pasid_mapping_info) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_device_queue_manager.c:521:6: note: uninitialized use occurs here
if (vmid > last_vmid_to_scan) {
^~~~
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_device_queue_manager.c:508:2: note: remove the 'if' if its condition is always true
if (dev->kfd2kgd->get_atc_vmid_pasid_mapping_info) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_device_queue_manager.c:490:19: note: initialize the variable 'vmid' to silence this warning
unsigned int vmid;
^
= 0
1 warning generated.
vim +508 drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_device_queue_manager.c
486
487 static int dbgdev_wave_reset_wavefronts(struct kfd_dev *dev, struct kfd_process *p)
488 {
489 int status = 0;
490 unsigned int vmid;
491 uint16_t queried_pasid;
492 union SQ_CMD_BITS reg_sq_cmd;
493 union GRBM_GFX_INDEX_BITS reg_gfx_index;
494 struct kfd_process_device *pdd;
495 int first_vmid_to_scan = dev->vm_info.first_vmid_kfd;
496 int last_vmid_to_scan = dev->vm_info.last_vmid_kfd;
497
498 reg_sq_cmd.u32All = 0;
499 reg_gfx_index.u32All = 0;
500
501 pr_debug("Killing all process wavefronts\n");
502
503 /* Scan all registers in the range ATC_VMID8_PASID_MAPPING ..
504 * ATC_VMID15_PASID_MAPPING
505 * to check which VMID the current process is mapped to.
506 */
507
> 508 if (dev->kfd2kgd->get_atc_vmid_pasid_mapping_info) {
509 for (vmid = first_vmid_to_scan; vmid <= last_vmid_to_scan; vmid++) {
510 status = dev->kfd2kgd->get_atc_vmid_pasid_mapping_info
511 (dev->adev, vmid, &queried_pasid);
512
513 if (status && queried_pasid == p->pasid) {
514 pr_debug("Killing wave fronts of vmid %d and pasid 0x%x\n",
515 vmid, p->pasid);
516 break;
517 }
518 }
519 }
520
521 if (vmid > last_vmid_to_scan) {
522 pr_err("Didn't find vmid for pasid 0x%x\n", p->pasid);
523 return -EFAULT;
524 }
525
526 /* taking the VMID for that process on the safe way using PDD */
527 pdd = kfd_get_process_device_data(dev, p);
528 if (!pdd)
529 return -EFAULT;
530
531 reg_gfx_index.bits.sh_broadcast_writes = 1;
532 reg_gfx_index.bits.se_broadcast_writes = 1;
533 reg_gfx_index.bits.instance_broadcast_writes = 1;
534 reg_sq_cmd.bits.mode = SQ_IND_CMD_MODE_BROADCAST;
535 reg_sq_cmd.bits.cmd = SQ_IND_CMD_CMD_KILL;
536 reg_sq_cmd.bits.vm_id = vmid;
537
538 dev->kfd2kgd->wave_control_execute(dev->adev,
539 reg_gfx_index.u32All,
540 reg_sq_cmd.u32All);
541
542 return 0;
543 }
544
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
reply other threads:[~2022-03-08 19:14 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=202203090313.LRIlHhjL-lkp@intel.com \
--to=lkp@intel.com \
--cc=alexander.deucher@amd.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
--cc=llvm@lists.linux.dev \
--cc=yifan1.zhang@amd.com \
/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