From: kernel test robot <lkp@intel.com>
To: Xie Yongji <xieyongji@bytedance.com>,
mst@redhat.com, jasowang@redhat.com, xiaodong.liu@intel.com,
maxime.coquelin@redhat.com, stefanha@redhat.com
Cc: virtualization@lists.linux-foundation.org,
kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
songmuchun@bytedance.com
Subject: Re: [PATCH v2 5/5] vduse: Support registering userspace memory for IOTLB
Date: Fri, 8 Jul 2022 09:14:08 +0800 [thread overview]
Message-ID: <202207080910.VfMFrTtN-lkp@intel.com> (raw)
In-Reply-To: <20220706050503.171-6-xieyongji@bytedance.com>
Hi Xie,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.19-rc5 next-20220707]
[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/Xie-Yongji/VDUSE-Support-registering-userspace-memory-as-bounce-buffer/20220706-130802
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git e35e5b6f695d241ffb1d223207da58a1fbcdff4b
config: parisc-randconfig-r003-20220707 (https://download.01.org/0day-ci/archive/20220708/202207080910.VfMFrTtN-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 11.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/9be699264e4fede9c3be913b2d1003c260d9fa05
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Xie-Yongji/VDUSE-Support-registering-userspace-memory-as-bounce-buffer/20220706-130802
git checkout 9be699264e4fede9c3be913b2d1003c260d9fa05
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=parisc SHELL=/bin/bash drivers/vdpa/vdpa_user/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
drivers/vdpa/vdpa_user/vduse_dev.c: In function 'vduse_dev_dereg_iotlb_mem':
>> drivers/vdpa/vdpa_user/vduse_dev.c:949:9: error: implicit declaration of function 'vfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration]
949 | vfree(dev->iotlb_mem->pages);
| ^~~~~
| kvfree
drivers/vdpa/vdpa_user/vduse_dev.c: In function 'vduse_dev_reg_iotlb_mem':
>> drivers/vdpa/vdpa_user/vduse_dev.c:978:21: error: implicit declaration of function '__vmalloc'; did you mean '__kmalloc'? [-Werror=implicit-function-declaration]
978 | page_list = __vmalloc(array_size(npages, sizeof(struct page *)),
| ^~~~~~~~~
| __kmalloc
>> drivers/vdpa/vdpa_user/vduse_dev.c:978:19: warning: assignment to 'struct page **' from 'int' makes pointer from integer without a cast [-Wint-conversion]
978 | page_list = __vmalloc(array_size(npages, sizeof(struct page *)),
| ^
cc1: some warnings being treated as errors
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for DRM_DP_AUX_BUS
Depends on HAS_IOMEM && DRM && OF
Selected by
- DRM_MSM && HAS_IOMEM && DRM && (ARCH_QCOM || SOC_IMX5 || COMPILE_TEST && COMMON_CLK && IOMMU_SUPPORT && (QCOM_OCMEM || QCOM_OCMEM && (QCOM_LLCC || QCOM_LLCC && (QCOM_COMMAND_DB || QCOM_COMMAND_DB
vim +949 drivers/vdpa/vdpa_user/vduse_dev.c
929
930 static int vduse_dev_dereg_iotlb_mem(struct vduse_dev *dev,
931 u64 iova, u64 size)
932 {
933 int ret;
934
935 mutex_lock(&dev->mem_lock);
936 ret = -ENOENT;
937 if (!dev->iotlb_mem)
938 goto unlock;
939
940 ret = -EINVAL;
941 if (dev->iotlb_mem->iova != iova || size != dev->domain->bounce_size)
942 goto unlock;
943
944 vduse_domain_remove_user_bounce_pages(dev->domain);
945 unpin_user_pages_dirty_lock(dev->iotlb_mem->pages,
946 dev->iotlb_mem->npages, true);
947 atomic64_sub(dev->iotlb_mem->npages, &dev->iotlb_mem->mm->pinned_vm);
948 mmdrop(dev->iotlb_mem->mm);
> 949 vfree(dev->iotlb_mem->pages);
950 kfree(dev->iotlb_mem);
951 dev->iotlb_mem = NULL;
952 ret = 0;
953 unlock:
954 mutex_unlock(&dev->mem_lock);
955 return ret;
956 }
957
958 static int vduse_dev_reg_iotlb_mem(struct vduse_dev *dev,
959 u64 iova, u64 uaddr, u64 size)
960 {
961 struct page **page_list = NULL;
962 struct vduse_iotlb_mem *mem = NULL;
963 long pinned = 0;
964 unsigned long npages, lock_limit;
965 int ret;
966
967 if (size != dev->domain->bounce_size ||
968 iova != 0 || uaddr & ~PAGE_MASK)
969 return -EINVAL;
970
971 mutex_lock(&dev->mem_lock);
972 ret = -EEXIST;
973 if (dev->iotlb_mem)
974 goto unlock;
975
976 ret = -ENOMEM;
977 npages = size >> PAGE_SHIFT;
> 978 page_list = __vmalloc(array_size(npages, sizeof(struct page *)),
979 GFP_KERNEL_ACCOUNT);
980 mem = kzalloc(sizeof(*mem), GFP_KERNEL);
981 if (!page_list || !mem)
982 goto unlock;
983
984 mmap_read_lock(current->mm);
985
986 lock_limit = PFN_DOWN(rlimit(RLIMIT_MEMLOCK));
987 if (npages + atomic64_read(¤t->mm->pinned_vm) > lock_limit)
988 goto out;
989
990 pinned = pin_user_pages(uaddr, npages, FOLL_LONGTERM | FOLL_WRITE,
991 page_list, NULL);
992 if (pinned != npages) {
993 ret = pinned < 0 ? pinned : -ENOMEM;
994 goto out;
995 }
996
997 ret = vduse_domain_add_user_bounce_pages(dev->domain,
998 page_list, pinned);
999 if (ret)
1000 goto out;
1001
1002 atomic64_add(npages, ¤t->mm->pinned_vm);
1003
1004 mem->pages = page_list;
1005 mem->npages = pinned;
1006 mem->iova = iova;
1007 mem->mm = current->mm;
1008 mmgrab(current->mm);
1009
1010 dev->iotlb_mem = mem;
1011 out:
1012 if (ret && pinned > 0)
1013 unpin_user_pages(page_list, pinned);
1014
1015 mmap_read_unlock(current->mm);
1016 unlock:
1017 if (ret) {
1018 vfree(page_list);
1019 kfree(mem);
1020 }
1021 mutex_unlock(&dev->mem_lock);
1022 return ret;
1023 }
1024
--
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Xie Yongji <xieyongji@bytedance.com>,
mst@redhat.com, jasowang@redhat.com, xiaodong.liu@intel.com,
maxime.coquelin@redhat.com, stefanha@redhat.com
Cc: kbuild-all@lists.01.org, songmuchun@bytedance.com,
virtualization@lists.linux-foundation.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/5] vduse: Support registering userspace memory for IOTLB
Date: Fri, 8 Jul 2022 09:14:08 +0800 [thread overview]
Message-ID: <202207080910.VfMFrTtN-lkp@intel.com> (raw)
In-Reply-To: <20220706050503.171-6-xieyongji@bytedance.com>
Hi Xie,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.19-rc5 next-20220707]
[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/Xie-Yongji/VDUSE-Support-registering-userspace-memory-as-bounce-buffer/20220706-130802
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git e35e5b6f695d241ffb1d223207da58a1fbcdff4b
config: parisc-randconfig-r003-20220707 (https://download.01.org/0day-ci/archive/20220708/202207080910.VfMFrTtN-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 11.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/9be699264e4fede9c3be913b2d1003c260d9fa05
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Xie-Yongji/VDUSE-Support-registering-userspace-memory-as-bounce-buffer/20220706-130802
git checkout 9be699264e4fede9c3be913b2d1003c260d9fa05
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=parisc SHELL=/bin/bash drivers/vdpa/vdpa_user/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
drivers/vdpa/vdpa_user/vduse_dev.c: In function 'vduse_dev_dereg_iotlb_mem':
>> drivers/vdpa/vdpa_user/vduse_dev.c:949:9: error: implicit declaration of function 'vfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration]
949 | vfree(dev->iotlb_mem->pages);
| ^~~~~
| kvfree
drivers/vdpa/vdpa_user/vduse_dev.c: In function 'vduse_dev_reg_iotlb_mem':
>> drivers/vdpa/vdpa_user/vduse_dev.c:978:21: error: implicit declaration of function '__vmalloc'; did you mean '__kmalloc'? [-Werror=implicit-function-declaration]
978 | page_list = __vmalloc(array_size(npages, sizeof(struct page *)),
| ^~~~~~~~~
| __kmalloc
>> drivers/vdpa/vdpa_user/vduse_dev.c:978:19: warning: assignment to 'struct page **' from 'int' makes pointer from integer without a cast [-Wint-conversion]
978 | page_list = __vmalloc(array_size(npages, sizeof(struct page *)),
| ^
cc1: some warnings being treated as errors
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for DRM_DP_AUX_BUS
Depends on HAS_IOMEM && DRM && OF
Selected by
- DRM_MSM && HAS_IOMEM && DRM && (ARCH_QCOM || SOC_IMX5 || COMPILE_TEST && COMMON_CLK && IOMMU_SUPPORT && (QCOM_OCMEM || QCOM_OCMEM && (QCOM_LLCC || QCOM_LLCC && (QCOM_COMMAND_DB || QCOM_COMMAND_DB
vim +949 drivers/vdpa/vdpa_user/vduse_dev.c
929
930 static int vduse_dev_dereg_iotlb_mem(struct vduse_dev *dev,
931 u64 iova, u64 size)
932 {
933 int ret;
934
935 mutex_lock(&dev->mem_lock);
936 ret = -ENOENT;
937 if (!dev->iotlb_mem)
938 goto unlock;
939
940 ret = -EINVAL;
941 if (dev->iotlb_mem->iova != iova || size != dev->domain->bounce_size)
942 goto unlock;
943
944 vduse_domain_remove_user_bounce_pages(dev->domain);
945 unpin_user_pages_dirty_lock(dev->iotlb_mem->pages,
946 dev->iotlb_mem->npages, true);
947 atomic64_sub(dev->iotlb_mem->npages, &dev->iotlb_mem->mm->pinned_vm);
948 mmdrop(dev->iotlb_mem->mm);
> 949 vfree(dev->iotlb_mem->pages);
950 kfree(dev->iotlb_mem);
951 dev->iotlb_mem = NULL;
952 ret = 0;
953 unlock:
954 mutex_unlock(&dev->mem_lock);
955 return ret;
956 }
957
958 static int vduse_dev_reg_iotlb_mem(struct vduse_dev *dev,
959 u64 iova, u64 uaddr, u64 size)
960 {
961 struct page **page_list = NULL;
962 struct vduse_iotlb_mem *mem = NULL;
963 long pinned = 0;
964 unsigned long npages, lock_limit;
965 int ret;
966
967 if (size != dev->domain->bounce_size ||
968 iova != 0 || uaddr & ~PAGE_MASK)
969 return -EINVAL;
970
971 mutex_lock(&dev->mem_lock);
972 ret = -EEXIST;
973 if (dev->iotlb_mem)
974 goto unlock;
975
976 ret = -ENOMEM;
977 npages = size >> PAGE_SHIFT;
> 978 page_list = __vmalloc(array_size(npages, sizeof(struct page *)),
979 GFP_KERNEL_ACCOUNT);
980 mem = kzalloc(sizeof(*mem), GFP_KERNEL);
981 if (!page_list || !mem)
982 goto unlock;
983
984 mmap_read_lock(current->mm);
985
986 lock_limit = PFN_DOWN(rlimit(RLIMIT_MEMLOCK));
987 if (npages + atomic64_read(¤t->mm->pinned_vm) > lock_limit)
988 goto out;
989
990 pinned = pin_user_pages(uaddr, npages, FOLL_LONGTERM | FOLL_WRITE,
991 page_list, NULL);
992 if (pinned != npages) {
993 ret = pinned < 0 ? pinned : -ENOMEM;
994 goto out;
995 }
996
997 ret = vduse_domain_add_user_bounce_pages(dev->domain,
998 page_list, pinned);
999 if (ret)
1000 goto out;
1001
1002 atomic64_add(npages, ¤t->mm->pinned_vm);
1003
1004 mem->pages = page_list;
1005 mem->npages = pinned;
1006 mem->iova = iova;
1007 mem->mm = current->mm;
1008 mmgrab(current->mm);
1009
1010 dev->iotlb_mem = mem;
1011 out:
1012 if (ret && pinned > 0)
1013 unpin_user_pages(page_list, pinned);
1014
1015 mmap_read_unlock(current->mm);
1016 unlock:
1017 if (ret) {
1018 vfree(page_list);
1019 kfree(mem);
1020 }
1021 mutex_unlock(&dev->mem_lock);
1022 return ret;
1023 }
1024
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next prev parent reply other threads:[~2022-07-08 1:14 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 5:04 [PATCH v2 0/5] VDUSE: Support registering userspace memory as bounce buffer Xie Yongji
2022-07-06 5:04 ` [PATCH v2 1/5] vduse: Remove unnecessary spin lock protection Xie Yongji
2022-07-13 5:43 ` Jason Wang
2022-07-13 5:43 ` Jason Wang
2022-07-13 11:08 ` Yongji Xie
2022-07-14 2:27 ` Jason Wang
2022-07-14 2:27 ` Jason Wang
2022-07-14 6:06 ` Yongji Xie
2022-07-13 5:57 ` Michael S. Tsirkin
2022-07-13 5:57 ` Michael S. Tsirkin
2022-07-13 10:39 ` Yongji Xie
2022-07-06 5:05 ` [PATCH v2 2/5] vduse: Use memcpy_{to,from}_page() in do_bounce() Xie Yongji
2022-07-13 5:59 ` Jason Wang
2022-07-13 5:59 ` Jason Wang
2022-07-06 5:05 ` [PATCH v2 3/5] vduse: Support using userspace pages as bounce buffer Xie Yongji
2022-07-06 5:05 ` [PATCH v2 4/5] vduse: Support querying IOLTB information Xie Yongji
2022-07-14 2:51 ` Jason Wang
2022-07-14 2:51 ` Jason Wang
2022-07-14 5:58 ` Yongji Xie
2022-07-06 5:05 ` [PATCH v2 5/5] vduse: Support registering userspace memory for IOTLB Xie Yongji
2022-07-06 6:08 ` kernel test robot
2022-07-06 6:08 ` kernel test robot
2022-07-07 23:01 ` kernel test robot
2022-07-07 23:01 ` kernel test robot
2022-07-08 1:14 ` kernel test robot [this message]
2022-07-08 1:14 ` kernel test robot
2022-07-06 9:30 ` [PATCH v2 0/5] VDUSE: Support registering userspace memory as bounce buffer Jason Wang
2022-07-06 9:30 ` Jason Wang
2022-07-06 10:15 ` Yongji Xie
2022-07-08 8:38 ` Jason Wang
2022-07-08 8:38 ` Jason Wang
2022-07-08 9:53 ` Yongji Xie
2022-07-11 6:02 ` Jason Wang
2022-07-11 6:02 ` Jason Wang
2022-07-11 7:24 ` Yongji Xie
2022-07-14 2:59 ` Jason Wang
2022-07-14 2:59 ` 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=202207080910.VfMFrTtN-lkp@intel.com \
--to=lkp@intel.com \
--cc=jasowang@redhat.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.coquelin@redhat.com \
--cc=mst@redhat.com \
--cc=songmuchun@bytedance.com \
--cc=stefanha@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=xiaodong.liu@intel.com \
--cc=xieyongji@bytedance.com \
/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.