Linux-HyperV List
 help / color / mirror / Atom feed
* [PATCH 1/1] mshv: Use EPOLLIN and EPOLLHUP instead of POLLIN and POLLHUP
@ 2026-01-29 15:51 mhkelley58
  2026-02-03 15:44 ` Stanislav Kinsburskii
  0 siblings, 1 reply; 3+ messages in thread
From: mhkelley58 @ 2026-01-29 15:51 UTC (permalink / raw)
  To: kys, haiyangz, wei.liu, decui, longli, linux-hyperv; +Cc: linux-kernel

From: Michael Kelley <mhklinux@outlook.com>

mshv code currently uses the POLLIN and POLLHUP flags. Starting with
commit a9a08845e9acb ("vfs: do bulk POLL* -> EPOLL* replacement") the
intent is to use the EPOLL* versions throughout the kernel.

The comment at the top of mshv_eventfd.c describes it as being inspired
by the KVM implementation, which was changed by the above mentioned
commit in 2018 to use EPOLL*. mshv_eventfd.c is much newer than 2018
and there's no statement as to why it must use the POLL* versions.
So change it to use the EPOLL* versions. This change also resolves
a 'sparse' warning.

No functional change, and the generated code is the same.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202601220948.MUTO60W4-lkp@intel.com/
Signed-off-by: Michael Kelley <mhklinux@outlook.com>
---
 drivers/hv/mshv_eventfd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/hv/mshv_eventfd.c b/drivers/hv/mshv_eventfd.c
index 0b75ff1edb73..dfc8b1092c02 100644
--- a/drivers/hv/mshv_eventfd.c
+++ b/drivers/hv/mshv_eventfd.c
@@ -295,13 +295,13 @@ static int mshv_irqfd_wakeup(wait_queue_entry_t *wait, unsigned int mode,
 {
 	struct mshv_irqfd *irqfd = container_of(wait, struct mshv_irqfd,
 						irqfd_wait);
-	unsigned long flags = (unsigned long)key;
+	__poll_t flags = key_to_poll(key);
 	int idx;
 	unsigned int seq;
 	struct mshv_partition *pt = irqfd->irqfd_partn;
 	int ret = 0;
 
-	if (flags & POLLIN) {
+	if (flags & EPOLLIN) {
 		u64 cnt;
 
 		eventfd_ctx_do_read(irqfd->irqfd_eventfd_ctx, &cnt);
@@ -320,7 +320,7 @@ static int mshv_irqfd_wakeup(wait_queue_entry_t *wait, unsigned int mode,
 		ret = 1;
 	}
 
-	if (flags & POLLHUP) {
+	if (flags & EPOLLHUP) {
 		/* The eventfd is closing, detach from the partition */
 		unsigned long flags;
 
@@ -506,7 +506,7 @@ static int mshv_irqfd_assign(struct mshv_partition *pt,
 	 */
 	events = vfs_poll(fd_file(f), &irqfd->irqfd_polltbl);
 
-	if (events & POLLIN)
+	if (events & EPOLLIN)
 		mshv_assert_irq_slow(irqfd);
 
 	srcu_read_unlock(&pt->pt_irq_srcu, idx);
-- 
2.25.1


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

* Re: [PATCH 1/1] mshv: Use EPOLLIN and EPOLLHUP instead of POLLIN and POLLHUP
  2026-01-29 15:51 [PATCH 1/1] mshv: Use EPOLLIN and EPOLLHUP instead of POLLIN and POLLHUP mhkelley58
@ 2026-02-03 15:44 ` Stanislav Kinsburskii
  2026-02-04  6:16   ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Stanislav Kinsburskii @ 2026-02-03 15:44 UTC (permalink / raw)
  To: mhklinux
  Cc: kys, haiyangz, wei.liu, decui, longli, linux-hyperv, linux-kernel

On Thu, Jan 29, 2026 at 07:51:54AM -0800, mhkelley58@gmail.com wrote:
> From: Michael Kelley <mhklinux@outlook.com>
> 
> mshv code currently uses the POLLIN and POLLHUP flags. Starting with
> commit a9a08845e9acb ("vfs: do bulk POLL* -> EPOLL* replacement") the
> intent is to use the EPOLL* versions throughout the kernel.
> 
> The comment at the top of mshv_eventfd.c describes it as being inspired
> by the KVM implementation, which was changed by the above mentioned
> commit in 2018 to use EPOLL*. mshv_eventfd.c is much newer than 2018
> and there's no statement as to why it must use the POLL* versions.
> So change it to use the EPOLL* versions. This change also resolves
> a 'sparse' warning.
> 
> No functional change, and the generated code is the same.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202601220948.MUTO60W4-lkp@intel.com/
> Signed-off-by: Michael Kelley <mhklinux@outlook.com>

Reviewed-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>

> ---
>  drivers/hv/mshv_eventfd.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hv/mshv_eventfd.c b/drivers/hv/mshv_eventfd.c
> index 0b75ff1edb73..dfc8b1092c02 100644
> --- a/drivers/hv/mshv_eventfd.c
> +++ b/drivers/hv/mshv_eventfd.c
> @@ -295,13 +295,13 @@ static int mshv_irqfd_wakeup(wait_queue_entry_t *wait, unsigned int mode,
>  {
>  	struct mshv_irqfd *irqfd = container_of(wait, struct mshv_irqfd,
>  						irqfd_wait);
> -	unsigned long flags = (unsigned long)key;
> +	__poll_t flags = key_to_poll(key);
>  	int idx;
>  	unsigned int seq;
>  	struct mshv_partition *pt = irqfd->irqfd_partn;
>  	int ret = 0;
>  
> -	if (flags & POLLIN) {
> +	if (flags & EPOLLIN) {
>  		u64 cnt;
>  
>  		eventfd_ctx_do_read(irqfd->irqfd_eventfd_ctx, &cnt);
> @@ -320,7 +320,7 @@ static int mshv_irqfd_wakeup(wait_queue_entry_t *wait, unsigned int mode,
>  		ret = 1;
>  	}
>  
> -	if (flags & POLLHUP) {
> +	if (flags & EPOLLHUP) {
>  		/* The eventfd is closing, detach from the partition */
>  		unsigned long flags;
>  
> @@ -506,7 +506,7 @@ static int mshv_irqfd_assign(struct mshv_partition *pt,
>  	 */
>  	events = vfs_poll(fd_file(f), &irqfd->irqfd_polltbl);
>  
> -	if (events & POLLIN)
> +	if (events & EPOLLIN)
>  		mshv_assert_irq_slow(irqfd);
>  
>  	srcu_read_unlock(&pt->pt_irq_srcu, idx);
> -- 
> 2.25.1
> 

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

* Re: [PATCH 1/1] mshv: Use EPOLLIN and EPOLLHUP instead of POLLIN and POLLHUP
  2026-02-03 15:44 ` Stanislav Kinsburskii
@ 2026-02-04  6:16   ` Wei Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Wei Liu @ 2026-02-04  6:16 UTC (permalink / raw)
  To: Stanislav Kinsburskii
  Cc: mhklinux, kys, haiyangz, wei.liu, decui, longli, linux-hyperv,
	linux-kernel

On Tue, Feb 03, 2026 at 07:44:54AM -0800, Stanislav Kinsburskii wrote:
> On Thu, Jan 29, 2026 at 07:51:54AM -0800, mhkelley58@gmail.com wrote:
> > From: Michael Kelley <mhklinux@outlook.com>
> > 
> > mshv code currently uses the POLLIN and POLLHUP flags. Starting with
> > commit a9a08845e9acb ("vfs: do bulk POLL* -> EPOLL* replacement") the
> > intent is to use the EPOLL* versions throughout the kernel.
> > 
> > The comment at the top of mshv_eventfd.c describes it as being inspired
> > by the KVM implementation, which was changed by the above mentioned
> > commit in 2018 to use EPOLL*. mshv_eventfd.c is much newer than 2018
> > and there's no statement as to why it must use the POLL* versions.
> > So change it to use the EPOLL* versions. This change also resolves
> > a 'sparse' warning.
> > 
> > No functional change, and the generated code is the same.
> > 
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202601220948.MUTO60W4-lkp@intel.com/
> > Signed-off-by: Michael Kelley <mhklinux@outlook.com>
> 
> Reviewed-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>

Applied. 

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

end of thread, other threads:[~2026-02-04  6:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-29 15:51 [PATCH 1/1] mshv: Use EPOLLIN and EPOLLHUP instead of POLLIN and POLLHUP mhkelley58
2026-02-03 15:44 ` Stanislav Kinsburskii
2026-02-04  6:16   ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox