iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [iommu:core 3/3] drivers/iommu/iova.c:36: error: redefinition of 'init_iova_domain'
@ 2017-03-22 18:28 kbuild test robot
       [not found] ` <201703230212.uKXA27d6%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2017-03-22 18:28 UTC (permalink / raw)
  To: Thierry Reding
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Joerg Roedel,
	kbuild-all-JC7UmRfGjtg

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git core
head:   21aff52ab2c831c2f07d48e2fa8d4bab26a66992
commit: 21aff52ab2c831c2f07d48e2fa8d4bab26a66992 [3/3] iommu: Add dummy implementations for !IOMMU_IOVA
config: x86_64-randconfig-a0-03222342 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
        git checkout 21aff52ab2c831c2f07d48e2fa8d4bab26a66992
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

>> drivers/iommu/iova.c:36: error: redefinition of 'init_iova_domain'
   include/linux/iova.h:170: note: previous definition of 'init_iova_domain' was here
>> drivers/iommu/iova.c:202: error: redefinition of 'alloc_iova_mem'
   include/linux/iova.h:120: note: previous definition of 'alloc_iova_mem' was here
>> drivers/iommu/iova.c:208: error: redefinition of 'free_iova_mem'
   include/linux/iova.h:125: note: previous definition of 'free_iova_mem' was here
>> drivers/iommu/iova.c:214: error: redefinition of 'iova_cache_get'
   include/linux/iova.h:111: note: previous definition of 'iova_cache_get' was here
>> drivers/iommu/iova.c:235: error: redefinition of 'iova_cache_put'
   include/linux/iova.h:116: note: previous definition of 'iova_cache_put' was here
>> drivers/iommu/iova.c:261: error: redefinition of 'alloc_iova'
   include/linux/iova.h:137: note: previous definition of 'alloc_iova' was here
>> drivers/iommu/iova.c:323: error: redefinition of 'find_iova'
   include/linux/iova.h:177: note: previous definition of 'find_iova' was here
>> drivers/iommu/iova.c:343: error: redefinition of '__free_iova'
   include/linux/iova.h:133: note: previous definition of '__free_iova' was here
>> drivers/iommu/iova.c:361: error: redefinition of 'free_iova'
   include/linux/iova.h:129: note: previous definition of 'free_iova' was here
>> drivers/iommu/iova.c:380: error: redefinition of 'alloc_iova_fast'
   include/linux/iova.h:151: note: previous definition of 'alloc_iova_fast' was here
>> drivers/iommu/iova.c:421: error: redefinition of 'free_iova_fast'
   include/linux/iova.h:145: note: previous definition of 'free_iova_fast' was here
>> drivers/iommu/iova.c:435: error: redefinition of 'put_iova_domain'
   include/linux/iova.h:183: note: previous definition of 'put_iova_domain' was here
>> drivers/iommu/iova.c:511: error: redefinition of 'reserve_iova'
   include/linux/iova.h:158: note: previous definition of 'reserve_iova' was here
>> drivers/iommu/iova.c:552: error: redefinition of 'copy_reserved_iova'
   include/linux/iova.h:165: note: previous definition of 'copy_reserved_iova' was here
>> drivers/iommu/iova.c:572: error: redefinition of 'split_and_remove_iova'
   include/linux/iova.h:187: note: previous definition of 'split_and_remove_iova' was here
>> drivers/iommu/iova.c:887: error: redefinition of 'free_cpu_cached_iovas'
   include/linux/iova.h:195: note: previous definition of 'free_cpu_cached_iovas' was here

vim +/init_iova_domain +36 drivers/iommu/iova.c

9257b4a20 drivers/iommu/iova.c Omer Peleg            2016-04-20   30  				     unsigned long size,
9257b4a20 drivers/iommu/iova.c Omer Peleg            2016-04-20   31  				     unsigned long limit_pfn);
9257b4a20 drivers/iommu/iova.c Omer Peleg            2016-04-20   32  static void init_iova_rcaches(struct iova_domain *iovad);
9257b4a20 drivers/iommu/iova.c Omer Peleg            2016-04-20   33  static void free_iova_rcaches(struct iova_domain *iovad);
85b454562 drivers/iommu/iova.c Robin Murphy          2015-01-12   34  
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   35  void
0fb5fe874 drivers/iommu/iova.c Robin Murphy          2015-01-12  @36  init_iova_domain(struct iova_domain *iovad, unsigned long granule,
0fb5fe874 drivers/iommu/iova.c Robin Murphy          2015-01-12   37  	unsigned long start_pfn, unsigned long pfn_32bit)
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   38  {
0fb5fe874 drivers/iommu/iova.c Robin Murphy          2015-01-12   39  	/*
0fb5fe874 drivers/iommu/iova.c Robin Murphy          2015-01-12   40  	 * IOVA granularity will normally be equal to the smallest
0fb5fe874 drivers/iommu/iova.c Robin Murphy          2015-01-12   41  	 * supported IOMMU page size; both *must* be capable of
0fb5fe874 drivers/iommu/iova.c Robin Murphy          2015-01-12   42  	 * representing individual CPU pages exactly.
0fb5fe874 drivers/iommu/iova.c Robin Murphy          2015-01-12   43  	 */
0fb5fe874 drivers/iommu/iova.c Robin Murphy          2015-01-12   44  	BUG_ON((granule > PAGE_SIZE) || !is_power_of_2(granule));
0fb5fe874 drivers/iommu/iova.c Robin Murphy          2015-01-12   45  
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   46  	spin_lock_init(&iovad->iova_rbtree_lock);
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   47  	iovad->rbroot = RB_ROOT;
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   48  	iovad->cached32_node = NULL;
0fb5fe874 drivers/iommu/iova.c Robin Murphy          2015-01-12   49  	iovad->granule = granule;
1b7225007 drivers/iommu/iova.c Robin Murphy          2015-01-12   50  	iovad->start_pfn = start_pfn;
f661197e0 drivers/pci/iova.c   David Miller          2008-02-06   51  	iovad->dma_32bit_pfn = pfn_32bit;
9257b4a20 drivers/iommu/iova.c Omer Peleg            2016-04-20   52  	init_iova_rcaches(iovad);
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   53  }
9b41760b0 drivers/iommu/iova.c Sakari Ailus          2015-07-13   54  EXPORT_SYMBOL_GPL(init_iova_domain);
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   55  
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   56  static struct rb_node *
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   57  __get_cached_rbnode(struct iova_domain *iovad, unsigned long *limit_pfn)
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   58  {
62280cf2e drivers/iommu/iova.c Robin Murphy          2016-11-11   59  	if ((*limit_pfn > iovad->dma_32bit_pfn) ||
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   60  		(iovad->cached32_node == NULL))
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   61  		return rb_last(&iovad->rbroot);
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   62  	else {
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   63  		struct rb_node *prev_node = rb_prev(iovad->cached32_node);
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   64  		struct iova *curr_iova =
eba484b51 drivers/iommu/iova.c Geliang Tang          2016-12-19   65  			rb_entry(iovad->cached32_node, struct iova, node);
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   66  		*limit_pfn = curr_iova->pfn_lo - 1;
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   67  		return prev_node;
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   68  	}
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   69  }
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   70  
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   71  static void
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   72  __cached_rbnode_insert_update(struct iova_domain *iovad,
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   73  	unsigned long limit_pfn, struct iova *new)
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   74  {
f661197e0 drivers/pci/iova.c   David Miller          2008-02-06   75  	if (limit_pfn != iovad->dma_32bit_pfn)
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   76  		return;
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   77  	iovad->cached32_node = &new->node;
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   78  }
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   79  
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   80  static void
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   81  __cached_rbnode_delete_update(struct iova_domain *iovad, struct iova *free)
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   82  {
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   83  	struct iova *cached_iova;
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   84  	struct rb_node *curr;
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   85  
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   86  	if (!iovad->cached32_node)
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   87  		return;
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   88  	curr = iovad->cached32_node;
eba484b51 drivers/iommu/iova.c Geliang Tang          2016-12-19   89  	cached_iova = rb_entry(curr, struct iova, node);
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21   90  
1c9fc3d11 drivers/pci/iova.c   Chris Wright          2011-05-28   91  	if (free->pfn_lo >= cached_iova->pfn_lo) {
1c9fc3d11 drivers/pci/iova.c   Chris Wright          2011-05-28   92  		struct rb_node *node = rb_next(&free->node);
eba484b51 drivers/iommu/iova.c Geliang Tang          2016-12-19   93  		struct iova *iova = rb_entry(node, struct iova, node);
1c9fc3d11 drivers/pci/iova.c   Chris Wright          2011-05-28   94  
1c9fc3d11 drivers/pci/iova.c   Chris Wright          2011-05-28   95  		/* only cache if it's below 32bit pfn */
1c9fc3d11 drivers/pci/iova.c   Chris Wright          2011-05-28   96  		if (node && iova->pfn_lo < iovad->dma_32bit_pfn)
1c9fc3d11 drivers/pci/iova.c   Chris Wright          2011-05-28   97  			iovad->cached32_node = node;
1c9fc3d11 drivers/pci/iova.c   Chris Wright          2011-05-28   98  		else
1c9fc3d11 drivers/pci/iova.c   Chris Wright          2011-05-28   99  			iovad->cached32_node = NULL;
1c9fc3d11 drivers/pci/iova.c   Chris Wright          2011-05-28  100  	}
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  101  }
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  102  
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  103  /* Insert the iova into domain rbtree by holding writer lock */
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  104  static void
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  105  iova_insert_rbtree(struct rb_root *root, struct iova *iova,
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  106  		   struct rb_node *start)
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  107  {
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  108  	struct rb_node **new, *parent = NULL;
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  109  
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  110  	new = (start) ? &start : &(root->rb_node);
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  111  	/* Figure out where to put new node */
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  112  	while (*new) {
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  113  		struct iova *this = rb_entry(*new, struct iova, node);
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  114  
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  115  		parent = *new;
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  116  
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  117  		if (iova->pfn_lo < this->pfn_lo)
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  118  			new = &((*new)->rb_left);
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  119  		else if (iova->pfn_lo > this->pfn_lo)
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  120  			new = &((*new)->rb_right);
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  121  		else {
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  122  			WARN_ON(1); /* this should not happen */
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  123  			return;
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  124  		}
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  125  	}
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  126  	/* Add new node and rebalance tree. */
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  127  	rb_link_node(&iova->node, parent, new);
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  128  	rb_insert_color(&iova->node, root);
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  129  }
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  130  
8f6429c7c drivers/iommu/iova.c Robin Murphy          2015-07-16  131  /*
8f6429c7c drivers/iommu/iova.c Robin Murphy          2015-07-16  132   * Computes the padding size required, to make the start address
8f6429c7c drivers/iommu/iova.c Robin Murphy          2015-07-16  133   * naturally aligned on the power-of-two order of its size
f76aec76e drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  134   */
8f6429c7c drivers/iommu/iova.c Robin Murphy          2015-07-16  135  static unsigned int
8f6429c7c drivers/iommu/iova.c Robin Murphy          2015-07-16  136  iova_get_pad_size(unsigned int size, unsigned int limit_pfn)
f76aec76e drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  137  {
8f6429c7c drivers/iommu/iova.c Robin Murphy          2015-07-16  138  	return (limit_pfn + 1 - size) & (__roundup_pow_of_two(size) - 1);
f76aec76e drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  139  }
f76aec76e drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  140  
ddf02886c drivers/pci/iova.c   mark gross            2008-03-04  141  static int __alloc_and_insert_iova_range(struct iova_domain *iovad,
ddf02886c drivers/pci/iova.c   mark gross            2008-03-04  142  		unsigned long size, unsigned long limit_pfn,
ddf02886c drivers/pci/iova.c   mark gross            2008-03-04  143  			struct iova *new, bool size_aligned)
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  144  {
ddf02886c drivers/pci/iova.c   mark gross            2008-03-04  145  	struct rb_node *prev, *curr = NULL;
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  146  	unsigned long flags;
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  147  	unsigned long saved_pfn;
f76aec76e drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  148  	unsigned int pad_size = 0;
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  149  
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  150  	/* Walk the tree backwards */
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  151  	spin_lock_irqsave(&iovad->iova_rbtree_lock, flags);
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  152  	saved_pfn = limit_pfn;
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  153  	curr = __get_cached_rbnode(iovad, &limit_pfn);
ddf02886c drivers/pci/iova.c   mark gross            2008-03-04  154  	prev = curr;
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  155  	while (curr) {
eba484b51 drivers/iommu/iova.c Geliang Tang          2016-12-19  156  		struct iova *curr_iova = rb_entry(curr, struct iova, node);
ddf02886c drivers/pci/iova.c   mark gross            2008-03-04  157  
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  158  		if (limit_pfn < curr_iova->pfn_lo)
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  159  			goto move_left;
f76aec76e drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  160  		else if (limit_pfn < curr_iova->pfn_hi)
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  161  			goto adjust_limit_pfn;
f76aec76e drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  162  		else {
f76aec76e drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  163  			if (size_aligned)
f76aec76e drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  164  				pad_size = iova_get_pad_size(size, limit_pfn);
f76aec76e drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  165  			if ((curr_iova->pfn_hi + size + pad_size) <= limit_pfn)
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  166  				break;	/* found a free slot */
f76aec76e drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  167  		}
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  168  adjust_limit_pfn:
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  169  		limit_pfn = curr_iova->pfn_lo - 1;
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  170  move_left:
ddf02886c drivers/pci/iova.c   mark gross            2008-03-04  171  		prev = curr;
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  172  		curr = rb_prev(curr);
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  173  	}
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  174  
f76aec76e drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  175  	if (!curr) {
f76aec76e drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  176  		if (size_aligned)
f76aec76e drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  177  			pad_size = iova_get_pad_size(size, limit_pfn);
1b7225007 drivers/iommu/iova.c Robin Murphy          2015-01-12  178  		if ((iovad->start_pfn + size + pad_size) > limit_pfn) {
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  179  			spin_unlock_irqrestore(&iovad->iova_rbtree_lock, flags);
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  180  			return -ENOMEM;
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  181  		}
f76aec76e drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  182  	}
f76aec76e drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  183  
f76aec76e drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  184  	/* pfn_lo will point to size aligned address if size_aligned is set */
f76aec76e drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  185  	new->pfn_lo = limit_pfn - (size + pad_size) + 1;
f76aec76e drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  186  	new->pfn_hi = new->pfn_lo + size - 1;
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  187  
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  188  	/* If we have 'prev', it's a valid place to start the insertion. */
d751751a9 drivers/iommu/iova.c Marek Szyprowski      2017-02-24  189  	iova_insert_rbtree(&iovad->rbroot, new, prev);
ddf02886c drivers/pci/iova.c   mark gross            2008-03-04  190  	__cached_rbnode_insert_update(iovad, saved_pfn, new);
ddf02886c drivers/pci/iova.c   mark gross            2008-03-04  191  
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  192  	spin_unlock_irqrestore(&iovad->iova_rbtree_lock, flags);
ddf02886c drivers/pci/iova.c   mark gross            2008-03-04  193  
ddf02886c drivers/pci/iova.c   mark gross            2008-03-04  194  
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  195  	return 0;
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  196  }
f8de50eb6 drivers/pci/iova.c   Keshavamurthy, Anil S 2007-10-21  197  
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  198  static struct kmem_cache *iova_cache;
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  199  static unsigned int iova_cache_users;
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  200  static DEFINE_MUTEX(iova_cache_mutex);
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  201  
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13 @202  struct iova *alloc_iova_mem(void)
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  203  {
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  204  	return kmem_cache_alloc(iova_cache, GFP_ATOMIC);
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  205  }
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  206  EXPORT_SYMBOL(alloc_iova_mem);
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  207  
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13 @208  void free_iova_mem(struct iova *iova)
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  209  {
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  210  	kmem_cache_free(iova_cache, iova);
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  211  }
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  212  EXPORT_SYMBOL(free_iova_mem);
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  213  
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13 @214  int iova_cache_get(void)
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  215  {
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  216  	mutex_lock(&iova_cache_mutex);
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  217  	if (!iova_cache_users) {
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  218  		iova_cache = kmem_cache_create(
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  219  			"iommu_iova", sizeof(struct iova), 0,
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  220  			SLAB_HWCACHE_ALIGN, NULL);
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  221  		if (!iova_cache) {
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  222  			mutex_unlock(&iova_cache_mutex);
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  223  			printk(KERN_ERR "Couldn't create iova cache\n");
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  224  			return -ENOMEM;
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  225  		}
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  226  	}
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  227  
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  228  	iova_cache_users++;
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  229  	mutex_unlock(&iova_cache_mutex);
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  230  
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  231  	return 0;
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  232  }
9b41760b0 drivers/iommu/iova.c Sakari Ailus          2015-07-13  233  EXPORT_SYMBOL_GPL(iova_cache_get);
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  234  
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13 @235  void iova_cache_put(void)
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  236  {
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  237  	mutex_lock(&iova_cache_mutex);
ae1ff3d62 drivers/iommu/iova.c Sakari Ailus          2015-07-13  238  	if (WARN_ON(!iova_cache_users)) {

:::::: The code at line 36 was first introduced by commit
:::::: 0fb5fe874c42942e16c450ae05da453e13a1c09e iommu: Make IOVA domain page size explicit

:::::: TO: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
:::::: CC: Joerg Roedel <jroedel-l3A5Bk7waGM@public.gmane.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 24829 bytes --]

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [iommu:core 3/3] drivers/iommu/iova.c:36: error: redefinition of 'init_iova_domain'
       [not found] ` <201703230212.uKXA27d6%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2017-03-22 18:36   ` Thierry Reding
       [not found]     ` <20170322183651.GA27374-EkSeR96xj6Pcmrwk2tT4+A@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Thierry Reding @ 2017-03-22 18:36 UTC (permalink / raw)
  To: kbuild test robot
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Joerg Roedel,
	kbuild-all-JC7UmRfGjtg


[-- Attachment #1.1: Type: text/plain, Size: 3531 bytes --]

On Thu, Mar 23, 2017 at 02:28:27AM +0800, kbuild test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git core
> head:   21aff52ab2c831c2f07d48e2fa8d4bab26a66992
> commit: 21aff52ab2c831c2f07d48e2fa8d4bab26a66992 [3/3] iommu: Add dummy implementations for !IOMMU_IOVA
> config: x86_64-randconfig-a0-03222342 (attached as .config)
> compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
> reproduce:
>         git checkout 21aff52ab2c831c2f07d48e2fa8d4bab26a66992
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 
> 
> All errors (new ones prefixed by >>):
> 
> >> drivers/iommu/iova.c:36: error: redefinition of 'init_iova_domain'
>    include/linux/iova.h:170: note: previous definition of 'init_iova_domain' was here
> >> drivers/iommu/iova.c:202: error: redefinition of 'alloc_iova_mem'
>    include/linux/iova.h:120: note: previous definition of 'alloc_iova_mem' was here
> >> drivers/iommu/iova.c:208: error: redefinition of 'free_iova_mem'
>    include/linux/iova.h:125: note: previous definition of 'free_iova_mem' was here
> >> drivers/iommu/iova.c:214: error: redefinition of 'iova_cache_get'
>    include/linux/iova.h:111: note: previous definition of 'iova_cache_get' was here
> >> drivers/iommu/iova.c:235: error: redefinition of 'iova_cache_put'
>    include/linux/iova.h:116: note: previous definition of 'iova_cache_put' was here
> >> drivers/iommu/iova.c:261: error: redefinition of 'alloc_iova'
>    include/linux/iova.h:137: note: previous definition of 'alloc_iova' was here
> >> drivers/iommu/iova.c:323: error: redefinition of 'find_iova'
>    include/linux/iova.h:177: note: previous definition of 'find_iova' was here
> >> drivers/iommu/iova.c:343: error: redefinition of '__free_iova'
>    include/linux/iova.h:133: note: previous definition of '__free_iova' was here
> >> drivers/iommu/iova.c:361: error: redefinition of 'free_iova'
>    include/linux/iova.h:129: note: previous definition of 'free_iova' was here
> >> drivers/iommu/iova.c:380: error: redefinition of 'alloc_iova_fast'
>    include/linux/iova.h:151: note: previous definition of 'alloc_iova_fast' was here
> >> drivers/iommu/iova.c:421: error: redefinition of 'free_iova_fast'
>    include/linux/iova.h:145: note: previous definition of 'free_iova_fast' was here
> >> drivers/iommu/iova.c:435: error: redefinition of 'put_iova_domain'
>    include/linux/iova.h:183: note: previous definition of 'put_iova_domain' was here
> >> drivers/iommu/iova.c:511: error: redefinition of 'reserve_iova'
>    include/linux/iova.h:158: note: previous definition of 'reserve_iova' was here
> >> drivers/iommu/iova.c:552: error: redefinition of 'copy_reserved_iova'
>    include/linux/iova.h:165: note: previous definition of 'copy_reserved_iova' was here
> >> drivers/iommu/iova.c:572: error: redefinition of 'split_and_remove_iova'
>    include/linux/iova.h:187: note: previous definition of 'split_and_remove_iova' was here
> >> drivers/iommu/iova.c:887: error: redefinition of 'free_cpu_cached_iovas'
>    include/linux/iova.h:195: note: previous definition of 'free_cpu_cached_iovas' was here

*sigh* I think I messed up the #ifdef line. The attached .config has
CONFIG_IOMMU_IOVA=m, which means that the #ifdef won't be true. I think
the proper fix would be to:

-#ifdef CONFIG_IOMMU_IOVA
+#ifdef IS_ENABLED(CONFIG_IOMMU_IOVA)

Joerg, can you fix that up yourself or do you want me to resend the
patch with the fix rolled in?

Thierry

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [iommu:core 3/3] drivers/iommu/iova.c:36: error: redefinition of 'init_iova_domain'
       [not found]     ` <20170322183651.GA27374-EkSeR96xj6Pcmrwk2tT4+A@public.gmane.org>
@ 2017-03-22 21:57       ` Joerg Roedel
  0 siblings, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2017-03-22 21:57 UTC (permalink / raw)
  To: Thierry Reding
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	kbuild test robot, kbuild-all-JC7UmRfGjtg

On Wed, Mar 22, 2017 at 07:36:52PM +0100, Thierry Reding wrote:
> *sigh* I think I messed up the #ifdef line. The attached .config has
> CONFIG_IOMMU_IOVA=m, which means that the #ifdef won't be true. I think
> the proper fix would be to:
> 
> -#ifdef CONFIG_IOMMU_IOVA
> +#ifdef IS_ENABLED(CONFIG_IOMMU_IOVA)
> 
> Joerg, can you fix that up yourself or do you want me to resend the
> patch with the fix rolled in?

I'll fix that up tomorrow.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-22 21:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-22 18:28 [iommu:core 3/3] drivers/iommu/iova.c:36: error: redefinition of 'init_iova_domain' kbuild test robot
     [not found] ` <201703230212.uKXA27d6%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-03-22 18:36   ` Thierry Reding
     [not found]     ` <20170322183651.GA27374-EkSeR96xj6Pcmrwk2tT4+A@public.gmane.org>
2017-03-22 21:57       ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).