mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/virtio/virtio_ring.c:3125 virtqueue_dma_map_single_attrs() warn: unsigned '_x' is never less than zero.
@ 2025-02-16 14:39 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-02-16 14:39 UTC (permalink / raw)
  To: Xuan Zhuo; +Cc: oe-kbuild-all, linux-kernel, Michael S. Tsirkin

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ad1b832bf1cf2df9304f8eb72943111625c7e5a7
commit: 840b2d39a2dc1b96deb3f5c7fef76c9b24f08f51 virtio_ring: fix KMSAN error for premapped mode
date:   8 months ago
config: riscv-randconfig-r073-20250213 (https://download.01.org/0day-ci/archive/20250216/202502162211.cxOr2wqP-lkp@intel.com/config)
compiler: riscv32-linux-gcc (GCC) 14.2.0

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/202502162211.cxOr2wqP-lkp@intel.com/

New smatch warnings:
drivers/virtio/virtio_ring.c:3125 virtqueue_dma_map_single_attrs() warn: unsigned '_x' is never less than zero.

Old smatch warnings:
include/asm-generic/io.h:1005 virt_to_phys() warn: unsigned '_x' is never less than zero.
include/linux/dma-mapping.h:388 dma_map_single_attrs() warn: unsigned '_x' is never less than zero.
drivers/virtio/virtio_ring.c:1516 virtqueue_add_packed() error: uninitialized symbol 'prev'.
drivers/virtio/virtio_ring.c:1524 virtqueue_add_packed() error: uninitialized symbol 'head_flags'.
drivers/virtio/virtio_ring.c:645 virtqueue_add_split() error: uninitialized symbol 'prev'.

vim +/_x +3125 drivers/virtio/virtio_ring.c

  3103	
  3104	/**
  3105	 * virtqueue_dma_map_single_attrs - map DMA for _vq
  3106	 * @_vq: the struct virtqueue we're talking about.
  3107	 * @ptr: the pointer of the buffer to do dma
  3108	 * @size: the size of the buffer to do dma
  3109	 * @dir: DMA direction
  3110	 * @attrs: DMA Attrs
  3111	 *
  3112	 * The caller calls this to do dma mapping in advance. The DMA address can be
  3113	 * passed to this _vq when it is in pre-mapped mode.
  3114	 *
  3115	 * return DMA address. Caller should check that by virtqueue_dma_mapping_error().
  3116	 */
  3117	dma_addr_t virtqueue_dma_map_single_attrs(struct virtqueue *_vq, void *ptr,
  3118						  size_t size,
  3119						  enum dma_data_direction dir,
  3120						  unsigned long attrs)
  3121	{
  3122		struct vring_virtqueue *vq = to_vvq(_vq);
  3123	
  3124		if (!vq->use_dma_api) {
> 3125			kmsan_handle_dma(virt_to_page(ptr), offset_in_page(ptr), size, dir);
  3126			return (dma_addr_t)virt_to_phys(ptr);
  3127		}
  3128	
  3129		return dma_map_single_attrs(vring_dma_dev(vq), ptr, size, dir, attrs);
  3130	}
  3131	EXPORT_SYMBOL_GPL(virtqueue_dma_map_single_attrs);
  3132	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-02-16 14:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-16 14:39 drivers/virtio/virtio_ring.c:3125 virtqueue_dma_map_single_attrs() warn: unsigned '_x' is never less than zero kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®