From: kernel test robot <lkp@intel.com>
To: Nicolin Chen <nicolinc@nvidia.com>, jgg@nvidia.com, kevin.tian@intel.com
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
yi.l.liu@intel.com, iommu@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] iommufd/device: Make hwpt_list list_add/del symmetric
Date: Sat, 28 Jan 2023 19:52:54 +0800 [thread overview]
Message-ID: <202301281943.Jdvwci2p-lkp@intel.com> (raw)
In-Reply-To: <25b3b85b03fc2a7968c476b0533f451acecdfd13.1674872884.git.nicolinc@nvidia.com>
Hi Nicolin,
I love your patch! Perhaps something to improve:
[auto build test WARNING on v6.2-rc5]
[also build test WARNING on linus/master next-20230127]
[cannot apply to joro-iommu/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Nicolin-Chen/iommufd-Add-devices_users-to-track-the-hw_pagetable-usage-by-device/20230128-150429
patch link: https://lore.kernel.org/r/25b3b85b03fc2a7968c476b0533f451acecdfd13.1674872884.git.nicolinc%40nvidia.com
patch subject: [PATCH 2/3] iommufd/device: Make hwpt_list list_add/del symmetric
config: x86_64-randconfig-a011-20230123 (https://download.01.org/0day-ci/archive/20230128/202301281943.Jdvwci2p-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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-lab-lkp/linux/commit/4d48fdd86375f6d888bbcf830a10c48720008955
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Nicolin-Chen/iommufd-Add-devices_users-to-track-the-hw_pagetable-usage-by-device/20230128-150429
git checkout 4d48fdd86375f6d888bbcf830a10c48720008955
# 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 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/iommu/iommufd/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/iommu/iommufd/device.c:279:23: warning: variable 'hwpt' is uninitialized when used here [-Wuninitialized]
lockdep_assert_held(&hwpt->ioas->mutex);
^~~~
include/linux/lockdep.h:319:33: note: expanded from macro 'lockdep_assert_held'
lockdep_assert(lockdep_is_held(l) != LOCK_STATE_NOT_HELD)
^
include/linux/lockdep.h:286:47: note: expanded from macro 'lockdep_is_held'
#define lockdep_is_held(lock) lock_is_held(&(lock)->dep_map)
^~~~
include/linux/lockdep.h:313:32: note: expanded from macro 'lockdep_assert'
do { WARN_ON(debug_locks && !(cond)); } while (0)
^~~~
include/asm-generic/bug.h:122:25: note: expanded from macro 'WARN_ON'
int __ret_warn_on = !!(condition); \
^~~~~~~~~
drivers/iommu/iommufd/device.c:276:35: note: initialize the variable 'hwpt' to silence this warning
struct iommufd_hw_pagetable *hwpt;
^
= NULL
1 warning generated.
vim +/hwpt +279 drivers/iommu/iommufd/device.c
267
268 /*
269 * When automatically managing the domains we search for a compatible domain in
270 * the iopt and if one is found use it, otherwise create a new domain.
271 * Automatic domain selection will never pick a manually created domain.
272 */
273 static int iommufd_device_auto_get_domain(struct iommufd_device *idev,
274 struct iommufd_ioas *ioas)
275 {
276 struct iommufd_hw_pagetable *hwpt;
277 int rc;
278
> 279 lockdep_assert_held(&hwpt->ioas->mutex);
280
281 /*
282 * There is no differentiation when domains are allocated, so any domain
283 * that is willing to attach to the device is interchangeable with any
284 * other.
285 */
286 list_for_each_entry(hwpt, &ioas->hwpt_list, hwpt_item) {
287 if (!hwpt->auto_domain)
288 continue;
289
290 rc = iommufd_device_do_attach(idev, hwpt);
291
292 /*
293 * -EINVAL means the domain is incompatible with the device.
294 * Other error codes should propagate to userspace as failure.
295 * Success means the domain is attached.
296 */
297 if (rc == -EINVAL)
298 continue;
299 return rc;
300 }
301
302 hwpt = iommufd_hw_pagetable_alloc(idev->ictx, ioas, idev->dev);
303 if (IS_ERR(hwpt))
304 return PTR_ERR(hwpt);
305 hwpt->auto_domain = true;
306
307 rc = iommufd_device_do_attach(idev, hwpt);
308 if (rc)
309 goto out_abort;
310
311 iommufd_object_finalize(idev->ictx, &hwpt->obj);
312 return 0;
313
314 out_abort:
315 iommufd_object_abort_and_destroy(idev->ictx, &hwpt->obj);
316 return rc;
317 }
318
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next parent reply other threads:[~2023-01-28 11:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <25b3b85b03fc2a7968c476b0533f451acecdfd13.1674872884.git.nicolinc@nvidia.com>
2023-01-28 11:52 ` kernel test robot [this message]
2023-01-28 20:27 ` [PATCH 2/3] iommufd/device: Make hwpt_list list_add/del symmetric Nicolin Chen
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=202301281943.Jdvwci2p-lkp@intel.com \
--to=lkp@intel.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nicolinc@nvidia.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=yi.l.liu@intel.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