All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 12013/12769] drivers/hv/mshv_eventfd.c:399:19: error: implicit declaration of function 'eventfd_ctx_fileget'; did you mean 'eventfd_ctx_fdget'?
@ 2025-03-20 20:17 kernel test robot
  2025-03-20 20:54 ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2025-03-20 20:17 UTC (permalink / raw)
  To: Nuno Das Neves
  Cc: oe-kbuild-all, Wei Liu, Anirudh Rayabharam, Jinank Jain,
	Mukesh Rathor, Muminul Islam, Praveen K Paladugu,
	Stanislav Kinsburskii, Roman Kisel

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   73b8c1dbc2508188e383023080ce6a582ff5f279
commit: f5288d14069b6580405b6f0d1c4ccd45c7ac97bf [12013/12769] Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs
config: x86_64-randconfig-076-20250321 (https://download.01.org/0day-ci/archive/20250321/202503210422.6u1LLUSg-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250321/202503210422.6u1LLUSg-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/202503210422.6u1LLUSg-lkp@intel.com/

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

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


vim +399 drivers/hv/mshv_eventfd.c

   373	
   374	static int mshv_irqfd_assign(struct mshv_partition *pt,
   375				     struct mshv_user_irqfd *args)
   376	{
   377		struct eventfd_ctx *eventfd = NULL, *resamplefd = NULL;
   378		struct mshv_irqfd *irqfd, *tmp;
   379		unsigned int events;
   380		struct fd f;
   381		int ret;
   382		int idx;
   383	
   384		irqfd = kzalloc(sizeof(*irqfd), GFP_KERNEL);
   385		if (!irqfd)
   386			return -ENOMEM;
   387	
   388		irqfd->irqfd_partn = pt;
   389		irqfd->irqfd_irqnum = args->gsi;
   390		INIT_WORK(&irqfd->irqfd_shutdown, mshv_irqfd_shutdown);
   391		seqcount_spinlock_init(&irqfd->irqfd_irqe_sc, &pt->pt_irqfds_lock);
   392	
   393		f = fdget(args->fd);
   394		if (!fd_file(f)) {
   395			ret = -EBADF;
   396			goto out;
   397		}
   398	
 > 399		eventfd = eventfd_ctx_fileget(fd_file(f));
   400		if (IS_ERR(eventfd)) {
   401			ret = PTR_ERR(eventfd);
   402			goto fail;
   403		}
   404	
   405		irqfd->irqfd_eventfd_ctx = eventfd;
   406	
   407		if (args->flags & BIT(MSHV_IRQFD_BIT_RESAMPLE)) {
   408			struct mshv_irqfd_resampler *rp;
   409	
   410			resamplefd = eventfd_ctx_fdget(args->resamplefd);
   411			if (IS_ERR(resamplefd)) {
   412				ret = PTR_ERR(resamplefd);
   413				goto fail;
   414			}
   415	
   416			irqfd->irqfd_resamplefd = resamplefd;
   417	
   418			mutex_lock(&pt->irqfds_resampler_lock);
   419	
   420			hlist_for_each_entry(rp, &pt->irqfds_resampler_list,
   421					     rsmplr_hnode) {
   422				if (rp->rsmplr_notifier.irq_ack_gsi ==
   423								 irqfd->irqfd_irqnum) {
   424					irqfd->irqfd_resampler = rp;
   425					break;
   426				}
   427			}
   428	
   429			if (!irqfd->irqfd_resampler) {
   430				rp = kzalloc(sizeof(*rp), GFP_KERNEL_ACCOUNT);
   431				if (!rp) {
   432					ret = -ENOMEM;
   433					mutex_unlock(&pt->irqfds_resampler_lock);
   434					goto fail;
   435				}
   436	
   437				rp->rsmplr_partn = pt;
   438				INIT_HLIST_HEAD(&rp->rsmplr_irqfd_list);
   439				rp->rsmplr_notifier.irq_ack_gsi = irqfd->irqfd_irqnum;
   440				rp->rsmplr_notifier.irq_acked =
   441							      mshv_irqfd_resampler_ack;
   442	
   443				hlist_add_head(&rp->rsmplr_hnode,
   444					       &pt->irqfds_resampler_list);
   445				mshv_register_irq_ack_notifier(pt,
   446							       &rp->rsmplr_notifier);
   447				irqfd->irqfd_resampler = rp;
   448			}
   449	
   450			hlist_add_head_rcu(&irqfd->irqfd_resampler_hnode,
   451					   &irqfd->irqfd_resampler->rsmplr_irqfd_list);
   452	
   453			mutex_unlock(&pt->irqfds_resampler_lock);
   454		}
   455	
   456		/*
   457		 * Install our own custom wake-up handling so we are notified via
   458		 * a callback whenever someone signals the underlying eventfd
   459		 */
   460		init_waitqueue_func_entry(&irqfd->irqfd_wait, mshv_irqfd_wakeup);
   461		init_poll_funcptr(&irqfd->irqfd_polltbl, mshv_irqfd_queue_proc);
   462	
   463		spin_lock_irq(&pt->pt_irqfds_lock);
   464		if (args->flags & BIT(MSHV_IRQFD_BIT_RESAMPLE) &&
   465		    !irqfd->irqfd_lapic_irq.lapic_control.level_triggered) {
   466			/*
   467			 * Resample Fd must be for level triggered interrupt
   468			 * Otherwise return with failure
   469			 */
   470			spin_unlock_irq(&pt->pt_irqfds_lock);
   471			ret = -EINVAL;
   472			goto fail;
   473		}
   474		ret = 0;
   475		hlist_for_each_entry(tmp, &pt->pt_irqfds_list, irqfd_hnode) {
   476			if (irqfd->irqfd_eventfd_ctx != tmp->irqfd_eventfd_ctx)
   477				continue;
   478			/* This fd is used for another irq already. */
   479			ret = -EBUSY;
   480			spin_unlock_irq(&pt->pt_irqfds_lock);
   481			goto fail;
   482		}
   483	
   484		idx = srcu_read_lock(&pt->pt_irq_srcu);
   485		mshv_irqfd_update(pt, irqfd);
   486		hlist_add_head(&irqfd->irqfd_hnode, &pt->pt_irqfds_list);
   487		spin_unlock_irq(&pt->pt_irqfds_lock);
   488	
   489		/*
   490		 * Check if there was an event already pending on the eventfd
   491		 * before we registered, and trigger it as if we didn't miss it.
   492		 */
   493		events = vfs_poll(fd_file(f), &irqfd->irqfd_polltbl);
   494	
   495		if (events & POLLIN)
   496			mshv_assert_irq_slow(irqfd);
   497	
   498		srcu_read_unlock(&pt->pt_irq_srcu, idx);
   499		/*
   500		 * do not drop the file until the irqfd is fully initialized, otherwise
   501		 * we might race against the POLLHUP
   502		 */
   503		fdput(f);
   504	
   505		return 0;
   506	
   507	fail:
   508		if (irqfd->irqfd_resampler)
   509			mshv_irqfd_resampler_shutdown(irqfd);
   510	
   511		if (resamplefd && !IS_ERR(resamplefd))
   512			eventfd_ctx_put(resamplefd);
   513	
   514		if (eventfd && !IS_ERR(eventfd))
   515			eventfd_ctx_put(eventfd);
   516	
   517		fdput(f);
   518	
   519	out:
   520		kfree(irqfd);
   521		return ret;
   522	}
   523	

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-next:master 12013/12769] drivers/hv/mshv_eventfd.c:399:19: error: implicit declaration of function 'eventfd_ctx_fileget'; did you mean 'eventfd_ctx_fdget'?
  2025-03-20 20:17 [linux-next:master 12013/12769] drivers/hv/mshv_eventfd.c:399:19: error: implicit declaration of function 'eventfd_ctx_fileget'; did you mean 'eventfd_ctx_fdget'? kernel test robot
@ 2025-03-20 20:54 ` Wei Liu
  2025-03-20 21:19   ` Nuno Das Neves
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Liu @ 2025-03-20 20:54 UTC (permalink / raw)
  To: kernel test robot
  Cc: Nuno Das Neves, oe-kbuild-all, Wei Liu, Anirudh Rayabharam,
	Jinank Jain, Mukesh Rathor, Muminul Islam, Praveen K Paladugu,
	Stanislav Kinsburskii, Roman Kisel

On Fri, Mar 21, 2025 at 04:17:50AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   73b8c1dbc2508188e383023080ce6a582ff5f279
> commit: f5288d14069b6580405b6f0d1c4ccd45c7ac97bf [12013/12769] Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs
> config: x86_64-randconfig-076-20250321 (https://download.01.org/0day-ci/archive/20250321/202503210422.6u1LLUSg-lkp@intel.com/config)
> compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250321/202503210422.6u1LLUSg-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/202503210422.6u1LLUSg-lkp@intel.com/
> 
> All error/warnings (new ones prefixed by >>):
> 
>    drivers/hv/mshv_eventfd.c: In function 'mshv_irqfd_assign':
> >> drivers/hv/mshv_eventfd.c:399:19: error: implicit declaration of function 'eventfd_ctx_fileget'; did you mean 'eventfd_ctx_fdget'? [-Werror=implicit-function-declaration]
>      399 |         eventfd = eventfd_ctx_fileget(fd_file(f));
>          |                   ^~~~~~~~~~~~~~~~~~~
>          |                   eventfd_ctx_fdget
> >> drivers/hv/mshv_eventfd.c:399:17: warning: assignment to 'struct eventfd_ctx *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
>      399 |         eventfd = eventfd_ctx_fileget(fd_file(f));
>          |                 ^
>    cc1: some warnings being treated as errors

Nuno, it looks like we need this:

diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig
index 3118d5472fab..6c1416167bd2 100644
--- a/drivers/hv/Kconfig
+++ b/drivers/hv/Kconfig
@@ -64,6 +64,7 @@ config MSHV_ROOT
        # e.g. When withdrawing memory, the hypervisor gives back 4k pages in
        # no particular order, making it impossible to reassemble larger pages
        depends on PAGE_SIZE_4KB
+       select EVENTFD
        default n
        help
          Select this option to enable support for booting and running as root

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [linux-next:master 12013/12769] drivers/hv/mshv_eventfd.c:399:19: error: implicit declaration of function 'eventfd_ctx_fileget'; did you mean 'eventfd_ctx_fdget'?
  2025-03-20 20:54 ` Wei Liu
@ 2025-03-20 21:19   ` Nuno Das Neves
  0 siblings, 0 replies; 3+ messages in thread
From: Nuno Das Neves @ 2025-03-20 21:19 UTC (permalink / raw)
  To: Wei Liu, kernel test robot
  Cc: oe-kbuild-all, Anirudh Rayabharam, Jinank Jain, Mukesh Rathor,
	Muminul Islam, Praveen K Paladugu, Stanislav Kinsburskii,
	Roman Kisel

On 3/20/2025 1:54 PM, Wei Liu wrote:
> On Fri, Mar 21, 2025 at 04:17:50AM +0800, kernel test robot wrote:
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
>> head:   73b8c1dbc2508188e383023080ce6a582ff5f279
>> commit: f5288d14069b6580405b6f0d1c4ccd45c7ac97bf [12013/12769] Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs
>> config: x86_64-randconfig-076-20250321 (https://download.01.org/0day-ci/archive/20250321/202503210422.6u1LLUSg-lkp@intel.com/config)
>> compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250321/202503210422.6u1LLUSg-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/202503210422.6u1LLUSg-lkp@intel.com/
>>
>> All error/warnings (new ones prefixed by >>):
>>
>>    drivers/hv/mshv_eventfd.c: In function 'mshv_irqfd_assign':
>>>> drivers/hv/mshv_eventfd.c:399:19: error: implicit declaration of function 'eventfd_ctx_fileget'; did you mean 'eventfd_ctx_fdget'? [-Werror=implicit-function-declaration]
>>      399 |         eventfd = eventfd_ctx_fileget(fd_file(f));
>>          |                   ^~~~~~~~~~~~~~~~~~~
>>          |                   eventfd_ctx_fdget
>>>> drivers/hv/mshv_eventfd.c:399:17: warning: assignment to 'struct eventfd_ctx *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
>>      399 |         eventfd = eventfd_ctx_fileget(fd_file(f));
>>          |                 ^
>>    cc1: some warnings being treated as errors
> 
> Nuno, it looks like we need this:
> 
> diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig
> index 3118d5472fab..6c1416167bd2 100644
> --- a/drivers/hv/Kconfig
> +++ b/drivers/hv/Kconfig
> @@ -64,6 +64,7 @@ config MSHV_ROOT
>         # e.g. When withdrawing memory, the hypervisor gives back 4k pages in
>         # no particular order, making it impossible to reassemble larger pages
>         depends on PAGE_SIZE_4KB
> +       select EVENTFD
>         default n
>         help
>           Select this option to enable support for booting and running as root

Yep, we definitely need that, I forgot to add it.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-20 21:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-20 20:17 [linux-next:master 12013/12769] drivers/hv/mshv_eventfd.c:399:19: error: implicit declaration of function 'eventfd_ctx_fileget'; did you mean 'eventfd_ctx_fdget'? kernel test robot
2025-03-20 20:54 ` Wei Liu
2025-03-20 21:19   ` Nuno Das Neves

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.