David Woodhouse 755e86f28a eventfd: Export eventfd_ctx_do_read()
[ Upstream commit 28f1326710555bbe666f64452d08f2d7dd657cae ]

Where events are consumed in the kernel, for example by KVM's
irqfd_wakeup() and VFIO's virqfd_wakeup(), they currently lack a
mechanism to drain the eventfd's counter.

Since the wait queue is already locked while the wakeup functions are
invoked, all they really need to do is call eventfd_ctx_do_read().

Add a check for the lock, and export it for them.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Message-Id: <20201027135523.646811-2-dwmw2@infradead.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Stable-dep-of: 758b49204781 ("eventfd: prevent underflow for eventfd semaphores")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-19 12:20:06 +02:00
..
2023-06-21 15:45:40 +02:00
2020-10-16 11:11:22 -07:00
2023-08-11 11:57:54 +02:00
2021-09-18 13:40:15 +02:00
2023-07-27 08:43:36 +02:00
2023-08-26 15:26:43 +02:00
2023-05-17 11:47:35 +02:00
2023-02-22 12:55:54 +01:00
2022-06-09 10:21:16 +02:00
2023-01-04 11:39:23 +01:00
2023-07-27 08:44:14 +02:00
2023-01-14 10:16:27 +01:00