tree:
https://github.com/0day-ci/linux/commits/UPDATE-20200611-034348/Daniel-Ve...
head: 8ecab5fe94c5d85789550eda4e5b9ca6d61315b0
commit: 08117a632fade06f3c687d817ba7fc8b9998d524 [4/18] dma-fence: prime lockdep
annotations
config: um-allmodconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce (this is a W=1 build):
git checkout 08117a632fade06f3c687d817ba7fc8b9998d524
# save the attached .config to linux build tree
make W=1 ARCH=um
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
cc1: warning: arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
In file included from include/linux/spinlock_types.h:18,
from include/linux/mutex.h:16,
from include/linux/ww_mutex.h:20,
from include/linux/dma-resv.h:42,
from drivers/dma-buf/dma-resv.c:35:
drivers/dma-buf/dma-resv.c: In function 'dma_resv_lockdep':
> drivers/dma-buf/dma-resv.c:119:20: error:
'__mmu_notifier_invalidate_range_start_map' undeclared (first use in this
function); did you mean 'mmu_notifier_invalidate_range_start'?
119 |
lock_map_acquire(&__mmu_notifier_invalidate_range_start_map);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/lockdep.h:636:61: note: in definition of macro
'lock_acquire_exclusive'
636 | #define lock_acquire_exclusive(l, s, t, n, i) lock_acquire(l, s, t, 0, 1, n, i)
| ^
drivers/dma-buf/dma-resv.c:119:2: note: in expansion of macro 'lock_map_acquire'
119 | lock_map_acquire(&__mmu_notifier_invalidate_range_start_map);
| ^~~~~~~~~~~~~~~~
drivers/dma-buf/dma-resv.c:119:20: note: each undeclared identifier is reported only once
for each function it appears in
119 | lock_map_acquire(&__mmu_notifier_invalidate_range_start_map);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/lockdep.h:636:61: note: in definition of macro
'lock_acquire_exclusive'
636 | #define lock_acquire_exclusive(l, s, t, n, i) lock_acquire(l, s, t, 0, 1, n, i)
| ^
drivers/dma-buf/dma-resv.c:119:2: note: in expansion of macro 'lock_map_acquire'
119 | lock_map_acquire(&__mmu_notifier_invalidate_range_start_map);
| ^~~~~~~~~~~~~~~~
vim +119 drivers/dma-buf/dma-resv.c
35 #include <linux/dma-resv.h>
36 #include
<linux/export.h>
37 #include <linux/sched/mm.h>
38 #include <linux/mmu_notifier.h>
39
40 /**
41 * DOC: Reservation Object Overview
42 *
43 * The reservation object provides a mechanism to manage shared and
44 * exclusive fences associated with a buffer. A reservation object
45 * can have attached one exclusive fence (normally associated with
46 * write operations) or N shared fences (read operations). The RCU
47 * mechanism is used to protect read access to fences from locked
48 * write-side updates.
49 */
50
51 DEFINE_WD_CLASS(reservation_ww_class);
52 EXPORT_SYMBOL(reservation_ww_class);
53
54 struct lock_class_key reservation_seqcount_class;
55 EXPORT_SYMBOL(reservation_seqcount_class);
56
57 const char reservation_seqcount_string[] = "reservation_seqcount";
58 EXPORT_SYMBOL(reservation_seqcount_string);
59
60 /**
61 * dma_resv_list_alloc - allocate fence list
62 * @shared_max: number of fences we need space for
63 *
64 * Allocate a new dma_resv_list and make sure to correctly initialize
65 * shared_max.
66 */
67 static struct dma_resv_list *dma_resv_list_alloc(unsigned int shared_max)
68 {
69 struct dma_resv_list *list;
70
71 list = kmalloc(offsetof(typeof(*list), shared[shared_max]), GFP_KERNEL);
72 if (!list)
73 return NULL;
74
75 list->shared_max = (ksize(list) - offsetof(typeof(*list), shared)) /
76 sizeof(*list->shared);
77
78 return list;
79 }
80
81 /**
82 * dma_resv_list_free - free fence list
83 * @list: list to free
84 *
85 * Free a dma_resv_list and make sure to drop all references.
86 */
87 static void dma_resv_list_free(struct dma_resv_list *list)
88 {
89 unsigned int i;
90
91 if (!list)
92 return;
93
94 for (i = 0; i < list->shared_count; ++i)
95 dma_fence_put(rcu_dereference_protected(list->shared[i], true));
96
97 kfree_rcu(list, rcu);
98 }
99
100 #if IS_ENABLED(CONFIG_LOCKDEP)
101 static int __init dma_resv_lockdep(void)
102 {
103 struct mm_struct *mm = mm_alloc();
104 struct ww_acquire_ctx ctx;
105 struct dma_resv obj;
106 int ret;
107
108 if (!mm)
109 return -ENOMEM;
110
111 dma_resv_init(&obj);
112
113 down_read(&mm->mmap_sem);
114 ww_acquire_init(&ctx, &reservation_ww_class);
115 ret = dma_resv_lock(&obj, &ctx);
116 if (ret == -EDEADLK)
117 dma_resv_lock_slow(&obj, &ctx);
118 fs_reclaim_acquire(GFP_KERNEL);
119 lock_map_acquire(&__mmu_notifier_invalidate_range_start_map);
120 __dma_fence_might_wait();
121 lock_map_release(&__mmu_notifier_invalidate_range_start_map);
122 fs_reclaim_release(GFP_KERNEL);
123 ww_mutex_unlock(&obj.lock);
124 ww_acquire_fini(&ctx);
125 up_read(&mm->mmap_sem);
126
127 mmput(mm);
128
129 return 0;
130 }
131 subsys_initcall(dma_resv_lockdep);
132 #endif
133
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org