Dan Carpenter
2020-Jun-02 09:42 UTC
[PATCH] vdpa: bypass waking up vhost_woker for vdpa vq kick
Hi Zhu, url: https://github.com/0day-ci/linux/commits/Zhu-Lingshan/vdpa-bypass-waking-up-vhost_woker-for-vdpa-vq-kick/20200526-133819 base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next config: x86_64-randconfig-m001-20200529 (attached as .config) compiler: gcc-9 (Debian 9.3.0-13) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kbuild test robot <lkp at intel.com> Reported-by: Dan Carpenter <dan.carpenter at oracle.com> smatch warnings: drivers/vhost/vdpa.c:348 vhost_vdpa_set_vring_kick() error: uninitialized symbol 'r'. # https://github.com/0day-ci/linux/commit/a84ddbf1ef29f18aafb2bb8a93bcedd4a29a967d git remote add linux-review https://github.com/0day-ci/linux git remote update linux-review git checkout a84ddbf1ef29f18aafb2bb8a93bcedd4a29a967d vim +/r +348 drivers/vhost/vdpa.c a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 316 static long vhost_vdpa_set_vring_kick(struct vhost_virtqueue *vq, a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 317 void __user *argp) a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 318 { a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 319 bool pollstart = false, pollstop = false; a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 320 struct file *eventfp, *filep = NULL; a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 321 struct vhost_vring_file f; a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 322 long r; a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 323 a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 324 if (copy_from_user(&f, argp, sizeof(f))) a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 325 return -EFAULT; a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 326 a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 327 eventfp = f.fd == -1 ? NULL : eventfd_fget(f.fd); a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 328 if (IS_ERR(eventfp)) { a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 329 r = PTR_ERR(eventfp); a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 330 return r; a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 331 } a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 332 a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 333 if (eventfp != vq->kick) { a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 334 pollstop = (filep = vq->kick) != NULL; a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 335 pollstart = (vq->kick = eventfp) != NULL; a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 336 } else a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 337 filep = eventfp; a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 338 a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 339 if (pollstop && vq->handle_kick) a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 340 vhost_vdpa_poll_stop(vq); a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 341 a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 342 if (filep) a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 343 fput(filep); a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 344 a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 345 if (pollstart && vq->handle_kick) a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 346 r = vhost_vdpa_poll_start(vq); "r" not initialized on else path. a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 347 a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 @348 return r; a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 349 } --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all at lists.01.org -------------- next part -------------- A non-text attachment was scrubbed... Name: .config.gz Type: application/gzip Size: 37374 bytes Desc: not available URL: <http://lists.linuxfoundation.org/pipermail/virtualization/attachments/20200602/6d6619d5/attachment-0001.gz>
Jason Wang
2020-Jun-02 10:16 UTC
[PATCH] vdpa: bypass waking up vhost_woker for vdpa vq kick
On 2020/6/2 ??5:42, Dan Carpenter wrote:> Hi Zhu, > > url: https://github.com/0day-ci/linux/commits/Zhu-Lingshan/vdpa-bypass-waking-up-vhost_woker-for-vdpa-vq-kick/20200526-133819 > base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next > config: x86_64-randconfig-m001-20200529 (attached as .config) > compiler: gcc-9 (Debian 9.3.0-13) 9.3.0 > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kbuild test robot <lkp at intel.com> > Reported-by: Dan Carpenter <dan.carpenter at oracle.com> > > smatch warnings: > drivers/vhost/vdpa.c:348 vhost_vdpa_set_vring_kick() error: uninitialized symbol 'r'. > > # https://github.com/0day-ci/linux/commit/a84ddbf1ef29f18aafb2bb8a93bcedd4a29a967d > git remote add linux-review https://github.com/0day-ci/linux > git remote update linux-review > git checkout a84ddbf1ef29f18aafb2bb8a93bcedd4a29a967d > vim +/r +348 drivers/vhost/vdpa.c > > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 316 static long vhost_vdpa_set_vring_kick(struct vhost_virtqueue *vq, > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 317 void __user *argp) > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 318 { > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 319 bool pollstart = false, pollstop = false; > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 320 struct file *eventfp, *filep = NULL; > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 321 struct vhost_vring_file f; > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 322 long r; > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 323 > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 324 if (copy_from_user(&f, argp, sizeof(f))) > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 325 return -EFAULT; > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 326 > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 327 eventfp = f.fd == -1 ? NULL : eventfd_fget(f.fd); > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 328 if (IS_ERR(eventfp)) { > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 329 r = PTR_ERR(eventfp); > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 330 return r; > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 331 } > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 332 > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 333 if (eventfp != vq->kick) { > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 334 pollstop = (filep = vq->kick) != NULL; > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 335 pollstart = (vq->kick = eventfp) != NULL; > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 336 } else > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 337 filep = eventfp; > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 338 > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 339 if (pollstop && vq->handle_kick) > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 340 vhost_vdpa_poll_stop(vq); > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 341 > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 342 if (filep) > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 343 fput(filep); > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 344 > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 345 if (pollstart && vq->handle_kick) > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 346 r = vhost_vdpa_poll_start(vq); > > "r" not initialized on else path. > > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 347 > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 @348 return r; > a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 349 }Will fix. Thanks> --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all at lists.01.org
Jason Wang
2020-Jun-02 11:10 UTC
[PATCH] vdpa: bypass waking up vhost_woker for vdpa vq kick
On 2020/6/2 ??6:16, Jason Wang wrote:> > On 2020/6/2 ??5:42, Dan Carpenter wrote: >> Hi Zhu, >> >> url: >> https://github.com/0day-ci/linux/commits/Zhu-Lingshan/vdpa-bypass-waking-up-vhost_woker-for-vdpa-vq-kick/20200526-133819 >> >> base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git >> linux-next >> config: x86_64-randconfig-m001-20200529 (attached as .config) >> compiler: gcc-9 (Debian 9.3.0-13) 9.3.0 >> >> If you fix the issue, kindly add following tag as appropriate >> Reported-by: kbuild test robot <lkp at intel.com> >> Reported-by: Dan Carpenter <dan.carpenter at oracle.com> >> >> smatch warnings: >> drivers/vhost/vdpa.c:348 vhost_vdpa_set_vring_kick() error: >> uninitialized symbol 'r'. >> >> # >> https://github.com/0day-ci/linux/commit/a84ddbf1ef29f18aafb2bb8a93bcedd4a29a967d >> >> git remote add linux-review https://github.com/0day-ci/linux >> git remote update linux-review >> git checkout a84ddbf1ef29f18aafb2bb8a93bcedd4a29a967d >> vim +/r +348 drivers/vhost/vdpa.c >> >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 316? static long >> vhost_vdpa_set_vring_kick(struct vhost_virtqueue *vq, >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 317??????????????????????? >> void __user *argp) >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 318? { >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 319????? bool pollstart = >> false, pollstop = false; >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 320????? struct file >> *eventfp, *filep = NULL; >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 321????? struct >> vhost_vring_file f; >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 322????? long r; >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 323 >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 324????? if >> (copy_from_user(&f, argp, sizeof(f))) >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 325????????? return -EFAULT; >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 326 >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 327????? eventfp = f.fd == -1 >> ? NULL : eventfd_fget(f.fd); >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 328????? if (IS_ERR(eventfp)) { >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 329????????? r = >> PTR_ERR(eventfp); >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 330????????? return r; >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 331????? } >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 332 >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 333????? if (eventfp != >> vq->kick) { >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 334????????? pollstop = >> (filep = vq->kick) != NULL; >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 335????????? pollstart = >> (vq->kick = eventfp) != NULL; >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 336????? } else >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 337????????? filep = eventfp; >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 338 >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 339????? if (pollstop && >> vq->handle_kick) >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 340 vhost_vdpa_poll_stop(vq); >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 341 >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 342????? if (filep) >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 343 fput(filep); >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 344 >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 345????? if (pollstart && >> vq->handle_kick) >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 346????????? r = >> vhost_vdpa_poll_start(vq); >> >> "r" not initialized on else path. >> >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 347 >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 @348????? return r; >> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26? 349? } > > > Will fix. > > ThanksLingshan reminds me that we've posted V2 which reuses the vhost.c implementation for polling. So there's no need for the fix. Thanks
Seemingly Similar Threads
- [PATCH] vdpa: bypass waking up vhost_woker for vdpa vq kick
- [PATCH] vdpa: bypass waking up vhost_woker for vdpa vq kick
- [PATCH] vdpa: bypass waking up vhost_woker for vdpa vq kick
- [PATCH] vhost: do not enable VHOST_MENU by default
- [PATCH] vhost: do not enable VHOST_MENU by default