Re: [Intel-gfx] [PATCH 4/4] drm/i915/gt: Distinguish the virtual breadcrumbs from the irq breadcrumbs
by kernel test robot
Hi Chris,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on drm-tip/drm-tip next-20200717]
[cannot apply to linus/master v5.8-rc5]
[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/Chris-Wilson/drm-i915-Remove-req...
base: git://anongit.freedesktop.org/drm-intel for-linux-next
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/i915/gt/intel_breadcrumbs.c:71:6: warning: no previous prototype for 'intel_breadcrumbs_park' [-Wmissing-prototypes]
71 | void intel_breadcrumbs_park(struct intel_breadcrumbs *b)
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/i915/gt/intel_breadcrumbs.c:248:1: warning: no previous prototype for 'intel_breadcrumbs_create' [-Wmissing-prototypes]
248 | intel_breadcrumbs_create(struct intel_engine_cs *irq_engine)
| ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/i915/gt/intel_breadcrumbs.c:269:6: warning: no previous prototype for 'intel_breadcrumbs_reset' [-Wmissing-prototypes]
269 | void intel_breadcrumbs_reset(struct intel_breadcrumbs *b)
| ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/i915/gt/intel_breadcrumbs.c:286:6: warning: no previous prototype for 'intel_breadcrumbs_free' [-Wmissing-prototypes]
286 | void intel_breadcrumbs_free(struct intel_breadcrumbs *b)
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/i915/gt/intel_breadcrumbs.c:344:6: warning: no previous prototype for 'i915_request_enable_breadcrumb' [-Wmissing-prototypes]
344 | bool i915_request_enable_breadcrumb(struct i915_request *rq)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/i915/gt/intel_breadcrumbs.c:400:6: warning: no previous prototype for 'i915_request_cancel_breadcrumb' [-Wmissing-prototypes]
400 | void i915_request_cancel_breadcrumb(struct i915_request *rq)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/i915/gt/intel_breadcrumbs.c:423:6: warning: no previous prototype for 'intel_engine_print_breadcrumbs' [-Wmissing-prototypes]
423 | void intel_engine_print_breadcrumbs(struct intel_engine_cs *engine,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/intel_breadcrumbs_park +71 drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
70
> 71 void intel_breadcrumbs_park(struct intel_breadcrumbs *b)
72 {
73 unsigned long flags;
74
75 if (!READ_ONCE(b->irq_armed))
76 return;
77
78 spin_lock_irqsave(&b->irq_lock, flags);
79 if (b->irq_armed)
80 __intel_breadcrumbs_disarm_irq(b);
81 spin_unlock_irqrestore(&b->irq_lock, flags);
82 }
83
84 static inline bool __request_completed(const struct i915_request *rq)
85 {
86 return i915_seqno_passed(__hwsp_seqno(rq), rq->fence.seqno);
87 }
88
89 __maybe_unused static bool
90 check_signal_order(struct intel_context *ce, struct i915_request *rq)
91 {
92 if (!list_is_last(&rq->signal_link, &ce->signals) &&
93 i915_seqno_passed(rq->fence.seqno,
94 list_next_entry(rq, signal_link)->fence.seqno))
95 return false;
96
97 if (!list_is_first(&rq->signal_link, &ce->signals) &&
98 i915_seqno_passed(list_prev_entry(rq, signal_link)->fence.seqno,
99 rq->fence.seqno))
100 return false;
101
102 return true;
103 }
104
105 static bool
106 __dma_fence_signal(struct dma_fence *fence)
107 {
108 return !test_and_set_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags);
109 }
110
111 static void
112 __dma_fence_signal__timestamp(struct dma_fence *fence, ktime_t timestamp)
113 {
114 fence->timestamp = timestamp;
115 set_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags);
116 trace_dma_fence_signaled(fence);
117 }
118
119 static void
120 __dma_fence_signal__notify(struct dma_fence *fence,
121 const struct list_head *list)
122 {
123 struct dma_fence_cb *cur, *tmp;
124
125 lockdep_assert_held(fence->lock);
126
127 list_for_each_entry_safe(cur, tmp, list, node) {
128 INIT_LIST_HEAD(&cur->node);
129 cur->func(fence, cur);
130 }
131 }
132
133 static void add_retire(struct intel_breadcrumbs *b, struct intel_timeline *tl)
134 {
135 if (b->irq_engine)
136 intel_engine_add_retire(b->irq_engine, tl);
137 }
138
139 static void __signal_request(struct i915_request *rq, struct list_head *signals)
140 {
141 clear_bit(I915_FENCE_FLAG_SIGNAL, &rq->fence.flags);
142
143 if (!__dma_fence_signal(&rq->fence))
144 return;
145
146 i915_request_get(rq);
147 list_add_tail(&rq->signal_link, signals);
148 }
149
150 static void signal_irq_work(struct irq_work *work)
151 {
152 struct intel_breadcrumbs *b = container_of(work, typeof(*b), irq_work);
153 const ktime_t timestamp = ktime_get();
154 struct intel_context *ce, *cn;
155 struct list_head *pos, *next;
156 LIST_HEAD(signal);
157
158 spin_lock(&b->irq_lock);
159
160 if (b->irq_armed && list_empty(&b->signalers))
161 __intel_breadcrumbs_disarm_irq(b);
162
163 list_splice_init(&b->signaled_requests, &signal);
164
165 list_for_each_entry_safe(ce, cn, &b->signalers, signal_link) {
166 GEM_BUG_ON(list_empty(&ce->signals));
167
168 list_for_each_safe(pos, next, &ce->signals) {
169 struct i915_request *rq =
170 list_entry(pos, typeof(*rq), signal_link);
171
172 GEM_BUG_ON(!check_signal_order(ce, rq));
173 if (!__request_completed(rq))
174 break;
175
176 /*
177 * Queue for execution after dropping the signaling
178 * spinlock as the callback chain may end up adding
179 * more signalers to the same context or engine.
180 */
181 __signal_request(rq, &signal);
182 }
183
184 /*
185 * We process the list deletion in bulk, only using a list_add
186 * (not list_move) above but keeping the status of
187 * rq->signal_link known with the I915_FENCE_FLAG_SIGNAL bit.
188 */
189 if (!list_is_first(pos, &ce->signals)) {
190 /* Advance the list to the first incomplete request */
191 __list_del_many(&ce->signals, pos);
192 if (&ce->signals == pos) { /* now empty */
193 list_del_init(&ce->signal_link);
194 add_retire(b, ce->timeline);
195 }
196 }
197 }
198
199 spin_unlock(&b->irq_lock);
200
201 list_for_each_safe(pos, next, &signal) {
202 struct i915_request *rq =
203 list_entry(pos, typeof(*rq), signal_link);
204 struct list_head cb_list;
205
206 spin_lock(&rq->lock);
207 list_replace(&rq->fence.cb_list, &cb_list);
208 __dma_fence_signal__timestamp(&rq->fence, timestamp);
209 __dma_fence_signal__notify(&rq->fence, &cb_list);
210 spin_unlock(&rq->lock);
211
212 i915_request_put(rq);
213 }
214 }
215
216 static void __intel_breadcrumbs_arm_irq(struct intel_breadcrumbs *b)
217 {
218 lockdep_assert_held(&b->irq_lock);
219
220 if (b->irq_armed)
221 return;
222
223 GEM_BUG_ON(!b->irq_engine);
224 if (!intel_gt_pm_get_if_awake(b->irq_engine->gt))
225 return;
226
227 /*
228 * The breadcrumb irq will be disarmed on the interrupt after the
229 * waiters are signaled. This gives us a single interrupt window in
230 * which we can add a new waiter and avoid the cost of re-enabling
231 * the irq.
232 */
233 WRITE_ONCE(b->irq_armed, true);
234
235 /*
236 * Since we are waiting on a request, the GPU should be busy
237 * and should have its own rpm reference. This is tracked
238 * by i915->gt.awake, we can forgo holding our own wakref
239 * for the interrupt as before i915->gt.awake is released (when
240 * the driver is idle) we disarm the breadcrumbs.
241 */
242
243 if (!b->irq_enabled++)
244 irq_enable(b->irq_engine);
245 }
246
247 struct intel_breadcrumbs *
> 248 intel_breadcrumbs_create(struct intel_engine_cs *irq_engine)
249 {
250 struct intel_breadcrumbs *b;
251
252 b = kzalloc(sizeof(*b), GFP_KERNEL);
253 if (!b)
254 return NULL;
255
256 spin_lock_init(&b->irq_lock);
257 INIT_LIST_HEAD(&b->signalers);
258 INIT_LIST_HEAD(&b->signaled_requests);
259
260 init_irq_work(&b->irq_work, signal_irq_work);
261
262 b->irq_engine = irq_engine;
263 if (!irq_engine)
264 b->irq_armed = true; /* fake HW, used for irq_work */
265
266 return b;
267 }
268
> 269 void intel_breadcrumbs_reset(struct intel_breadcrumbs *b)
270 {
271 unsigned long flags;
272
273 if (!b->irq_engine)
274 return;
275
276 spin_lock_irqsave(&b->irq_lock, flags);
277
278 if (b->irq_enabled)
279 irq_enable(b->irq_engine);
280 else
281 irq_disable(b->irq_engine);
282
283 spin_unlock_irqrestore(&b->irq_lock, flags);
284 }
285
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
Re: [PATCH] genirq/affinity: Handle affinity setting on inactive interrupts correctly
by kernel test robot
Hi Thomas,
I love your patch! Yet something to improve:
[auto build test ERROR on linux/master]
[also build test ERROR on tip/x86/core tip/irq/core linus/master v5.8-rc5 next-20200717]
[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/Thomas-Gleixner/genirq-affinity-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 9ebcfadb0610322ac537dd7aa5d9cbc2b2894c68
config: parisc-defconfig (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
>> kernel/irq/manage.c:217:15: error: unknown type name 'boot'
217 | static inline boot irq_init_effective_affinity(struct irq_data *data,
| ^~~~
kernel/irq/manage.c: In function 'irq_init_effective_affinity':
>> kernel/irq/manage.c:218:26: warning: no return statement in function returning non-void [-Wreturn-type]
218 | const struct cpumask *mask) { }
| ^~~~~~~
vim +/boot +217 kernel/irq/manage.c
209
210 static inline void irq_init_effective_affinity(struct irq_data *data,
211 const struct cpumask *mask)
212 {
213 cpumask_copy(irq_data_get_effective_affinity_mask(data), mask);
214 }
215 #else
216 static inline void irq_validate_effective_affinity(struct irq_data *data) { }
> 217 static inline boot irq_init_effective_affinity(struct irq_data *data,
> 218 const struct cpumask *mask) { }
219 #endif
220
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
[hch-misc:sockopt-cleanups 21/22] net/ipv6/ipv6_sockglue.c:1101:13: sparse: sparse: incorrect type in initializer (different address spaces)
by kernel test robot
tree: git://git.infradead.org/users/hch/misc.git sockopt-cleanups
head: c7b33f366ac60f1213a4ff71675dc62c56f171d3
commit: 24541f10128971b7634776778bce4c6b5c8d7e10 [21/22] net/ipv6: remove compat_ipv6_{get,set}sockopt
config: openrisc-randconfig-s031-20200717 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.2-49-g707c5017-dirty
git checkout 24541f10128971b7634776778bce4c6b5c8d7e10
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=openrisc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
net/ipv6/ipv6_sockglue.c:331:29: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user * @@
net/ipv6/ipv6_sockglue.c:331:29: sparse: expected int const *__gu_addr
net/ipv6/ipv6_sockglue.c:331:29: sparse: got int [noderef] __user *
net/ipv6/ipv6_sockglue.c:1059:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user *optlen @@
net/ipv6/ipv6_sockglue.c:1059:21: sparse: expected int *__pu_addr
net/ipv6/ipv6_sockglue.c:1059:21: sparse: got int [noderef] __user *optlen
net/ipv6/ipv6_sockglue.c:1077:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user *optlen @@
net/ipv6/ipv6_sockglue.c:1077:13: sparse: expected int const *__gu_addr
net/ipv6/ipv6_sockglue.c:1077:13: sparse: got int [noderef] __user *optlen
net/ipv6/ipv6_sockglue.c:1100:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user *optlen @@
net/ipv6/ipv6_sockglue.c:1100:13: sparse: expected int *__pu_addr
net/ipv6/ipv6_sockglue.c:1100:13: sparse: got int [noderef] __user *optlen
>> net/ipv6/ipv6_sockglue.c:1101:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] __user * @@
>> net/ipv6/ipv6_sockglue.c:1101:13: sparse: expected unsigned int *__pu_addr
net/ipv6/ipv6_sockglue.c:1101:13: sparse: got unsigned int [noderef] __user *
net/ipv6/ipv6_sockglue.c:1102:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] __user * @@
net/ipv6/ipv6_sockglue.c:1102:13: sparse: expected unsigned int *__pu_addr
net/ipv6/ipv6_sockglue.c:1102:13: sparse: got unsigned int [noderef] __user *
net/ipv6/ipv6_sockglue.c:1117:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user *optlen @@
net/ipv6/ipv6_sockglue.c:1117:13: sparse: expected int const *__gu_addr
net/ipv6/ipv6_sockglue.c:1117:13: sparse: got int [noderef] __user *optlen
net/ipv6/ipv6_sockglue.c:1141:33: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *msg_control @@ got char [noderef] __user *optval @@
net/ipv6/ipv6_sockglue.c:1141:33: sparse: expected void *msg_control
net/ipv6/ipv6_sockglue.c:1141:33: sparse: got char [noderef] __user *optval
net/ipv6/ipv6_sockglue.c:1187:24: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user *optlen @@
net/ipv6/ipv6_sockglue.c:1187:24: sparse: expected int *__pu_addr
net/ipv6/ipv6_sockglue.c:1187:24: sparse: got int [noderef] __user *optlen
net/ipv6/ipv6_sockglue.c:1247:24: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user *optlen @@
net/ipv6/ipv6_sockglue.c:1247:24: sparse: expected int *__pu_addr
net/ipv6/ipv6_sockglue.c:1247:24: sparse: got int [noderef] __user *optlen
net/ipv6/ipv6_sockglue.c:1301:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user *optlen @@
net/ipv6/ipv6_sockglue.c:1301:21: sparse: expected int *__pu_addr
net/ipv6/ipv6_sockglue.c:1301:21: sparse: got int [noderef] __user *optlen
net/ipv6/ipv6_sockglue.c:1395:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user *optlen @@
net/ipv6/ipv6_sockglue.c:1395:21: sparse: expected int *__pu_addr
net/ipv6/ipv6_sockglue.c:1395:21: sparse: got int [noderef] __user *optlen
net/ipv6/ipv6_sockglue.c:1445:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user *optlen @@
net/ipv6/ipv6_sockglue.c:1445:13: sparse: expected int *__pu_addr
net/ipv6/ipv6_sockglue.c:1445:13: sparse: got int [noderef] __user *optlen
arch/openrisc/include/asm/cmpxchg.h:101:29: sparse: sparse: shift too big (32) for type int
arch/openrisc/include/asm/cmpxchg.h:101:29: sparse: sparse: shift too big (32) for type int
arch/openrisc/include/asm/cmpxchg.h:101:29: sparse: sparse: shift too big (32) for type int
arch/openrisc/include/asm/cmpxchg.h:101:29: sparse: sparse: shift too big (32) for type int
include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *to @@ got void [noderef] __user *to @@
include/linux/uaccess.h:131:38: sparse: expected void *to
include/linux/uaccess.h:131:38: sparse: got void [noderef] __user *to
include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got void const *from @@
include/linux/uaccess.h:131:42: sparse: expected void const [noderef] __user *from
include/linux/uaccess.h:131:42: sparse: got void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *from @@ got void const [noderef] __user *from @@
arch/openrisc/include/asm/uaccess.h:246:55: sparse: expected void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: got void const [noderef] __user *from
include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *to @@ got void [noderef] __user *to @@
include/linux/uaccess.h:131:38: sparse: expected void *to
include/linux/uaccess.h:131:38: sparse: got void [noderef] __user *to
include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got void const *from @@
include/linux/uaccess.h:131:42: sparse: expected void const [noderef] __user *from
include/linux/uaccess.h:131:42: sparse: got void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *from @@ got void const [noderef] __user *from @@
arch/openrisc/include/asm/uaccess.h:246:55: sparse: expected void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: got void const [noderef] __user *from
include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *to @@ got void [noderef] __user *to @@
include/linux/uaccess.h:131:38: sparse: expected void *to
include/linux/uaccess.h:131:38: sparse: got void [noderef] __user *to
include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got void const *from @@
include/linux/uaccess.h:131:42: sparse: expected void const [noderef] __user *from
include/linux/uaccess.h:131:42: sparse: got void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *from @@ got void const [noderef] __user *from @@
arch/openrisc/include/asm/uaccess.h:246:55: sparse: expected void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: got void const [noderef] __user *from
include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *to @@ got void [noderef] __user *to @@
include/linux/uaccess.h:131:38: sparse: expected void *to
include/linux/uaccess.h:131:38: sparse: got void [noderef] __user *to
include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got void const *from @@
include/linux/uaccess.h:131:42: sparse: expected void const [noderef] __user *from
include/linux/uaccess.h:131:42: sparse: got void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *from @@ got void const [noderef] __user *from @@
arch/openrisc/include/asm/uaccess.h:246:55: sparse: expected void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: got void const [noderef] __user *from
include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *to @@ got void [noderef] __user *to @@
include/linux/uaccess.h:131:38: sparse: expected void *to
include/linux/uaccess.h:131:38: sparse: got void [noderef] __user *to
include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got void const *from @@
include/linux/uaccess.h:131:42: sparse: expected void const [noderef] __user *from
include/linux/uaccess.h:131:42: sparse: got void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *from @@ got void const [noderef] __user *from @@
arch/openrisc/include/asm/uaccess.h:246:55: sparse: expected void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: got void const [noderef] __user *from
vim +1101 net/ipv6/ipv6_sockglue.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 1066
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1067 static int compat_ipv6_get_msfilter(struct sock *sk, void __user *optval,
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1068 int __user *optlen)
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1069 {
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1070 const int size0 = offsetof(struct compat_group_filter, gf_slist);
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1071 struct compat_group_filter __user *p = optval;
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1072 struct compat_group_filter gf32;
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1073 struct group_filter gf;
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1074 int len, err;
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1075 int num;
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1076
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1077 if (get_user(len, optlen))
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1078 return -EFAULT;
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1079 if (len < size0)
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1080 return -EINVAL;
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1081
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1082 if (copy_from_user(&gf32, p, size0))
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1083 return -EFAULT;
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1084 gf.gf_interface = gf32.gf_interface;
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1085 gf.gf_fmode = gf32.gf_fmode;
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1086 num = gf.gf_numsrc = gf32.gf_numsrc;
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1087 gf.gf_group = gf32.gf_group;
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1088
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1089 if (gf.gf_group.ss_family != AF_INET6)
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1090 return -EADDRNOTAVAIL;
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1091
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1092 lock_sock(sk);
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1093 err = ip6_mc_msfget(sk, &gf, p->gf_slist);
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1094 release_sock(sk);
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1095 if (err)
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1096 return err;
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1097 if (num > gf.gf_numsrc)
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1098 num = gf.gf_numsrc;
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1099 len = GROUP_FILTER_SIZE(num) - (sizeof(gf)-sizeof(gf32));
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1100 if (put_user(len, optlen) ||
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 @1101 put_user(gf.gf_fmode, &p->gf_fmode) ||
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1102 put_user(gf.gf_numsrc, &p->gf_numsrc))
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1103 return -EFAULT;
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1104 return 0;
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1105 }
f5cfb1759cdde7 Christoph Hellwig 2020-07-15 1106
:::::: The code at line 1101 was first introduced by commit
:::::: f5cfb1759cdde7d190afcd889b46eb82888469e5 net/ipv6: factor out MCAST_MSFILTER getsockopt helpers
:::::: TO: Christoph Hellwig <hch(a)lst.de>
:::::: CC: Christoph Hellwig <hch(a)lst.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
Re: [PATCH] power: supply: sc27xx: prevent adc * 1000 from overflow
by kernel test robot
Hi Chunyan,
I love your patch! Yet something to improve:
[auto build test ERROR on power-supply/for-next]
[also build test ERROR on linux/master linus/master v5.8-rc5 next-20200716]
[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/Chunyan-Zhang/power-supply-sc27x...
base: https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
config: m68k-allyesconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
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 >>):
m68k-linux-ld: drivers/power/supply/sc27xx_fuel_gauge.o: in function `sc27xx_fgu_hw_init':
sc27xx_fuel_gauge.c:(.text+0x13ec): undefined reference to `__divdi3'
m68k-linux-ld: drivers/power/supply/sc27xx_fuel_gauge.o: in function `sc27xx_fgu_get_vbat_vol':
sc27xx_fuel_gauge.c:(.text+0x1d8): undefined reference to `__divdi3'
>> m68k-linux-ld: sc27xx_fuel_gauge.c:(.text+0x1f4): undefined reference to `__divdi3'
m68k-linux-ld: drivers/power/supply/sc27xx_fuel_gauge.o: in function `sc27xx_fgu_get_current':
sc27xx_fuel_gauge.c:(.text+0x2b8): undefined reference to `__divdi3'
m68k-linux-ld: sc27xx_fuel_gauge.c:(.text+0x2d4): undefined reference to `__divdi3'
m68k-linux-ld: drivers/power/supply/sc27xx_fuel_gauge.o:sc27xx_fuel_gauge.c:(.text+0x84e): more undefined references to `__divdi3' follow
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
[lkp] [+643 bytes kernel size regression] [i386-tinyconfig] [7229bb55d1] perf/x86/intel: Generic support for hardware TopDown metrics
by kernel test robot
FYI, we noticed a +643 bytes kernel size regression due to commit:
commit: 7229bb55d1bb9b92d8c59f59fe51b18cb9bf6ff3 (perf/x86/intel: Generic support for hardware TopDown metrics)
url: https://github.com/0day-ci/linux/commits/kan-liang-linux-intel-com/TopDow...
Details as below (size data is obtained by `nm --size-sort vmlinux`):
1ce99a64: perf/x86/intel: Use switch in intel_pmu_disable/enable_event
7229bb55: perf/x86/intel: Generic support for hardware TopDown metrics
+--------------------------------+----------+----------+-------+
| symbol | 1ce99a64 | 7229bb55 | delta |
+--------------------------------+----------+----------+-------+
| bzImage | 444192 | 444512 | 320 |
| nm.t.intel_pmu_hw_config | 387 | 549 | 162 |
| nm.t.collect_events | 248 | 370 | 122 |
| nm.t.intel_pmu_read_event | 19 | 93 | 74 |
| nm.t.intel_pmu_disable_event | 261 | 318 | 57 |
| nm.t.intel_pmu_enable_event | 448 | 503 | 55 |
| nm.t.is_metric_event | 0 | 44 | 44 |
| nm.T.x86_perf_event_set_period | 446 | 477 | 31 |
| nm.t.handle_pmi_common | 516 | 543 | 27 |
| nm.t.x86_pmu_del | 213 | 239 | 26 |
| nm.T.x86_perf_event_update | 264 | 288 | 24 |
| nm.t.x86_pmu_enable | 514 | 523 | 9 |
| nm.D.x86_pmu | 356 | 364 | 8 |
| nm.D.cpu_hw_events | 3808 | 3812 | 4 |
+--------------------------------+----------+----------+-------+
Thanks
2 years, 2 months
Re: [PATCH] virtio_ring: use alloc_pages_node for NUMA-aware allocation
by kernel test robot
Hi Shile,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.8-rc5 next-20200716]
[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/Shile-Zhang/virtio_ring-use-allo...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 8882572675c1bb1cc544f4e229a11661f1fc52e4
config: alpha-allyesconfig (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
drivers/virtio/virtio_ring.c: In function 'vring_alloc_queue':
>> drivers/virtio/virtio_ring.c:280:52: error: passing argument 1 of 'dev_to_node' from incompatible pointer type [-Werror=incompatible-pointer-types]
280 | struct page *page = alloc_pages_node(dev_to_node(&vdev->dev.parent),
| ^~~~~~~~~~~~~~~~~
| |
| struct device **
In file included from include/linux/virtio.h:9,
from drivers/virtio/virtio_ring.c:6:
include/linux/device.h:668:46: note: expected 'struct device *' but argument is of type 'struct device **'
668 | static inline int dev_to_node(struct device *dev)
| ~~~~~~~~~~~~~~~^~~
>> drivers/virtio/virtio_ring.c:284:4: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
284 | phys_addr_t phys_addr = virt_to_phys(queue);
| ^~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/dev_to_node +280 drivers/virtio/virtio_ring.c
271
272 static void *vring_alloc_queue(struct virtio_device *vdev, size_t size,
273 dma_addr_t *dma_handle, gfp_t flag)
274 {
275 if (vring_use_dma_api(vdev)) {
276 return dma_alloc_coherent(vdev->dev.parent, size,
277 dma_handle, flag);
278 } else {
279 void *queue = NULL;
> 280 struct page *page = alloc_pages_node(dev_to_node(&vdev->dev.parent),
281 flag, get_order(size));
282 if (page) {
283 queue = page_address(page);
> 284 phys_addr_t phys_addr = virt_to_phys(queue);
285 *dma_handle = (dma_addr_t)phys_addr;
286
287 /*
288 * Sanity check: make sure we dind't truncate
289 * the address. The only arches I can find that
290 * have 64-bit phys_addr_t but 32-bit dma_addr_t
291 * are certain non-highmem MIPS and x86
292 * configurations, but these configurations
293 * should never allocate physical pages above 32
294 * bits, so this is fine. Just in case, throw a
295 * warning and abort if we end up with an
296 * unrepresentable address.
297 */
298 if (WARN_ON_ONCE(*dma_handle != phys_addr)) {
299 free_pages_exact(queue, PAGE_ALIGN(size));
300 return NULL;
301 }
302 }
303 return queue;
304 }
305 }
306
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
Re: [PATCH] [PATCH] Firmware security information in SYSFS
by kernel test robot
Hi Daniel,
I love your patch! Yet something to improve:
[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on soc/for-next linus/master v5.8-rc5 next-20200716]
[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/Daniel-Gutson/Firmware-security-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git fadbfc38dde26d31e901c3c85cf01332cb6a2224
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project ed6b578040a85977026c93bf4188f996148f3218)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
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 >>):
>> drivers/misc/firmware_security_data.c:51:2: error: member reference type 'struct attribute' is not a pointer; did you mean to use '.'?
sysfs_attr_init(new_data->kobj_attr.attr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/sysfs.h:55:8: note: expanded from macro 'sysfs_attr_init'
(attr)->key = &__key; \
~~~~~~^
>> drivers/misc/firmware_security_data.c:51:2: error: expression is not assignable
sysfs_attr_init(new_data->kobj_attr.attr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/sysfs.h:55:14: note: expanded from macro 'sysfs_attr_init'
(attr)->key = &__key; \
~~~~~~~~~~~ ^
2 errors generated.
vim +51 drivers/misc/firmware_security_data.c
34
35 int register_firmware_security_data_callback(
36 const char *name, ssize_t (*callback)(char *buf, void *private_data),
37 void *private_data)
38 {
39 int retval;
40
41 struct firmware_security_data *new_data;
42
43 if (name == NULL || name[0] == 0)
44 return -EINVAL;
45
46 new_data = kmalloc(sizeof(struct firmware_security_data), GFP_KERNEL);
47 if (new_data == NULL)
48 return -ENOMEM;
49
50 /* initialize attributes: */
> 51 sysfs_attr_init(new_data->kobj_attr.attr);
52 new_data->kobj_attr.attr.name = name;
53 new_data->kobj_attr.attr.mode = 0664;
54 new_data->kobj_attr.show = internal_callback;
55 new_data->kobj_attr.store = NULL;
56
57 new_data->callback = callback;
58 new_data->private_data = private_data;
59
60 /* attempt to create the file: */
61 retval = sysfs_create_file(firmware_data_kobj,
62 &new_data->kobj_attr.attr);
63 if (retval == 0) {
64 /* append to the list of entries: */
65 INIT_LIST_HEAD(&new_data->list_node);
66 mutex_lock(&entries_mutex);
67 list_add(&new_data->list_node, &entries);
68 mutex_unlock(&entries_mutex);
69 } else {
70 kfree(new_data);
71 }
72
73 return retval;
74 }
75 EXPORT_SYMBOL_GPL(register_firmware_security_data_callback);
76
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
Re: [PATCH] virtio_ring: use alloc_pages_node for NUMA-aware allocation
by kernel test robot
Hi Shile,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.8-rc5 next-20200716]
[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/Shile-Zhang/virtio_ring-use-allo...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 8882572675c1bb1cc544f4e229a11661f1fc52e4
config: s390-randconfig-r015-20200717 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project ed6b578040a85977026c93bf4188f996148f3218)
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
# install s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:19:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
^
In file included from drivers/virtio/virtio_ring.c:6:
In file included from include/linux/virtio.h:7:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:490:45: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:20:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
^
In file included from drivers/virtio/virtio_ring.c:6:
In file included from include/linux/virtio.h:7:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:490:45: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:21:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
^
In file included from drivers/virtio/virtio_ring.c:6:
In file included from include/linux/virtio.h:7:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:490:45: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:22:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0xff000000UL) >> 24)))
^
In file included from drivers/virtio/virtio_ring.c:6:
In file included from include/linux/virtio.h:7:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:490:45: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:120:12: note: expanded from macro '__swab32'
__fswab32(x))
^
In file included from drivers/virtio/virtio_ring.c:6:
In file included from include/linux/virtio.h:7:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:46: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew(cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:46: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel(cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
>> drivers/virtio/virtio_ring.c:280:52: error: incompatible pointer types passing 'struct device **' to parameter of type 'struct device *'; remove & [-Werror,-Wincompatible-pointer-types]
struct page *page = alloc_pages_node(dev_to_node(&vdev->dev.parent),
^~~~~~~~~~~~~~~~~
include/linux/device.h:668:46: note: passing argument to parameter 'dev' here
static inline int dev_to_node(struct device *dev)
^
>> drivers/virtio/virtio_ring.c:284:16: warning: ISO C90 forbids mixing declarations and code [-Wdeclaration-after-statement]
phys_addr_t phys_addr = virt_to_phys(queue);
^
21 warnings and 1 error generated.
vim +280 drivers/virtio/virtio_ring.c
271
272 static void *vring_alloc_queue(struct virtio_device *vdev, size_t size,
273 dma_addr_t *dma_handle, gfp_t flag)
274 {
275 if (vring_use_dma_api(vdev)) {
276 return dma_alloc_coherent(vdev->dev.parent, size,
277 dma_handle, flag);
278 } else {
279 void *queue = NULL;
> 280 struct page *page = alloc_pages_node(dev_to_node(&vdev->dev.parent),
281 flag, get_order(size));
282 if (page) {
283 queue = page_address(page);
> 284 phys_addr_t phys_addr = virt_to_phys(queue);
285 *dma_handle = (dma_addr_t)phys_addr;
286
287 /*
288 * Sanity check: make sure we dind't truncate
289 * the address. The only arches I can find that
290 * have 64-bit phys_addr_t but 32-bit dma_addr_t
291 * are certain non-highmem MIPS and x86
292 * configurations, but these configurations
293 * should never allocate physical pages above 32
294 * bits, so this is fine. Just in case, throw a
295 * warning and abort if we end up with an
296 * unrepresentable address.
297 */
298 if (WARN_ON_ONCE(*dma_handle != phys_addr)) {
299 free_pages_exact(queue, PAGE_ALIGN(size));
300 return NULL;
301 }
302 }
303 return queue;
304 }
305 }
306
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
drivers/xen/grant-table.c:747:17: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8882572675c1bb1cc544f4e229a11661f1fc52e4
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 4 weeks ago
config: arm-randconfig-s031-20200717 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.2-49-g707c5017-dirty
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/xen/grant-table.c:739:15: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *vaddr @@ got void [noderef] __iomem * @@
drivers/xen/grant-table.c:739:15: sparse: expected void *vaddr
drivers/xen/grant-table.c:739:15: sparse: got void [noderef] __iomem *
>> drivers/xen/grant-table.c:747:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *iomem_cookie @@ got void *vaddr @@
>> drivers/xen/grant-table.c:747:17: sparse: expected void volatile [noderef] __iomem *iomem_cookie
drivers/xen/grant-table.c:747:17: sparse: got void *vaddr
>> drivers/xen/grant-table.c:766:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *iomem_cookie @@ got void *[addressable] [assigned] [toplevel] vaddr @@
drivers/xen/grant-table.c:766:9: sparse: expected void volatile [noderef] __iomem *iomem_cookie
drivers/xen/grant-table.c:766:9: sparse: got void *[addressable] [assigned] [toplevel] vaddr
vim +747 drivers/xen/grant-table.c
ad9a86121f5a374 Jeremy Fitzhardinge 2007-07-17 728
47c542050d306e5 Julien Grall 2014-01-30 729 int gnttab_setup_auto_xlat_frames(phys_addr_t addr)
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 730 {
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 731 xen_pfn_t *pfn;
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 732 unsigned int max_nr_gframes = __max_nr_grant_frames();
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 733 unsigned int i;
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 734 void *vaddr;
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 735
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 736 if (xen_auto_xlat_grant_frames.count)
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 737 return -EINVAL;
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 738
5ed5451d997f7a8 Julien Grall 2015-05-05 739 vaddr = xen_remap(addr, XEN_PAGE_SIZE * max_nr_gframes);
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 740 if (vaddr == NULL) {
47c542050d306e5 Julien Grall 2014-01-30 741 pr_warn("Failed to ioremap gnttab share frames (addr=%pa)!\n",
47c542050d306e5 Julien Grall 2014-01-30 742 &addr);
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 743 return -ENOMEM;
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 744 }
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 745 pfn = kcalloc(max_nr_gframes, sizeof(pfn[0]), GFP_KERNEL);
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 746 if (!pfn) {
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 @747 xen_unmap(vaddr);
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 748 return -ENOMEM;
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 749 }
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 750 for (i = 0; i < max_nr_gframes; i++)
5ed5451d997f7a8 Julien Grall 2015-05-05 751 pfn[i] = XEN_PFN_DOWN(addr) + i;
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 752
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 753 xen_auto_xlat_grant_frames.vaddr = vaddr;
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 754 xen_auto_xlat_grant_frames.pfn = pfn;
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 755 xen_auto_xlat_grant_frames.count = max_nr_gframes;
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 756
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 757 return 0;
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 758 }
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 759 EXPORT_SYMBOL_GPL(gnttab_setup_auto_xlat_frames);
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 760
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 761 void gnttab_free_auto_xlat_frames(void)
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 762 {
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 763 if (!xen_auto_xlat_grant_frames.count)
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 764 return;
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 765 kfree(xen_auto_xlat_grant_frames.pfn);
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 @766 xen_unmap(xen_auto_xlat_grant_frames.vaddr);
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 767
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 768 xen_auto_xlat_grant_frames.pfn = NULL;
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 769 xen_auto_xlat_grant_frames.count = 0;
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 770 xen_auto_xlat_grant_frames.vaddr = NULL;
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 771 }
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 772 EXPORT_SYMBOL_GPL(gnttab_free_auto_xlat_frames);
efaf30a3357872c Konrad Rzeszutek Wilk 2014-01-06 773
:::::: The code at line 747 was first introduced by commit
:::::: efaf30a3357872cf0fc7d555b1f9968ec71535d3 xen/grant: Implement an grant frame array struct (v3).
:::::: TO: Konrad Rzeszutek Wilk <konrad.wilk(a)oracle.com>
:::::: CC: Konrad Rzeszutek Wilk <konrad.wilk(a)oracle.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months