All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v4 09/14] swiotlb: Refactor swiotlb_tbl_{map, unmap}_single
Date: Tue, 09 Feb 2021 17:31:02 +0800	[thread overview]
Message-ID: <202102091733.1WpMy4F4-lkp@intel.com> (raw)
In-Reply-To: <20210209062131.2300005-10-tientzu@chromium.org>

[-- Attachment #1: Type: text/plain, Size: 2869 bytes --]

Hi Claire,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.11-rc6 next-20210125]
[cannot apply to swiotlb/linux-next robh/for-next xen-tip/linux-next]
[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/Claire-Chang/Restricted-DMA/20210209-142608
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 61556703b610a104de324e4f061dc6cf7b218b46
config: x86_64-randconfig-m001-20210209 (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>

smatch warnings:
kernel/dma/swiotlb.c:681 swiotlb_tbl_map_single() warn: unsigned 'index' is never less than zero.

vim +/index +681 kernel/dma/swiotlb.c

   659	
   660	phys_addr_t swiotlb_tbl_map_single(struct device *hwdev, phys_addr_t orig_addr,
   661					   size_t mapping_size, size_t alloc_size,
   662					   enum dma_data_direction dir,
   663					   unsigned long attrs)
   664	{
   665		struct swiotlb *swiotlb = get_swiotlb(hwdev);
   666		dma_addr_t tbl_dma_addr = phys_to_dma_unencrypted(hwdev, swiotlb->start);
   667		phys_addr_t tlb_addr;
   668		unsigned int nslots, index;
   669		int i;
   670	
   671		if (mem_encrypt_active())
   672			pr_warn_once("Memory encryption is active and system is using DMA bounce buffers\n");
   673	
   674		if (mapping_size > alloc_size) {
   675			dev_warn_once(hwdev, "Invalid sizes (mapping: %zd bytes, alloc: %zd bytes)",
   676				      mapping_size, alloc_size);
   677			return (phys_addr_t)DMA_MAPPING_ERROR;
   678		}
   679	
   680		index = swiotlb_tbl_find_free_region(hwdev, tbl_dma_addr, alloc_size, attrs);
 > 681		if (index < 0)
   682			return (phys_addr_t)DMA_MAPPING_ERROR;
   683	
   684		tlb_addr = swiotlb->start + (index << IO_TLB_SHIFT);
   685	
   686		/*
   687		 * Save away the mapping from the original address to the DMA address.
   688		 * This is needed when we sync the memory.  Then we sync the buffer if
   689		 * needed.
   690		 */
   691		nslots = ALIGN(alloc_size, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT;
   692		for (i = 0; i < nslots; i++)
   693			swiotlb->orig_addr[index + i] = orig_addr + (i << IO_TLB_SHIFT);
   694		if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC) &&
   695		    (dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL))
   696			swiotlb_bounce(orig_addr, tlb_addr, mapping_size, DMA_TO_DEVICE);
   697	
   698		return tlb_addr;
   699	}
   700	

---
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: 29632 bytes --]

  reply	other threads:[~2021-02-09  9:31 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09  6:21 [PATCH v4 00/14] Restricted DMA Claire Chang
2021-02-09  6:21 ` Claire Chang
2021-02-09  6:21 ` Claire Chang
2021-02-09  6:21 ` [PATCH v4 01/14] swiotlb: Remove external access to io_tlb_start Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  8:40   ` Christoph Hellwig
2021-02-09  8:40     ` Christoph Hellwig
2021-02-09 11:17   ` kernel test robot
2021-02-09  6:21 ` [PATCH v4 02/14] swiotlb: Move is_swiotlb_buffer() to swiotlb.c Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  6:21 ` [PATCH v4 03/14] swiotlb: Add struct swiotlb Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  6:21 ` [PATCH v4 04/14] swiotlb: Refactor swiotlb_late_init_with_tbl Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  6:21 ` [PATCH v4 05/14] swiotlb: Add DMA_RESTRICTED_POOL Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  6:21 ` [PATCH v4 06/14] swiotlb: Add restricted DMA pool Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  9:39   ` kernel test robot
2021-02-09  9:56   ` kernel test robot
2021-02-09 11:39   ` kernel test robot
2021-02-09  6:21 ` [PATCH v4 07/14] swiotlb: Update swiotlb API to gain a struct device argument Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  6:21 ` [PATCH v4 08/14] swiotlb: Use restricted DMA pool if available Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  6:21 ` [PATCH v4 09/14] swiotlb: Refactor swiotlb_tbl_{map,unmap}_single Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  9:31   ` kernel test robot [this message]
2021-02-09  6:21 ` [PATCH v4 10/14] dma-direct: Add a new wrapper __dma_direct_free_pages() Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  6:21 ` [PATCH v4 11/14] swiotlb: Add is_dev_swiotlb_force() Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  6:21 ` [PATCH v4 12/14] swiotlb: Add restricted DMA alloc/free support Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-26  4:17   ` Claire Chang
2021-02-26  4:17     ` Claire Chang
2021-02-26  4:17     ` Claire Chang
2021-02-26  5:17     ` Christoph Hellwig
2021-02-26  5:17       ` Christoph Hellwig
2021-02-26  5:17       ` Christoph Hellwig
2021-02-26  9:35       ` Claire Chang
2021-02-26  9:35         ` Claire Chang
2021-02-26  9:35         ` Claire Chang
2021-02-09  6:21 ` [PATCH v4 13/14] dt-bindings: of: Add restricted DMA pool Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-03-10 16:07   ` Will Deacon
2021-03-10 16:07     ` Will Deacon
2021-03-10 16:07     ` Will Deacon
2021-03-10 21:40     ` Rob Herring
2021-03-10 21:40       ` Rob Herring
2021-03-10 21:40       ` Rob Herring
2021-03-11  5:04       ` Florian Fainelli
2021-03-11  5:04         ` Florian Fainelli
2021-03-11  5:04         ` Florian Fainelli
2021-02-09  6:21 ` [PATCH v4 14/14] of: Add plumbing for " Claire Chang
2021-02-09  6:21   ` Claire Chang
2021-04-22  8:20 ` [PATCH v4 00/14] Restricted DMA Claire Chang
2021-04-22  8:20   ` Claire Chang
2021-04-22  8:20   ` Claire Chang
2025-03-21 15:38 ` Using Restricted DMA for virtio-pci David Woodhouse
2025-03-21 18:32   ` Michael S. Tsirkin
2025-03-21 18:42     ` David Woodhouse
2025-03-28 17:40       ` David Woodhouse
2025-03-30 13:42         ` Michael S. Tsirkin
2025-03-30 15:07           ` David Woodhouse
2025-03-30 16:59             ` Michael S. Tsirkin
2025-03-30 20:07               ` David Woodhouse
2025-03-30 17:06       ` Michael S. Tsirkin
2025-03-30 21:27         ` David Woodhouse
2025-03-30 21:48           ` Michael S. Tsirkin
2025-03-31  9:42             ` David Woodhouse

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=202102091733.1WpMy4F4-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@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.