From: kernel test robot <lkp@intel.com>
To: David Woodhouse <dwmw2@infradead.org>, bonzini@redhat.com
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
Alex Williamson <alex.williamson@redhat.com>,
Cornelia Huck <cohuck@redhat.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Jens Axboe <axboe@kernel.dk>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 3/3] kvm/eventfd: Drain events from eventfd in irqfd_wakeup()
Date: Wed, 28 Oct 2020 07:13:21 +0800 [thread overview]
Message-ID: <202010280707.ZGPPCo4Y-lkp@intel.com> (raw)
In-Reply-To: <20201027135523.646811-4-dwmw2@infradead.org>
[-- Attachment #1: Type: text/plain, Size: 4377 bytes --]
Hi David,
I love your patch! Yet something to improve:
[auto build test ERROR on vfio/next]
[also build test ERROR on vhost/linux-next linus/master kvm/linux-next v5.10-rc1 next-20201027]
[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]
url: https://github.com/0day-ci/linux/commits/David-Woodhouse/Allow-in-kernel-consumers-to-drain-events-from-eventfd/20201027-215658
base: https://github.com/awilliam/linux-vfio.git next
config: x86_64-randconfig-a004-20201026 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project f2c25c70791de95d2466e09b5b58fc37f6ccd7a4)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/dc45dd9af28fede8f8dd29b705b90f78cf87538c
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review David-Woodhouse/Allow-in-kernel-consumers-to-drain-events-from-eventfd/20201027-215658
git checkout dc45dd9af28fede8f8dd29b705b90f78cf87538c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> arch/x86/kvm/../../../virt/kvm/eventfd.c:197:23: error: incompatible pointer types passing 'struct eventfd_ctx **' to parameter of type 'struct eventfd_ctx *'; remove & [-Werror,-Wincompatible-pointer-types]
eventfd_ctx_do_read(&irqfd->eventfd, &cnt);
^~~~~~~~~~~~~~~
include/linux/eventfd.h:44:46: note: passing argument to parameter 'ctx' here
void eventfd_ctx_do_read(struct eventfd_ctx *ctx, __u64 *cnt);
^
1 error generated.
vim +197 arch/x86/kvm/../../../virt/kvm/eventfd.c
180
181 /*
182 * Called with wqh->lock held and interrupts disabled
183 */
184 static int
185 irqfd_wakeup(wait_queue_entry_t *wait, unsigned mode, int sync, void *key)
186 {
187 struct kvm_kernel_irqfd *irqfd =
188 container_of(wait, struct kvm_kernel_irqfd, wait);
189 __poll_t flags = key_to_poll(key);
190 struct kvm_kernel_irq_routing_entry irq;
191 struct kvm *kvm = irqfd->kvm;
192 unsigned seq;
193 int idx;
194
195 if (flags & EPOLLIN) {
196 u64 cnt;
> 197 eventfd_ctx_do_read(&irqfd->eventfd, &cnt);
198
199 idx = srcu_read_lock(&kvm->irq_srcu);
200 do {
201 seq = read_seqcount_begin(&irqfd->irq_entry_sc);
202 irq = irqfd->irq_entry;
203 } while (read_seqcount_retry(&irqfd->irq_entry_sc, seq));
204 /* An event has been signaled, inject an interrupt */
205 if (kvm_arch_set_irq_inatomic(&irq, kvm,
206 KVM_USERSPACE_IRQ_SOURCE_ID, 1,
207 false) == -EWOULDBLOCK)
208 schedule_work(&irqfd->inject);
209 srcu_read_unlock(&kvm->irq_srcu, idx);
210 }
211
212 if (flags & EPOLLHUP) {
213 /* The eventfd is closing, detach from KVM */
214 unsigned long iflags;
215
216 spin_lock_irqsave(&kvm->irqfds.lock, iflags);
217
218 /*
219 * We must check if someone deactivated the irqfd before
220 * we could acquire the irqfds.lock since the item is
221 * deactivated from the KVM side before it is unhooked from
222 * the wait-queue. If it is already deactivated, we can
223 * simply return knowing the other side will cleanup for us.
224 * We cannot race against the irqfd going away since the
225 * other side is required to acquire wqh->lock, which we hold
226 */
227 if (irqfd_is_active(irqfd))
228 irqfd_deactivate(irqfd);
229
230 spin_unlock_irqrestore(&kvm->irqfds.lock, iflags);
231 }
232
233 return 0;
234 }
235
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 40494 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH 3/3] kvm/eventfd: Drain events from eventfd in irqfd_wakeup()
Date: Wed, 28 Oct 2020 07:13:21 +0800 [thread overview]
Message-ID: <202010280707.ZGPPCo4Y-lkp@intel.com> (raw)
In-Reply-To: <20201027135523.646811-4-dwmw2@infradead.org>
[-- Attachment #1: Type: text/plain, Size: 4480 bytes --]
Hi David,
I love your patch! Yet something to improve:
[auto build test ERROR on vfio/next]
[also build test ERROR on vhost/linux-next linus/master kvm/linux-next v5.10-rc1 next-20201027]
[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]
url: https://github.com/0day-ci/linux/commits/David-Woodhouse/Allow-in-kernel-consumers-to-drain-events-from-eventfd/20201027-215658
base: https://github.com/awilliam/linux-vfio.git next
config: x86_64-randconfig-a004-20201026 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project f2c25c70791de95d2466e09b5b58fc37f6ccd7a4)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/dc45dd9af28fede8f8dd29b705b90f78cf87538c
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review David-Woodhouse/Allow-in-kernel-consumers-to-drain-events-from-eventfd/20201027-215658
git checkout dc45dd9af28fede8f8dd29b705b90f78cf87538c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> arch/x86/kvm/../../../virt/kvm/eventfd.c:197:23: error: incompatible pointer types passing 'struct eventfd_ctx **' to parameter of type 'struct eventfd_ctx *'; remove & [-Werror,-Wincompatible-pointer-types]
eventfd_ctx_do_read(&irqfd->eventfd, &cnt);
^~~~~~~~~~~~~~~
include/linux/eventfd.h:44:46: note: passing argument to parameter 'ctx' here
void eventfd_ctx_do_read(struct eventfd_ctx *ctx, __u64 *cnt);
^
1 error generated.
vim +197 arch/x86/kvm/../../../virt/kvm/eventfd.c
180
181 /*
182 * Called with wqh->lock held and interrupts disabled
183 */
184 static int
185 irqfd_wakeup(wait_queue_entry_t *wait, unsigned mode, int sync, void *key)
186 {
187 struct kvm_kernel_irqfd *irqfd =
188 container_of(wait, struct kvm_kernel_irqfd, wait);
189 __poll_t flags = key_to_poll(key);
190 struct kvm_kernel_irq_routing_entry irq;
191 struct kvm *kvm = irqfd->kvm;
192 unsigned seq;
193 int idx;
194
195 if (flags & EPOLLIN) {
196 u64 cnt;
> 197 eventfd_ctx_do_read(&irqfd->eventfd, &cnt);
198
199 idx = srcu_read_lock(&kvm->irq_srcu);
200 do {
201 seq = read_seqcount_begin(&irqfd->irq_entry_sc);
202 irq = irqfd->irq_entry;
203 } while (read_seqcount_retry(&irqfd->irq_entry_sc, seq));
204 /* An event has been signaled, inject an interrupt */
205 if (kvm_arch_set_irq_inatomic(&irq, kvm,
206 KVM_USERSPACE_IRQ_SOURCE_ID, 1,
207 false) == -EWOULDBLOCK)
208 schedule_work(&irqfd->inject);
209 srcu_read_unlock(&kvm->irq_srcu, idx);
210 }
211
212 if (flags & EPOLLHUP) {
213 /* The eventfd is closing, detach from KVM */
214 unsigned long iflags;
215
216 spin_lock_irqsave(&kvm->irqfds.lock, iflags);
217
218 /*
219 * We must check if someone deactivated the irqfd before
220 * we could acquire the irqfds.lock since the item is
221 * deactivated from the KVM side before it is unhooked from
222 * the wait-queue. If it is already deactivated, we can
223 * simply return knowing the other side will cleanup for us.
224 * We cannot race against the irqfd going away since the
225 * other side is required to acquire wqh->lock, which we hold
226 */
227 if (irqfd_is_active(irqfd))
228 irqfd_deactivate(irqfd);
229
230 spin_unlock_irqrestore(&kvm->irqfds.lock, iflags);
231 }
232
233 return 0;
234 }
235
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 40494 bytes --]
next prev parent reply other threads:[~2020-10-28 1:48 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-26 17:53 [RFC PATCH 1/2] sched/wait: Add add_wait_queue_priority() David Woodhouse
2020-10-26 17:53 ` [RFC PATCH 2/2] kvm/eventfd: Use priority waitqueue to catch events before userspace David Woodhouse
2020-10-27 8:01 ` Paolo Bonzini
2020-10-27 10:15 ` David Woodhouse
2020-10-27 13:55 ` [PATCH 0/3] Allow in-kernel consumers to drain events from eventfd David Woodhouse
2020-10-27 13:55 ` [PATCH 1/3] eventfd: Export eventfd_ctx_do_read() David Woodhouse
2020-10-27 13:55 ` [PATCH 2/3] vfio/virqfd: Drain events from eventfd in virqfd_wakeup() David Woodhouse
2020-11-06 23:29 ` Alex Williamson
2020-11-08 9:17 ` Paolo Bonzini
2020-10-27 13:55 ` [PATCH 3/3] kvm/eventfd: Drain events from eventfd in irqfd_wakeup() David Woodhouse
2020-10-27 18:41 ` kernel test robot
2020-10-27 18:41 ` kernel test robot
2020-10-27 21:42 ` kernel test robot
2020-10-27 21:42 ` kernel test robot
2020-10-27 23:13 ` kernel test robot [this message]
2020-10-27 23:13 ` kernel test robot
2020-10-27 14:39 ` [PATCH v2 0/2] Allow KVM IRQFD to consistently intercept events David Woodhouse
2020-10-27 14:39 ` [PATCH v2 1/2] sched/wait: Add add_wait_queue_priority() David Woodhouse
2020-10-27 19:09 ` Peter Zijlstra
2020-10-27 19:27 ` David Woodhouse
2020-10-27 20:30 ` Peter Zijlstra
2020-10-27 20:49 ` David Woodhouse
2020-10-27 21:32 ` David Woodhouse
2020-10-28 14:20 ` Peter Zijlstra
2020-10-28 14:44 ` Paolo Bonzini
2020-10-28 14:35 ` Peter Zijlstra
2020-11-04 9:35 ` David Woodhouse
2020-11-04 11:25 ` Paolo Bonzini
2020-11-06 10:17 ` Paolo Bonzini
2020-11-06 16:32 ` Alex Williamson
2020-11-06 17:18 ` David Woodhouse
2020-10-27 14:39 ` [PATCH v2 2/2] kvm/eventfd: Use priority waitqueue to catch events before userspace David Woodhouse
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=202010280707.ZGPPCo4Y-lkp@intel.com \
--to=lkp@intel.com \
--cc=alex.williamson@redhat.com \
--cc=axboe@kernel.dk \
--cc=bonzini@redhat.com \
--cc=clang-built-linux@googlegroups.com \
--cc=cohuck@redhat.com \
--cc=dwmw2@infradead.org \
--cc=kbuild-all@lists.01.org \
--cc=kvm@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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.