From: kernel test robot <lkp@intel.com>
To: Cindy Lu <lulu@redhat.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [RFC v1 3/8] vhost: Add 3 new uapi to support iommufd
Date: Sat, 4 Nov 2023 13:39:24 +0800 [thread overview]
Message-ID: <202311041343.cTi89BKg-lkp@intel.com> (raw)
In-Reply-To: <20231103171641.1703146-4-lulu@redhat.com>
Hi Cindy,
[This is a private test report for your RFC patch.]
kernel test robot noticed the following build warnings:
[auto build test WARNING on linus/master]
[also build test WARNING on v6.6]
[cannot apply to mst-vhost/linux-next joro-iommu/next next-20231103]
[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/Cindy-Lu/vhost-iommufd-Add-the-functions-support-iommufd/20231104-011948
base: linus/master
patch link: https://lore.kernel.org/r/20231103171641.1703146-4-lulu%40redhat.com
patch subject: [RFC v1 3/8] vhost: Add 3 new uapi to support iommufd
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20231104/202311041343.cTi89BKg-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231104/202311041343.cTi89BKg-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311041343.cTi89BKg-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/vhost/vdpa.c: In function 'vhost_vdpa_iommufd_set_device':
drivers/vhost/vdpa.c:584:26: error: 'struct vdpa_device' has no member named 'iommufd_ictx'
584 | if (!vdpa->iommufd_ictx || !vdpa->iommufd_device)
| ^~
drivers/vhost/vdpa.c:584:49: error: 'struct vdpa_device' has no member named 'iommufd_device'
584 | if (!vdpa->iommufd_ictx || !vdpa->iommufd_device)
| ^~
drivers/vhost/vdpa.c:586:38: error: 'struct vdpa_device' has no member named 'iommufd_users'
586 | if (atomic_read(&vdpa->iommufd_users)) {
| ^~
drivers/vhost/vdpa.c:587:41: error: 'struct vdpa_device' has no member named 'iommufd_users'
587 | atomic_dec(&vdpa->iommufd_users);
| ^~
drivers/vhost/vdpa.c:591:21: error: 'struct vdpa_device' has no member named 'iommufd_device'
591 | vdpa->iommufd_device = NULL;
| ^~
drivers/vhost/vdpa.c:592:21: error: 'struct vdpa_device' has no member named 'iommufd_ictx'
592 | vdpa->iommufd_ictx = NULL;
| ^~
drivers/vhost/vdpa.c:597:17: error: 'struct vdpa_device' has no member named 'iommufd_device'
597 | if (vdpa->iommufd_device)
| ^~
drivers/vhost/vdpa.c:628:13: error: 'struct vdpa_device' has no member named 'iommufd_ictx'
628 | vdpa->iommufd_ictx = ictx;
| ^~
drivers/vhost/vdpa.c:631:25: error: 'struct vdpa_device' has no member named 'iommufd_users'
631 | atomic_inc(&vdpa->iommufd_users);
| ^~
drivers/vhost/vdpa.c: At top level:
>> drivers/vhost/vdpa.c:647:5: warning: no previous prototype for 'vhost_vdpa_iommufd_ioas_attach' [-Wmissing-prototypes]
647 | int vhost_vdpa_iommufd_ioas_attach(struct vhost_vdpa *v, void __user *arg)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/vhost/vdpa.c: In function 'vhost_vdpa_iommufd_ioas_attach':
drivers/vhost/vdpa.c:661:29: error: 'const struct vdpa_config_ops' has no member named 'bind_iommufd'
661 | if (!v->vdpa->config->bind_iommufd)
| ^~
drivers/vhost/vdpa.c:664:21: error: 'struct vdpa_device' has no member named 'iommufd_ictx'
664 | if (!v->vdpa->iommufd_ictx) {
| ^~
drivers/vhost/vdpa.c:669:30: error: 'const struct vdpa_config_ops' has no member named 'attach_ioas'
669 | ret = v->vdpa->config->attach_ioas(v->vdpa, &attach.ioas_id);
| ^~
drivers/vhost/vdpa.c: At top level:
>> drivers/vhost/vdpa.c:688:5: warning: no previous prototype for 'vhost_vdpa_iommufd_ioas_detach' [-Wmissing-prototypes]
688 | int vhost_vdpa_iommufd_ioas_detach(struct vhost_vdpa *v, void __user *arg)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/vhost/vdpa.c: In function 'vhost_vdpa_iommufd_ioas_detach':
drivers/vhost/vdpa.c:701:29: error: 'const struct vdpa_config_ops' has no member named 'bind_iommufd'
701 | if (!v->vdpa->config->bind_iommufd)
| ^~
drivers/vhost/vdpa.c:704:20: error: 'struct vdpa_device' has no member named 'iommufd_ictx'
704 | if (v->vdpa->iommufd_ictx) {
| ^~
drivers/vhost/vdpa.c:707:31: error: 'const struct vdpa_config_ops' has no member named 'detach_ioas'
707 | return v->vdpa->config->detach_ioas(v->vdpa);
| ^~
drivers/vhost/vdpa.c: In function 'vhost_vdpa_map':
drivers/vhost/vdpa.c:1066:25: error: 'struct vdpa_device' has no member named 'iommufd_ictx'
1066 | } else if (!vdpa->iommufd_ictx) {
| ^~
drivers/vhost/vdpa.c: In function 'vhost_vdpa_iommufd_ioas_detach':
drivers/vhost/vdpa.c:708:1: warning: control reaches end of non-void function [-Wreturn-type]
708 | }
| ^
vim +/vhost_vdpa_iommufd_ioas_attach +647 drivers/vhost/vdpa.c
550
551 /* After a successful return of ioctl the device must not process more
552 * virtqueue descriptors. The device can answer to read or writes of config
553 * fields as if it were not suspended. In particular, writing to "queue_enable"
554 * with a value of 1 will not make the device start processing buffers.
555 */
556 static long vhost_vdpa_suspend(struct vhost_vdpa *v)
557 {
558 struct vdpa_device *vdpa = v->vdpa;
559 const struct vdpa_config_ops *ops = vdpa->config;
560
561 if (!ops->suspend)
562 return -EOPNOTSUPP;
563
564 return ops->suspend(vdpa);
565 }
566 static long vhost_vdpa_iommufd_set_device(struct vhost_vdpa *v,
567 void __user *argp)
568 {
569 struct device *dma_dev = vdpa_get_dma_dev(v->vdpa);
570 struct vhost_vdpa_set_iommufd set_iommufd;
571 struct vdpa_device *vdpa = v->vdpa;
572 struct iommufd_ctx *ictx;
573 unsigned long minsz;
574 u32 ioas_id, dev_id;
575 struct fd f;
576 long r = 0;
577
578 minsz = offsetofend(struct vhost_vdpa_set_iommufd, iommufd_ioasid);
579 if (copy_from_user(&set_iommufd, argp, minsz))
580 return -EFAULT;
581
582 /* Unset IOMMUFD */
583 if (set_iommufd.iommufd < 0) {
584 if (!vdpa->iommufd_ictx || !vdpa->iommufd_device)
585 return -EINVAL;
586 if (atomic_read(&vdpa->iommufd_users)) {
587 atomic_dec(&vdpa->iommufd_users);
588 return 0;
589 }
590 vdpa_iommufd_unbind(v->vdpa);
591 vdpa->iommufd_device = NULL;
592 vdpa->iommufd_ictx = NULL;
593 return iommu_attach_device(v->domain, dma_dev);
594 }
595
596 /* For same device but different groups, ++refcount only */
597 if (vdpa->iommufd_device)
598 goto out_inc;
599
600 r = -EBADF;
601 f = fdget(set_iommufd.iommufd);
602 if (!f.file)
603 goto out;
604
605 r = -EINVAL;
606 ictx = iommufd_ctx_from_file(f.file);
607 if (IS_ERR(ictx))
608 goto out_fdput;
609
610 if (v->domain) {
611 iommu_device_unuse_default_domain(dma_dev);
612 iommu_detach_device(v->domain, dma_dev);
613 }
614
615 ioas_id = set_iommufd.iommufd_ioasid;
616 r = vdpa_iommufd_bind(vdpa, ictx, &ioas_id, &dev_id);
617 if (r)
618 goto out_reattach;
619
620 set_iommufd.out_dev_id = dev_id;
621 r = copy_to_user(argp + minsz, &set_iommufd.out_dev_id,
622 sizeof(set_iommufd.out_dev_id)) ?
623 -EFAULT :
624 0;
625 if (r)
626 goto out_device_unbind;
627
> 628 vdpa->iommufd_ictx = ictx;
629
630 out_inc:
631 atomic_inc(&vdpa->iommufd_users);
632
633 goto out_fdput;
634
635 out_device_unbind:
636
637 vdpa_iommufd_unbind(vdpa);
638 out_reattach:
639 iommu_device_use_default_domain(dma_dev);
640 iommu_attach_device(v->domain, dma_dev);
641 iommufd_ctx_put(ictx);
642 out_fdput:
643 fdput(f);
644 out:
645 return r;
646 }
> 647 int vhost_vdpa_iommufd_ioas_attach(struct vhost_vdpa *v, void __user *arg)
648 {
649 struct vdpa_device_attach_iommufd_as attach;
650 unsigned long minsz;
651 int ret;
652
653 minsz = offsetofend(struct vdpa_device_attach_iommufd_as, ioas_id);
654
655 if (copy_from_user(&attach, (void __user *)arg, minsz))
656 return -EFAULT;
657
658 if (attach.argsz < minsz || attach.flags)
659 return -EINVAL;
660
661 if (!v->vdpa->config->bind_iommufd)
662 return -ENODEV;
663
> 664 if (!v->vdpa->iommufd_ictx) {
665 ret = -EINVAL;
666 return ret;
667 }
668
669 ret = v->vdpa->config->attach_ioas(v->vdpa, &attach.ioas_id);
670
671 if (ret)
672 return ret;
673
674 ret = copy_to_user(
675 (void __user *)arg +
676 offsetofend(struct vdpa_device_attach_iommufd_as,
677 flags),
678 &attach.ioas_id, sizeof(attach.ioas_id)) ?
679 -EFAULT :
680 0;
681
682 if (ret)
683 return ret;
684
685 return 0;
686 }
687
> 688 int vhost_vdpa_iommufd_ioas_detach(struct vhost_vdpa *v, void __user *arg)
689 {
690 struct vdpa_device_detach_iommufd_as detach;
691 unsigned long minsz;
692
693 minsz = offsetofend(struct vdpa_device_detach_iommufd_as, flags);
694
695 if (copy_from_user(&detach, (void __user *)arg, minsz))
696 return -EFAULT;
697
698 if (detach.argsz < minsz || detach.flags)
699 return -EINVAL;
700
701 if (!v->vdpa->config->bind_iommufd)
702 return -ENODEV;
703
704 if (v->vdpa->iommufd_ictx) {
705 return -EINVAL;
706 }
707 return v->vdpa->config->detach_ioas(v->vdpa);
708 }
709
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2023-11-04 5:40 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-03 17:16 [RFC v1 0/8] vhost-vdpa: add support for iommufd Cindy Lu
2023-11-03 17:16 ` [RFC v1 1/8] vhost/iommufd: Add the functions support iommufd Cindy Lu
2023-11-03 17:16 ` [RFC v1 2/8] Kconfig: Add the new file vhost/iommufd Cindy Lu
2023-11-04 2:34 ` kernel test robot
2023-11-06 8:53 ` Yi Liu
2023-11-07 6:15 ` Cindy Lu
2023-11-03 17:16 ` [RFC v1 3/8] vhost: Add 3 new uapi to support iommufd Cindy Lu
2023-11-04 5:39 ` kernel test robot [this message]
2023-11-06 7:27 ` Jason Wang
2023-11-06 7:27 ` Jason Wang
2023-11-06 7:30 ` Jason Wang
2023-11-06 7:30 ` Jason Wang
2023-11-07 6:57 ` Cindy Lu
2023-11-08 3:03 ` Jason Wang
2023-11-08 6:38 ` Cindy Lu
2023-11-08 7:09 ` Jason Wang
2023-11-10 2:31 ` Jason Wang
2023-11-10 6:49 ` Cindy Lu
2023-11-03 17:16 ` [RFC v1 4/8] vdpa: Add new vdpa_config_ops " Cindy Lu
2023-11-06 8:52 ` Yi Liu
2023-11-03 17:16 ` [RFC v1 5/8] vdpa_sim :Add support for iommufd Cindy Lu
2023-11-03 17:16 ` [RFC v1 6/8] vdpa: change the map/unmap process to support iommufd Cindy Lu
2023-11-06 8:54 ` Yi Liu
2023-11-07 6:14 ` Cindy Lu
2023-11-03 17:16 ` [RFC v1 7/8] vp_vdpa::Add support for iommufd Cindy Lu
2023-11-06 7:25 ` Jason Wang
2023-11-06 7:25 ` Jason Wang
2023-11-03 17:16 ` [RFC v1 8/8] iommu: expose the function iommu_device_use_default_domain Cindy Lu
2023-11-03 17:37 ` Jason Gunthorpe
2023-11-06 7:26 ` Jason Wang
2023-11-06 7:26 ` Jason Wang
2023-11-07 6:10 ` Cindy Lu
2023-11-08 3:03 ` Jason Wang
2023-11-08 7:05 ` Cindy Lu
2023-11-06 4:11 ` [RFC v1 0/8] vhost-vdpa: add support for iommufd Jason Wang
2023-11-06 4:11 ` Jason Wang
2023-11-06 8:05 ` Yi Liu
2023-11-07 7:30 ` Michael S. Tsirkin
2023-11-07 7:30 ` Michael S. Tsirkin
2023-11-07 12:49 ` Jason Gunthorpe
2023-11-07 13:28 ` Michael S. Tsirkin
2023-11-07 13:28 ` Michael S. Tsirkin
2023-11-07 14:12 ` Jason Gunthorpe
2023-11-07 14:30 ` Michael S. Tsirkin
2023-11-07 14:30 ` Michael S. Tsirkin
2023-11-07 15:52 ` Jason Gunthorpe
2023-11-09 23:48 ` Michael S. Tsirkin
2023-11-10 14:00 ` Jason Gunthorpe
2023-11-07 17:02 ` Jakub Kicinski
2023-11-07 14:55 ` Michael S. Tsirkin
2023-11-07 14:55 ` Michael S. Tsirkin
2023-11-07 15:48 ` Jason Gunthorpe
2023-11-07 16:11 ` Michael S. Tsirkin
2023-11-07 16:11 ` Michael S. Tsirkin
2023-11-07 13:23 ` Michael S. Tsirkin
2023-11-07 13:23 ` Michael S. Tsirkin
2024-01-10 22:25 ` Michael S. Tsirkin
2024-01-11 9:02 ` Cindy Lu
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=202311041343.cTi89BKg-lkp@intel.com \
--to=lkp@intel.com \
--cc=lulu@redhat.com \
--cc=oe-kbuild-all@lists.linux.dev \
/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.