[PATCH v7 09/16] virt: geniezone: Add irqfd support

kernel test robot lkp at intel.com
Sat Nov 18 05:43:05 PST 2023


Hi Yi-De,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on v6.7-rc1 next-20231117]
[cannot apply to arm64/for-next/core robh/for-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/Yi-De-Wu/docs-geniezone-Introduce-GenieZone-hypervisor/20231116-233442
base:   linus/master
patch link:    https://lore.kernel.org/r/20231116152756.4250-10-yi-de.wu%40mediatek.com
patch subject: [PATCH v7 09/16] virt: geniezone: Add irqfd support
config: arm64-randconfig-r081-20231118 (https://download.01.org/0day-ci/archive/20231118/202311182112.B1KM0yj9-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231118/202311182112.B1KM0yj9-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 at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311182112.B1KM0yj9-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   arch/arm64/geniezone/../../../drivers/virt/geniezone/gzvm_irqfd.c: In function 'gzvm_irqfd_assign':
>> arch/arm64/geniezone/../../../drivers/virt/geniezone/gzvm_irqfd.c:185:19: error: implicit declaration of function 'eventfd_ctx_fileget'; did you mean 'eventfd_ctx_fdget'? [-Werror=implicit-function-declaration]
     185 |         eventfd = eventfd_ctx_fileget(f.file);
         |                   ^~~~~~~~~~~~~~~~~~~
         |                   eventfd_ctx_fdget
>> arch/arm64/geniezone/../../../drivers/virt/geniezone/gzvm_irqfd.c:185:17: warning: assignment to 'struct eventfd_ctx *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     185 |         eventfd = eventfd_ctx_fileget(f.file);
         |                 ^
   cc1: some warnings being treated as errors


vim +185 arch/arm64/geniezone/../../../drivers/virt/geniezone/gzvm_irqfd.c

   160	
   161	static int gzvm_irqfd_assign(struct gzvm *gzvm, struct gzvm_irqfd *args)
   162	{
   163		struct gzvm_kernel_irqfd *irqfd, *tmp;
   164		struct fd f;
   165		struct eventfd_ctx *eventfd = NULL;
   166		int ret;
   167		int idx;
   168	
   169		irqfd = kzalloc(sizeof(*irqfd), GFP_KERNEL_ACCOUNT);
   170		if (!irqfd)
   171			return -ENOMEM;
   172	
   173		irqfd->gzvm = gzvm;
   174		irqfd->gsi = args->gsi;
   175	
   176		INIT_LIST_HEAD(&irqfd->list);
   177		INIT_WORK(&irqfd->shutdown, irqfd_shutdown);
   178	
   179		f = fdget(args->fd);
   180		if (!f.file) {
   181			ret = -EBADF;
   182			goto out;
   183		}
   184	
 > 185		eventfd = eventfd_ctx_fileget(f.file);
   186		if (IS_ERR(eventfd)) {
   187			ret = PTR_ERR(eventfd);
   188			goto fail;
   189		}
   190	
   191		irqfd->eventfd = eventfd;
   192	
   193		/*
   194		 * Install our own custom wake-up handling so we are notified via
   195		 * a callback whenever someone signals the underlying eventfd
   196		 */
   197		init_waitqueue_func_entry(&irqfd->wait, irqfd_wakeup);
   198		init_poll_funcptr(&irqfd->pt, irqfd_ptable_queue_proc);
   199	
   200		spin_lock_irq(&gzvm->irqfds.lock);
   201	
   202		ret = 0;
   203		list_for_each_entry(tmp, &gzvm->irqfds.items, list) {
   204			if (irqfd->eventfd != tmp->eventfd)
   205				continue;
   206			/* This fd is used for another irq already. */
   207			pr_err("already used: gsi=%d fd=%d\n", args->gsi, args->fd);
   208			ret = -EBUSY;
   209			spin_unlock_irq(&gzvm->irqfds.lock);
   210			goto fail;
   211		}
   212	
   213		idx = srcu_read_lock(&gzvm->irq_srcu);
   214	
   215		list_add_tail(&irqfd->list, &gzvm->irqfds.items);
   216	
   217		spin_unlock_irq(&gzvm->irqfds.lock);
   218	
   219		vfs_poll(f.file, &irqfd->pt);
   220	
   221		srcu_read_unlock(&gzvm->irq_srcu, idx);
   222	
   223		/*
   224		 * do not drop the file until the irqfd is fully initialized, otherwise
   225		 * we might race against the EPOLLHUP
   226		 */
   227		fdput(f);
   228		return 0;
   229	
   230	fail:
   231		if (eventfd && !IS_ERR(eventfd))
   232			eventfd_ctx_put(eventfd);
   233	
   234		fdput(f);
   235	
   236	out:
   237		kfree(irqfd);
   238		return ret;
   239	}
   240	

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



More information about the linux-arm-kernel mailing list