Re: [PATCH v2 1/2] virtio_balloon: add work around for out of spec QEMU

From: kernel test robot
Date: Thu Jul 11 2024 - 09:24:38 EST


Hi Michael,

kernel test robot noticed the following build errors:

[auto build test ERROR on next-20240710]
[cannot apply to uml/next remoteproc/rproc-next s390/features linus/master uml/fixes v6.10-rc7 v6.10-rc6 v6.10-rc5 v6.10-rc7]
[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#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Michael-S-Tsirkin/virtio_balloon-add-work-around-for-out-of-spec-QEMU/20240711-004346
base: next-20240710
patch link: https://lore.kernel.org/r/19d916257b76148f89de7386389eeb7267b1b61c.1720611677.git.mst%40redhat.com
patch subject: [PATCH v2 1/2] virtio_balloon: add work around for out of spec QEMU
config: i386-randconfig-005-20240711 (https://download.01.org/0day-ci/archive/20240711/202407112126.plGUWi8I-lkp@xxxxxxxxx/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240711/202407112126.plGUWi8I-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407112126.plGUWi8I-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> drivers/virtio/virtio_balloon.c:603:55: error: too few arguments to function call, expected 5, have 4
602 | err = virtio_find_vqs(vb->vdev,
| ~~~~~~~~~~~~~~~
603 | VIRTIO_BALLOON_VQ_REPORTING, vqs_info, NULL);
| ^
include/linux/virtio_config.h:225:5: note: 'virtio_find_vqs' declared here
225 | int virtio_find_vqs(struct virtio_device *vdev, unsigned int nvqs,
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
226 | struct virtqueue *vqs[],
| ~~~~~~~~~~~~~~~~~~~~~~~~
227 | struct virtqueue_info vqs_info[],
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
228 | struct irq_affinity *desc)
| ~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.


vim +603 drivers/virtio/virtio_balloon.c

560
561 static int init_vqs(struct virtio_balloon *vb)
562 {
563 struct virtqueue_info vqs_info[VIRTIO_BALLOON_VQ_MAX] = {};
564 struct virtqueue *vqs[VIRTIO_BALLOON_VQ_MAX];
565 int err;
566
567 /*
568 * Inflateq and deflateq are used unconditionally. The names[]
569 * will be NULL if the related feature is not enabled, which will
570 * cause no allocation for the corresponding virtqueue in find_vqs.
571 */
572 vqs_info[VIRTIO_BALLOON_VQ_INFLATE].callback = balloon_ack;
573 vqs_info[VIRTIO_BALLOON_VQ_INFLATE].name = "inflate";
574 vqs_info[VIRTIO_BALLOON_VQ_DEFLATE].callback = balloon_ack;
575 vqs_info[VIRTIO_BALLOON_VQ_DEFLATE].name = "deflate";
576
577 if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_STATS_VQ)) {
578 vqs_info[VIRTIO_BALLOON_VQ_STATS].name = "stats";
579 vqs_info[VIRTIO_BALLOON_VQ_STATS].callback = stats_request;
580 }
581
582 if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT))
583 vqs_info[VIRTIO_BALLOON_VQ_FREE_PAGE].name = "free_page_vq";
584
585 if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_REPORTING)) {
586 vqs_info[VIRTIO_BALLOON_VQ_REPORTING].name = "reporting_vq";
587 vqs_info[VIRTIO_BALLOON_VQ_REPORTING].callback = balloon_ack;
588 }
589
590 err = virtio_find_vqs(vb->vdev, VIRTIO_BALLOON_VQ_MAX, vqs,
591 vqs_info, NULL);
592 if (err) {
593 /*
594 * Try to work around QEMU bug which since 2020 confused vq numbers
595 * when VIRTIO_BALLOON_F_REPORTING but not
596 * VIRTIO_BALLOON_F_FREE_PAGE_HINT are offered.
597 */
598 if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_REPORTING) &&
599 !virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) {
600 vqs_info[VIRTIO_BALLOON_VQ_FREE_PAGE].name = "reporting_vq";
601 vqs_info[VIRTIO_BALLOON_VQ_FREE_PAGE].callback = balloon_ack;
602 err = virtio_find_vqs(vb->vdev,
> 603 VIRTIO_BALLOON_VQ_REPORTING, vqs_info, NULL);
604 }
605
606 if (err)
607 return err;
608 }
609
610 vb->inflate_vq = vqs[VIRTIO_BALLOON_VQ_INFLATE];
611 vb->deflate_vq = vqs[VIRTIO_BALLOON_VQ_DEFLATE];
612 if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_STATS_VQ)) {
613 struct scatterlist sg;
614 unsigned int num_stats;
615 vb->stats_vq = vqs[VIRTIO_BALLOON_VQ_STATS];
616
617 /*
618 * Prime this virtqueue with one buffer so the hypervisor can
619 * use it to signal us later (it can't be broken yet!).
620 */
621 num_stats = update_balloon_stats(vb);
622
623 sg_init_one(&sg, vb->stats, sizeof(vb->stats[0]) * num_stats);
624 err = virtqueue_add_outbuf(vb->stats_vq, &sg, 1, vb,
625 GFP_KERNEL);
626 if (err) {
627 dev_warn(&vb->vdev->dev, "%s: add stat_vq failed\n",
628 __func__);
629 return err;
630 }
631 virtqueue_kick(vb->stats_vq);
632 }
633
634 if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT))
635 vb->free_page_vq = vqs[VIRTIO_BALLOON_VQ_FREE_PAGE];
636
637 if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_REPORTING))
638 vb->reporting_vq = vqs[VIRTIO_BALLOON_VQ_REPORTING];
639
640 return 0;
641 }
642

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