From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH v12 10/13] vdpa: Support transferring virtual addressing during DMA mapping
Date: Tue, 31 Aug 2021 08:10:14 +0800 [thread overview]
Message-ID: <202108310830.Fzvyfqrt-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 5440 bytes --]
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210830141737.181-11-xieyongji@bytedance.com>
References: <20210830141737.181-11-xieyongji@bytedance.com>
TO: Xie Yongji <xieyongji@bytedance.com>
TO: mst(a)redhat.com
TO: jasowang(a)redhat.com
TO: stefanha(a)redhat.com
TO: sgarzare(a)redhat.com
TO: parav(a)nvidia.com
TO: hch(a)infradead.org
TO: christian.brauner(a)canonical.com
TO: rdunlap(a)infradead.org
TO: willy(a)infradead.org
TO: viro(a)zeniv.linux.org.uk
Hi Xie,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on vhost/linux-next]
[cannot apply to iommu/next lwn/docs-next linus/master v5.14 next-20210830]
[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/Xie-Yongji/Introduce-VDUSE-vDPA-Device-in-Userspace/20210830-222539
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
:::::: branch date: 10 hours ago
:::::: commit date: 10 hours ago
config: i386-randconfig-m021-20210830 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
New smatch warnings:
drivers/vhost/vdpa.c:678 vhost_vdpa_va_map() error: uninitialized symbol 'ret'.
Old smatch warnings:
drivers/vhost/vdpa.c:749 vhost_vdpa_pa_map() warn: should '(last_pfn - map_pfn + 1) << 12' be a 64 bit type?
drivers/vhost/vdpa.c:751 vhost_vdpa_pa_map() warn: should 'map_pfn << 12' be a 64 bit type?
drivers/vhost/vdpa.c:780 vhost_vdpa_pa_map() warn: should '(last_pfn - map_pfn + 1) << 12' be a 64 bit type?
drivers/vhost/vdpa.c:781 vhost_vdpa_pa_map() warn: should 'map_pfn << 12' be a 64 bit type?
vim +/ret +678 drivers/vhost/vdpa.c
4c8cf31885f69e Tiwei Bie 2020-03-26 635
bc2f05f3bbe143 Xie Yongji 2021-08-30 636 static int vhost_vdpa_va_map(struct vhost_vdpa *v,
bc2f05f3bbe143 Xie Yongji 2021-08-30 637 u64 iova, u64 size, u64 uaddr, u32 perm)
bc2f05f3bbe143 Xie Yongji 2021-08-30 638 {
bc2f05f3bbe143 Xie Yongji 2021-08-30 639 struct vhost_dev *dev = &v->vdev;
bc2f05f3bbe143 Xie Yongji 2021-08-30 640 u64 offset, map_size, map_iova = iova;
bc2f05f3bbe143 Xie Yongji 2021-08-30 641 struct vdpa_map_file *map_file;
bc2f05f3bbe143 Xie Yongji 2021-08-30 642 struct vm_area_struct *vma;
bc2f05f3bbe143 Xie Yongji 2021-08-30 643 int ret;
bc2f05f3bbe143 Xie Yongji 2021-08-30 644
bc2f05f3bbe143 Xie Yongji 2021-08-30 645 mmap_read_lock(dev->mm);
bc2f05f3bbe143 Xie Yongji 2021-08-30 646
bc2f05f3bbe143 Xie Yongji 2021-08-30 647 while (size) {
bc2f05f3bbe143 Xie Yongji 2021-08-30 648 vma = find_vma(dev->mm, uaddr);
bc2f05f3bbe143 Xie Yongji 2021-08-30 649 if (!vma) {
bc2f05f3bbe143 Xie Yongji 2021-08-30 650 ret = -EINVAL;
bc2f05f3bbe143 Xie Yongji 2021-08-30 651 break;
bc2f05f3bbe143 Xie Yongji 2021-08-30 652 }
bc2f05f3bbe143 Xie Yongji 2021-08-30 653 map_size = min(size, vma->vm_end - uaddr);
bc2f05f3bbe143 Xie Yongji 2021-08-30 654 if (!(vma->vm_file && (vma->vm_flags & VM_SHARED) &&
bc2f05f3bbe143 Xie Yongji 2021-08-30 655 !(vma->vm_flags & (VM_IO | VM_PFNMAP))))
bc2f05f3bbe143 Xie Yongji 2021-08-30 656 goto next;
bc2f05f3bbe143 Xie Yongji 2021-08-30 657
bc2f05f3bbe143 Xie Yongji 2021-08-30 658 map_file = kzalloc(sizeof(*map_file), GFP_KERNEL);
bc2f05f3bbe143 Xie Yongji 2021-08-30 659 if (!map_file) {
bc2f05f3bbe143 Xie Yongji 2021-08-30 660 ret = -ENOMEM;
bc2f05f3bbe143 Xie Yongji 2021-08-30 661 break;
bc2f05f3bbe143 Xie Yongji 2021-08-30 662 }
bc2f05f3bbe143 Xie Yongji 2021-08-30 663 offset = (vma->vm_pgoff << PAGE_SHIFT) + uaddr - vma->vm_start;
bc2f05f3bbe143 Xie Yongji 2021-08-30 664 map_file->offset = offset;
bc2f05f3bbe143 Xie Yongji 2021-08-30 665 map_file->file = get_file(vma->vm_file);
bc2f05f3bbe143 Xie Yongji 2021-08-30 666 ret = vhost_vdpa_map(v, map_iova, map_size, uaddr,
bc2f05f3bbe143 Xie Yongji 2021-08-30 667 perm, map_file);
bc2f05f3bbe143 Xie Yongji 2021-08-30 668 if (ret) {
bc2f05f3bbe143 Xie Yongji 2021-08-30 669 fput(map_file->file);
bc2f05f3bbe143 Xie Yongji 2021-08-30 670 kfree(map_file);
bc2f05f3bbe143 Xie Yongji 2021-08-30 671 break;
bc2f05f3bbe143 Xie Yongji 2021-08-30 672 }
bc2f05f3bbe143 Xie Yongji 2021-08-30 673 next:
bc2f05f3bbe143 Xie Yongji 2021-08-30 674 size -= map_size;
bc2f05f3bbe143 Xie Yongji 2021-08-30 675 uaddr += map_size;
bc2f05f3bbe143 Xie Yongji 2021-08-30 676 map_iova += map_size;
bc2f05f3bbe143 Xie Yongji 2021-08-30 677 }
bc2f05f3bbe143 Xie Yongji 2021-08-30 @678 if (ret)
bc2f05f3bbe143 Xie Yongji 2021-08-30 679 vhost_vdpa_unmap(v, iova, map_iova - iova);
bc2f05f3bbe143 Xie Yongji 2021-08-30 680
bc2f05f3bbe143 Xie Yongji 2021-08-30 681 mmap_read_unlock(dev->mm);
bc2f05f3bbe143 Xie Yongji 2021-08-30 682
bc2f05f3bbe143 Xie Yongji 2021-08-30 683 return ret;
bc2f05f3bbe143 Xie Yongji 2021-08-30 684 }
bc2f05f3bbe143 Xie Yongji 2021-08-30 685
---
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: 38659 bytes --]
next reply other threads:[~2021-08-31 0:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-31 0:10 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-08-30 14:17 [PATCH v12 00/13] Introduce VDUSE - vDPA Device in Userspace Xie Yongji
2021-08-30 14:17 ` [PATCH v12 10/13] vdpa: Support transferring virtual addressing during DMA mapping Xie Yongji
2021-08-30 14:17 ` Xie Yongji
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=202108310830.Fzvyfqrt-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/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.