From: kernel test robot <lkp@intel.com>
To: Sherry Sun <sherry.sun@nxp.com>,
hch@infradead.org, gregkh@linuxfoundation.org,
sudeep.dutt@intel.com, ashutosh.dixit@intel.com, arnd@arndb.de,
kishon@ti.com, lorenzo.pieralisi@arm.com
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org, linux-imx@nxp.com
Subject: Re: [PATCH V4 2/2] misc: vop: do not allocate and reassign the used ring
Date: Mon, 26 Oct 2020 18:35:55 +0800 [thread overview]
Message-ID: <202010261805.CY3gKXQX-lkp@intel.com> (raw)
In-Reply-To: <20201026085335.30048-3-sherry.sun@nxp.com>
[-- Attachment #1: Type: text/plain, Size: 4753 bytes --]
Hi Sherry,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on soc/for-next linus/master v5.10-rc1 next-20201026]
[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/Sherry-Sun/Change-vring-space-from-nomal-memory-to-dma-coherent-memory/20201026-170616
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 726eb70e0d34dc4bc4dada71f52bba8ed638431e
config: i386-randconfig-s001-20201026 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-56-gc09e8239-dirty
# https://github.com/0day-ci/linux/commit/9ec4633ad59551e4780046500b368eb7993588f3
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Sherry-Sun/Change-vring-space-from-nomal-memory-to-dma-coherent-memory/20201026-170616
git checkout 9ec4633ad59551e4780046500b368eb7993588f3
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
"sparse warnings: (new ones prefixed by >>)"
>> drivers/misc/mic/vop/vop_main.c:339:17: sparse: sparse: cast removes address space '__iomem' of expression
vim +/__iomem +339 drivers/misc/mic/vop/vop_main.c
289
290 /*
291 * This routine will assign vring's allocated in host/io memory. Code in
292 * virtio_ring.c however continues to access this io memory as if it were local
293 * memory without io accessors.
294 */
295 static struct virtqueue *vop_find_vq(struct virtio_device *dev,
296 unsigned index,
297 void (*callback)(struct virtqueue *vq),
298 const char *name, bool ctx)
299 {
300 struct _vop_vdev *vdev = to_vopvdev(dev);
301 struct vop_device *vpdev = vdev->vpdev;
302 struct mic_vqconfig __iomem *vqconfig;
303 struct mic_vqconfig config;
304 struct virtqueue *vq;
305 void __iomem *va;
306 struct _mic_vring_info __iomem *info;
307 void *used;
308 int vr_size, _vr_size, err, magic;
309 u8 type = ioread8(&vdev->desc->type);
310
311 if (index >= ioread8(&vdev->desc->num_vq))
312 return ERR_PTR(-ENOENT);
313
314 if (!name)
315 return ERR_PTR(-ENOENT);
316
317 /* First assign the vring's allocated in host memory */
318 vqconfig = _vop_vq_config(vdev->desc) + index;
319 memcpy_fromio(&config, vqconfig, sizeof(config));
320 _vr_size = round_up(vring_size(le16_to_cpu(config.num), MIC_VIRTIO_RING_ALIGN), 4);
321 vr_size = PAGE_ALIGN(_vr_size + sizeof(struct _mic_vring_info));
322 va = vpdev->hw_ops->remap(vpdev, le64_to_cpu(config.address), vr_size);
323 if (!va)
324 return ERR_PTR(-ENOMEM);
325 vdev->vr[index] = va;
326 memset_io(va, 0x0, _vr_size);
327
328 info = va + _vr_size;
329 magic = ioread32(&info->magic);
330
331 if (WARN(magic != MIC_MAGIC + type + index, "magic mismatch")) {
332 err = -EIO;
333 goto unmap;
334 }
335
336 vdev->used_size[index] = PAGE_ALIGN(sizeof(__u16) * 3 +
337 sizeof(struct vring_used_elem) *
338 le16_to_cpu(config.num));
> 339 used = (void *)va + PAGE_ALIGN(sizeof(struct vring_desc) *
340 le16_to_cpu(config.num) + sizeof(__u16) *
341 (3 + le16_to_cpu(config.num)));
342 vdev->used_virt[index] = used;
343 if (!used) {
344 err = -ENOMEM;
345 dev_err(_vop_dev(vdev), "%s %d err %d\n",
346 __func__, __LINE__, err);
347 goto unmap;
348 }
349
350 vq = vop_new_virtqueue(index, le16_to_cpu(config.num), dev, ctx,
351 (void __force *)va, vop_notify, callback,
352 name, used);
353 if (!vq) {
354 err = -ENOMEM;
355 goto unmap;
356 }
357
358 vdev->used[index] = le64_to_cpu(config.address) +
359 PAGE_ALIGN(sizeof(struct vring_desc) *
360 le16_to_cpu(config.num) + sizeof(__u16) *
361 (3 + le16_to_cpu(config.num)));
362 writeq(vdev->used[index], &vqconfig->used_address);
363
364 vq->priv = vdev;
365 return vq;
366 unmap:
367 vpdev->hw_ops->unmap(vpdev, vdev->vr[index]);
368 return ERR_PTR(err);
369 }
370
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30479 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH V4 2/2] misc: vop: do not allocate and reassign the used ring
Date: Mon, 26 Oct 2020 18:35:55 +0800 [thread overview]
Message-ID: <202010261805.CY3gKXQX-lkp@intel.com> (raw)
In-Reply-To: <20201026085335.30048-3-sherry.sun@nxp.com>
[-- Attachment #1: Type: text/plain, Size: 4874 bytes --]
Hi Sherry,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on soc/for-next linus/master v5.10-rc1 next-20201026]
[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/Sherry-Sun/Change-vring-space-from-nomal-memory-to-dma-coherent-memory/20201026-170616
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 726eb70e0d34dc4bc4dada71f52bba8ed638431e
config: i386-randconfig-s001-20201026 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-56-gc09e8239-dirty
# https://github.com/0day-ci/linux/commit/9ec4633ad59551e4780046500b368eb7993588f3
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Sherry-Sun/Change-vring-space-from-nomal-memory-to-dma-coherent-memory/20201026-170616
git checkout 9ec4633ad59551e4780046500b368eb7993588f3
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
"sparse warnings: (new ones prefixed by >>)"
>> drivers/misc/mic/vop/vop_main.c:339:17: sparse: sparse: cast removes address space '__iomem' of expression
vim +/__iomem +339 drivers/misc/mic/vop/vop_main.c
289
290 /*
291 * This routine will assign vring's allocated in host/io memory. Code in
292 * virtio_ring.c however continues to access this io memory as if it were local
293 * memory without io accessors.
294 */
295 static struct virtqueue *vop_find_vq(struct virtio_device *dev,
296 unsigned index,
297 void (*callback)(struct virtqueue *vq),
298 const char *name, bool ctx)
299 {
300 struct _vop_vdev *vdev = to_vopvdev(dev);
301 struct vop_device *vpdev = vdev->vpdev;
302 struct mic_vqconfig __iomem *vqconfig;
303 struct mic_vqconfig config;
304 struct virtqueue *vq;
305 void __iomem *va;
306 struct _mic_vring_info __iomem *info;
307 void *used;
308 int vr_size, _vr_size, err, magic;
309 u8 type = ioread8(&vdev->desc->type);
310
311 if (index >= ioread8(&vdev->desc->num_vq))
312 return ERR_PTR(-ENOENT);
313
314 if (!name)
315 return ERR_PTR(-ENOENT);
316
317 /* First assign the vring's allocated in host memory */
318 vqconfig = _vop_vq_config(vdev->desc) + index;
319 memcpy_fromio(&config, vqconfig, sizeof(config));
320 _vr_size = round_up(vring_size(le16_to_cpu(config.num), MIC_VIRTIO_RING_ALIGN), 4);
321 vr_size = PAGE_ALIGN(_vr_size + sizeof(struct _mic_vring_info));
322 va = vpdev->hw_ops->remap(vpdev, le64_to_cpu(config.address), vr_size);
323 if (!va)
324 return ERR_PTR(-ENOMEM);
325 vdev->vr[index] = va;
326 memset_io(va, 0x0, _vr_size);
327
328 info = va + _vr_size;
329 magic = ioread32(&info->magic);
330
331 if (WARN(magic != MIC_MAGIC + type + index, "magic mismatch")) {
332 err = -EIO;
333 goto unmap;
334 }
335
336 vdev->used_size[index] = PAGE_ALIGN(sizeof(__u16) * 3 +
337 sizeof(struct vring_used_elem) *
338 le16_to_cpu(config.num));
> 339 used = (void *)va + PAGE_ALIGN(sizeof(struct vring_desc) *
340 le16_to_cpu(config.num) + sizeof(__u16) *
341 (3 + le16_to_cpu(config.num)));
342 vdev->used_virt[index] = used;
343 if (!used) {
344 err = -ENOMEM;
345 dev_err(_vop_dev(vdev), "%s %d err %d\n",
346 __func__, __LINE__, err);
347 goto unmap;
348 }
349
350 vq = vop_new_virtqueue(index, le16_to_cpu(config.num), dev, ctx,
351 (void __force *)va, vop_notify, callback,
352 name, used);
353 if (!vq) {
354 err = -ENOMEM;
355 goto unmap;
356 }
357
358 vdev->used[index] = le64_to_cpu(config.address) +
359 PAGE_ALIGN(sizeof(struct vring_desc) *
360 le16_to_cpu(config.num) + sizeof(__u16) *
361 (3 + le16_to_cpu(config.num)));
362 writeq(vdev->used[index], &vqconfig->used_address);
363
364 vq->priv = vdev;
365 return vq;
366 unmap:
367 vpdev->hw_ops->unmap(vpdev, vdev->vr[index]);
368 return ERR_PTR(err);
369 }
370
---
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: 30479 bytes --]
next prev parent reply other threads:[~2020-10-26 10:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-26 8:53 [PATCH V4 0/2] Change vring space from nomal memory to dma coherent memory Sherry Sun
2020-10-26 8:53 ` [PATCH V4 1/2] misc: vop: change the way of allocating vring and device page Sherry Sun
2020-10-27 10:40 ` Christoph Hellwig
2020-10-27 12:30 ` Sherry Sun
2020-10-26 8:53 ` [PATCH V4 2/2] misc: vop: do not allocate and reassign the used ring Sherry Sun
2020-10-26 10:35 ` kernel test robot [this message]
2020-10-26 10:35 ` kernel test robot
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=202010261805.CY3gKXQX-lkp@intel.com \
--to=lkp@intel.com \
--cc=arnd@arndb.de \
--cc=ashutosh.dixit@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hch@infradead.org \
--cc=kbuild-all@lists.01.org \
--cc=kishon@ti.com \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=sherry.sun@nxp.com \
--cc=sudeep.dutt@intel.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.