From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [RFC v4 05/11] vdpa: Support transferring virtual addressing during DMA mapping
Date: Wed, 24 Feb 2021 03:16:09 +0800 [thread overview]
Message-ID: <202102240349.5sufGSRK-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 5216 bytes --]
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210223115048.435-6-xieyongji@bytedance.com>
References: <20210223115048.435-6-xieyongji@bytedance.com>
TO: Xie Yongji <xieyongji@bytedance.com>
Hi Xie,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on vhost/linux-next]
[also build test WARNING on next-20210223]
[cannot apply to lwn/docs-next linus/master v5.11]
[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/20210223-200222
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago
config: i386-randconfig-m021-20210223 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 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:660 vhost_vdpa_va_map() warn: inconsistent returns '&dev->mm->mmap_lock'.
Old smatch warnings:
drivers/vhost/vdpa.c:740 vhost_vdpa_process_iotlb_update() warn: should '(last_pfn - map_pfn + 1) << 12' be a 64 bit type?
drivers/vhost/vdpa.c:742 vhost_vdpa_process_iotlb_update() warn: should 'map_pfn << 12' be a 64 bit type?
drivers/vhost/vdpa.c:771 vhost_vdpa_process_iotlb_update() warn: should '(last_pfn - map_pfn + 1) << 12' be a 64 bit type?
drivers/vhost/vdpa.c:772 vhost_vdpa_process_iotlb_update() warn: should 'map_pfn << 12' be a 64 bit type?
vim +660 drivers/vhost/vdpa.c
4c8cf31885f69e Tiwei Bie 2020-03-26 613
d8433d0f11798a Xie Yongji 2021-02-23 614 static int vhost_vdpa_va_map(struct vhost_vdpa *v,
d8433d0f11798a Xie Yongji 2021-02-23 615 u64 iova, u64 size, u64 uaddr, u32 perm)
d8433d0f11798a Xie Yongji 2021-02-23 616 {
d8433d0f11798a Xie Yongji 2021-02-23 617 struct vhost_dev *dev = &v->vdev;
d8433d0f11798a Xie Yongji 2021-02-23 618 u64 offset, map_size, map_iova = iova;
d8433d0f11798a Xie Yongji 2021-02-23 619 struct vdpa_map_file *map_file;
d8433d0f11798a Xie Yongji 2021-02-23 620 struct vm_area_struct *vma;
d8433d0f11798a Xie Yongji 2021-02-23 621 int ret;
d8433d0f11798a Xie Yongji 2021-02-23 622
d8433d0f11798a Xie Yongji 2021-02-23 623 mmap_read_lock(dev->mm);
d8433d0f11798a Xie Yongji 2021-02-23 624
d8433d0f11798a Xie Yongji 2021-02-23 625 while (size) {
d8433d0f11798a Xie Yongji 2021-02-23 626 vma = find_vma(dev->mm, uaddr);
d8433d0f11798a Xie Yongji 2021-02-23 627 if (!vma) {
d8433d0f11798a Xie Yongji 2021-02-23 628 ret = -EINVAL;
d8433d0f11798a Xie Yongji 2021-02-23 629 goto err;
d8433d0f11798a Xie Yongji 2021-02-23 630 }
d8433d0f11798a Xie Yongji 2021-02-23 631 map_size = min(size, vma->vm_end - uaddr);
d8433d0f11798a Xie Yongji 2021-02-23 632 offset = (vma->vm_pgoff << PAGE_SHIFT) + uaddr - vma->vm_start;
d8433d0f11798a Xie Yongji 2021-02-23 633 map_file = kzalloc(sizeof(*map_file), GFP_KERNEL);
d8433d0f11798a Xie Yongji 2021-02-23 634 if (!map_file) {
d8433d0f11798a Xie Yongji 2021-02-23 635 ret = -ENOMEM;
d8433d0f11798a Xie Yongji 2021-02-23 636 goto err;
d8433d0f11798a Xie Yongji 2021-02-23 637 }
d8433d0f11798a Xie Yongji 2021-02-23 638 if (vma->vm_file && (vma->vm_flags & VM_SHARED) &&
d8433d0f11798a Xie Yongji 2021-02-23 639 !(vma->vm_flags & (VM_IO | VM_PFNMAP))) {
d8433d0f11798a Xie Yongji 2021-02-23 640 map_file->file = get_file(vma->vm_file);
d8433d0f11798a Xie Yongji 2021-02-23 641 map_file->offset = offset;
d8433d0f11798a Xie Yongji 2021-02-23 642 }
d8433d0f11798a Xie Yongji 2021-02-23 643 ret = vhost_vdpa_map(v, map_iova, map_size, uaddr,
d8433d0f11798a Xie Yongji 2021-02-23 644 perm, map_file);
d8433d0f11798a Xie Yongji 2021-02-23 645 if (ret) {
d8433d0f11798a Xie Yongji 2021-02-23 646 if (map_file->file)
d8433d0f11798a Xie Yongji 2021-02-23 647 fput(map_file->file);
d8433d0f11798a Xie Yongji 2021-02-23 648 kfree(map_file);
d8433d0f11798a Xie Yongji 2021-02-23 649 goto err;
d8433d0f11798a Xie Yongji 2021-02-23 650 }
d8433d0f11798a Xie Yongji 2021-02-23 651 size -= map_size;
d8433d0f11798a Xie Yongji 2021-02-23 652 uaddr += map_size;
d8433d0f11798a Xie Yongji 2021-02-23 653 map_iova += map_size;
d8433d0f11798a Xie Yongji 2021-02-23 654 }
d8433d0f11798a Xie Yongji 2021-02-23 655 mmap_read_unlock(dev->mm);
d8433d0f11798a Xie Yongji 2021-02-23 656
d8433d0f11798a Xie Yongji 2021-02-23 657 return 0;
d8433d0f11798a Xie Yongji 2021-02-23 658 err:
d8433d0f11798a Xie Yongji 2021-02-23 659 vhost_vdpa_unmap(v, iova, map_iova - iova);
d8433d0f11798a Xie Yongji 2021-02-23 @660 return ret;
d8433d0f11798a Xie Yongji 2021-02-23 661 }
d8433d0f11798a Xie Yongji 2021-02-23 662
---
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: 37926 bytes --]
next reply other threads:[~2021-02-23 19:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-23 19:16 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-02-23 11:50 [RFC v4 00/11] Introduce VDUSE - vDPA Device in Userspace Xie Yongji
2021-02-23 11:50 ` [RFC v4 05/11] vdpa: Support transferring virtual addressing during DMA mapping Xie Yongji
2021-02-24 7:37 ` Dan Carpenter
2021-02-24 7:37 ` Dan Carpenter
2021-03-03 10:52 ` Mika Penttilä
2021-03-03 12:45 ` Yongji Xie
2021-03-03 13:38 ` Mika Penttilä
2021-03-04 3:07 ` Jason Wang
2021-03-04 3:07 ` Jason Wang
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=202102240349.5sufGSRK-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.