Re: [PATCH v2 3/9] dma-iommu: bounce buffers for untrusted devices
From: kernel test robot
Date: Fri Aug 06 2021 - 11:53:29 EST
Hi David,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on iommu/next]
[also build test WARNING on drm-intel/for-linux-next hch-configfs/for-next linus/master v5.14-rc4]
[cannot apply to next-20210805]
[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/David-Stevens/Add-dynamic-iommu-backed-bounce-buffers/20210806-183631
base: https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next
config: ia64-randconfig-r025-20210804 (attached as .config)
compiler: ia64-linux-gcc (GCC) 10.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/0day-ci/linux/commit/c5f1f9fa88a7062c1ded50fa165f6b01ed73f161
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review David-Stevens/Add-dynamic-iommu-backed-bounce-buffers/20210806-183631
git checkout c5f1f9fa88a7062c1ded50fa165f6b01ed73f161
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All warnings (new ones prefixed by >>):
>> drivers/iommu/io-buffer-manager.c:57:24: warning: no previous prototype for 'find_fallback_node' [-Wmissing-prototypes]
57 | struct io_buffer_node *find_fallback_node(struct rb_root *root, dma_addr_t iova)
| ^~~~~~~~~~~~~~~~~~
>> drivers/iommu/io-buffer-manager.c:75:6: warning: no previous prototype for 'insert_fallback_node' [-Wmissing-prototypes]
75 | bool insert_fallback_node(struct rb_root *root, struct io_buffer_node *node)
| ^~~~~~~~~~~~~~~~~~~~
vim +/find_fallback_node +57 drivers/iommu/io-buffer-manager.c
56
> 57 struct io_buffer_node *find_fallback_node(struct rb_root *root, dma_addr_t iova)
58 {
59 struct rb_node *node = root->rb_node;
60
61 while (node) {
62 struct io_buffer_node *cur =
63 container_of(node, struct io_buffer_node, node);
64
65 if (iova < cur->info.iova)
66 node = node->rb_left;
67 else if (iova >= cur->info.iova + cur->info.size)
68 node = node->rb_right;
69 else
70 return cur;
71 }
72 return NULL;
73 }
74
> 75 bool insert_fallback_node(struct rb_root *root, struct io_buffer_node *node)
76 {
77 struct rb_node **new = &(root->rb_node), *parent = NULL;
78 dma_addr_t node_end = node->info.iova + node->info.size;
79
80 while (*new) {
81 struct io_buffer_node *cur =
82 container_of(*new, struct io_buffer_node, node);
83 dma_addr_t cur_end = cur->info.iova + cur->info.size;
84
85 parent = *new;
86 if (node_end <= cur->info.iova)
87 new = &((*new)->rb_left);
88 else if (node->info.iova >= cur_end)
89 new = &((*new)->rb_right);
90 else {
91 pr_crit("IOVA collision new=[%llx,%llx) old=[%llx,%llx)\n",
92 node->info.iova, node_end, cur->info.iova,
93 cur_end);
94 return false;
95 }
96 }
97
98 rb_link_node(&node->node, parent, new);
99 rb_insert_color(&node->node, root);
100 return true;
101 }
102
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip