All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Yi Liu <yi.l.liu@intel.com>, Kevin Tian <kevin.tian@intel.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [yiliu1765-iommufd:wip/iommufd_pasid-0825 89/95] drivers/iommu/iommufd/device.c:303:7: error: implicit declaration of function 'msi_device_has_isolated_msi' is invalid in C99
Date: Fri, 25 Aug 2023 20:26:09 +0800	[thread overview]
Message-ID: <202308252002.DclKmsh1-lkp@intel.com> (raw)

tree:   https://github.com/yiliu1765/iommufd.git wip/iommufd_pasid-0825
head:   98c119bc01ddf99ad4ac7c3e93980e3d835c0901
commit: 867d3f502f6850f76ce3a3b29099e27e6a22e154 [89/95] iommufd: Add iommufd_device_bind_pasid()
config: hexagon-randconfig-r005-20230825 (https://download.01.org/0day-ci/archive/20230825/202308252002.DclKmsh1-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce: (https://download.01.org/0day-ci/archive/20230825/202308252002.DclKmsh1-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/202308252002.DclKmsh1-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/iommu/iommufd/device.c:6:
   In file included from include/linux/iommu.h:10:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __raw_readb(PCI_IOBASE + addr);
                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                                                     ^
   In file included from drivers/iommu/iommufd/device.c:6:
   In file included from include/linux/iommu.h:10:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                                                     ^
   In file included from drivers/iommu/iommufd/device.c:6:
   In file included from include/linux/iommu.h:10:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writeb(value, PCI_IOBASE + addr);
                               ~~~~~~~~~~ ^
   include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
>> drivers/iommu/iommufd/device.c:303:7: error: implicit declaration of function 'msi_device_has_isolated_msi' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
               !msi_device_has_isolated_msi(dev)) {
                ^
   6 warnings and 1 error generated.


vim +/msi_device_has_isolated_msi +303 drivers/iommu/iommufd/device.c

   260	
   261	/**
   262	 * iommufd_device_bind_pasid - Bind a virtual device to an iommu fd
   263	 * @ictx: iommufd file descriptor
   264	 * @dev: Pointer to the parent physical device struct
   265	 * @pasid: the pasid value representing vRID of this virtual device
   266	 * @id: Output ID number to return to userspace for this device
   267	 *
   268	 * The virtual device always tags its DMA with the provided pasid.
   269	 * A successful bind allows the pasid to be used in other iommufd
   270	 * operations e.g. attach/detach and returns struct iommufd_device
   271	 * pointer, otherwise returns error pointer.
   272	 *
   273	 * There is no ownership check per pasid. A driver using this API
   274	 * must already claim the DMA ownership over the parent device and
   275	 * the pasid is allocated by the driver itself.
   276	 *
   277	 * PASID is a device capability so unlike iommufd_device_bind() it
   278	 * has no iommu group associated.
   279	 *
   280	 * The caller must undo this with iommufd_device_unbind()
   281	 */
   282	struct iommufd_device *iommufd_device_bind_pasid(struct iommufd_ctx *ictx,
   283							 struct device *dev,
   284							 u32 pasid, u32 *id)
   285	{
   286		struct iommufd_device *idev;
   287		int rc;
   288	
   289		/*
   290		 * iommufd always sets IOMMU_CACHE because we offer no way for userspace
   291		 * to restore cache coherency.
   292		 */
   293		if (!device_iommu_capable(dev, IOMMU_CAP_CACHE_COHERENCY))
   294			return ERR_PTR(-EINVAL);
   295	
   296		/*
   297		 * No iommu supports pasid-granular msi message today. Here we
   298		 * just check whether the parent device can do safe interrupts.
   299		 * Isolation between virtual devices within the parent device
   300		 * relies on the parent driver to enforce.
   301		 */
   302		if (!iommufd_selftest_is_mock_dev(dev) &&
 > 303		    !msi_device_has_isolated_msi(dev)) {
   304			rc = iommufd_allow_unsafe_interrupts(dev);
   305			if (rc)
   306				return ERR_PTR(rc);
   307		}
   308	
   309		idev = iommufd_alloc_device(ictx, dev);
   310		if (IS_ERR(idev))
   311			return idev;
   312		idev->default_pasid = pasid;
   313	
   314		/*
   315		 * If the caller fails after this success it must call
   316		 * iommufd_unbind_device() which is safe since we hold this refcount.
   317		 * This also means the device is a leaf in the graph and no other object
   318		 * can take a reference on it.
   319		 */
   320		iommufd_object_finalize(ictx, &idev->obj);
   321		*id = idev->obj.id;
   322		return idev;
   323	}
   324	EXPORT_SYMBOL_NS_GPL(iommufd_device_bind_pasid, IOMMUFD);
   325	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2023-08-25 12:26 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=202308252002.DclKmsh1-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kevin.tian@intel.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 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.