From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============7825034472855976323==" MIME-Version: 1.0 From: kbuild test robot To: kbuild-all@lists.01.org Subject: Re: [PATCH v3 1/2] virtio: stop using legacy struct vring in kernel Date: Wed, 08 Apr 2020 08:13:57 +0800 Message-ID: <202004080858.eMqdd5fc%lkp@intel.com> In-Reply-To: <20200406161146.130741-2-mst@redhat.com> List-Id: --===============7825034472855976323== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi "Michael, I love your patch! Perhaps something to improve: [auto build test WARNING on next-20200406] [also build test WARNING on v5.6] [cannot apply to vhost/linux-next linus/master linux/master v5.6 v5.6-rc7 v= 5.6-rc6] [if your patch is applied to the wrong git tree, please drop us a note to h= elp improve the system. BTW, we also suggest to use '--base' option to specify = the base tree in git format-patch, please see https://stackoverflow.com/a/37406= 982] url: https://github.com/0day-ci/linux/commits/Michael-S-Tsirkin/virtio-a= lignment-issues/20200407-025651 base: b2e2a818a01717ba15c74fd355f76822b81a95f6 reproduce: # apt-get install sparse # sparse version: v0.6.1-188-g79f7ac98-dirty make ARCH=3Dx86_64 allmodconfig make C=3D1 CF=3D'-fdiagnostic-prefix -D__CHECK_ENDIAN__' If you fix the issue, kindly add following tag as appropriate Reported-by: kbuild test robot sparse warnings: (new ones prefixed by >>) drivers/remoteproc/remoteproc_core.c:331:16: sparse: sparse: undefined i= dentifier 'vring_size' drivers/remoteproc/remoteproc_core.c:331:16: sparse: sparse: undefined i= dentifier 'vring_size' drivers/remoteproc/remoteproc_core.c:331:16: sparse: sparse: incompatibl= e types for operation (-): >> drivers/remoteproc/remoteproc_core.c:331:16: sparse: bad type >> drivers/remoteproc/remoteproc_core.c:331:16: sparse: int drivers/remoteproc/remoteproc_core.c:331:16: sparse: sparse: undefined i= dentifier 'vring_size' drivers/remoteproc/remoteproc_core.c:331:16: sparse: sparse: incompatibl= e types for operation (-): >> drivers/remoteproc/remoteproc_core.c:331:16: sparse: bad type >> drivers/remoteproc/remoteproc_core.c:331:16: sparse: int -- drivers/misc/mic/vop/vop_vringh.c:299:27: sparse: sparse: undefined iden= tifier 'vring_size' drivers/misc/mic/vop/vop_vringh.c:299:27: sparse: sparse: undefined iden= tifier 'vring_size' drivers/misc/mic/vop/vop_vringh.c:299:27: sparse: sparse: incompatible t= ypes for operation (-): >> drivers/misc/mic/vop/vop_vringh.c:299:27: sparse: bad type >> drivers/misc/mic/vop/vop_vringh.c:299:27: sparse: int drivers/misc/mic/vop/vop_vringh.c:299:27: sparse: sparse: undefined iden= tifier 'vring_size' drivers/misc/mic/vop/vop_vringh.c:299:27: sparse: sparse: incompatible t= ypes for operation (-): >> drivers/misc/mic/vop/vop_vringh.c:299:27: sparse: bad type >> drivers/misc/mic/vop/vop_vringh.c:299:27: sparse: int drivers/misc/mic/vop/vop_vringh.c:311:37: sparse: sparse: undefined iden= tifier 'vring_size' drivers/misc/mic/vop/vop_vringh.c:324:17: sparse: sparse: undefined iden= tifier 'vring_init' vim +331 drivers/remoteproc/remoteproc_core.c c874bf59add0e6 Loic Pallardy 2018-07-27 319 = 6db20ea8d85064 Ohad Ben-Cohen 2012-05-17 320 int rproc_alloc_vring= (struct rproc_vdev *rvdev, int i) 400e64df6b237e Ohad Ben-Cohen 2011-10-20 321 { 7a186941626d19 Ohad Ben-Cohen 2012-02-13 322 struct rproc *rproc = =3D rvdev->rproc; b5ab5e24e960b9 Ohad Ben-Cohen 2012-05-30 323 struct device *dev = =3D &rproc->dev; 6db20ea8d85064 Ohad Ben-Cohen 2012-05-17 324 struct rproc_vring *= rvring =3D &rvdev->vring[i]; c0d631570ad54a Sjur Br=C3=A6ndeland 2013-02-21 325 struct fw_rsc_v= dev *rsc; 096ee78669d2bc Clement Leger 2020-03-02 326 int ret, notifyid; c6aed238b7a9b1 Loic Pallardy 2018-07-27 327 struct rproc_mem_ent= ry *mem; 096ee78669d2bc Clement Leger 2020-03-02 328 size_t size; 400e64df6b237e Ohad Ben-Cohen 2011-10-20 329 = 7a186941626d19 Ohad Ben-Cohen 2012-02-13 330 /* actual size of vr= ing (in bytes) */ 6db20ea8d85064 Ohad Ben-Cohen 2012-05-17 @331 size =3D PAGE_ALIGN(= vring_size(rvring->len, rvring->align)); 400e64df6b237e Ohad Ben-Cohen 2011-10-20 332 = c6aed238b7a9b1 Loic Pallardy 2018-07-27 333 rsc =3D (void *)rpro= c->table_ptr + rvdev->rsc_offset; c6aed238b7a9b1 Loic Pallardy 2018-07-27 334 = c6aed238b7a9b1 Loic Pallardy 2018-07-27 335 /* Search for pre-re= gistered carveout */ c6aed238b7a9b1 Loic Pallardy 2018-07-27 336 mem =3D rproc_find_c= arveout_by_name(rproc, "vdev%dvring%d", rvdev->index, c6aed238b7a9b1 Loic Pallardy 2018-07-27 337 i); c6aed238b7a9b1 Loic Pallardy 2018-07-27 338 if (mem) { c6aed238b7a9b1 Loic Pallardy 2018-07-27 339 if (rproc_check_car= veout_da(rproc, mem, rsc->vring[i].da, size)) c6aed238b7a9b1 Loic Pallardy 2018-07-27 340 return -ENOMEM; c6aed238b7a9b1 Loic Pallardy 2018-07-27 341 } else { c6aed238b7a9b1 Loic Pallardy 2018-07-27 342 /* Register carveou= t in in list */ 99cf0361e7af29 Ben Dooks (Codethink 2019-10-17 343) mem =3D rproc_mem_e= ntry_init(dev, NULL, 0, 99cf0361e7af29 Ben Dooks (Codethink 2019-10-17 344) size, rsc->vr= ing[i].da, c6aed238b7a9b1 Loic Pallardy 2018-07-27 345 rproc_alloc_c= arveout, c6aed238b7a9b1 Loic Pallardy 2018-07-27 346 rproc_release= _carveout, c6aed238b7a9b1 Loic Pallardy 2018-07-27 347 "vdev%dvring%= d", c6aed238b7a9b1 Loic Pallardy 2018-07-27 348 rvdev->index,= i); c6aed238b7a9b1 Loic Pallardy 2018-07-27 349 if (!mem) { c6aed238b7a9b1 Loic Pallardy 2018-07-27 350 dev_err(dev, "Can'= t allocate memory entry structure\n"); c6aed238b7a9b1 Loic Pallardy 2018-07-27 351 return -ENOMEM; c6aed238b7a9b1 Loic Pallardy 2018-07-27 352 } c6aed238b7a9b1 Loic Pallardy 2018-07-27 353 = c6aed238b7a9b1 Loic Pallardy 2018-07-27 354 rproc_add_carveout(= rproc, mem); 400e64df6b237e Ohad Ben-Cohen 2011-10-20 355 } 400e64df6b237e Ohad Ben-Cohen 2011-10-20 356 = 400e64df6b237e Ohad Ben-Cohen 2011-10-20 357 /* 6db20ea8d85064 Ohad Ben-Cohen 2012-05-17 358 * Assign an rproc-w= ide unique index for this vring 6db20ea8d85064 Ohad Ben-Cohen 2012-05-17 359 * TODO: assign a no= tifyid for rvdev updates as well 6db20ea8d85064 Ohad Ben-Cohen 2012-05-17 360 * TODO: support pre= defined notifyids (via resource table) 400e64df6b237e Ohad Ben-Cohen 2011-10-20 361 */ 15fc61106a203b Tejun Heo 2013-02-27 362 ret =3D idr_alloc(&r= proc->notifyids, rvring, 0, 0, GFP_KERNEL); b39599b7cb8f29 Suman Anna 2013-03-06 363 if (ret < 0) { 15fc61106a203b Tejun Heo 2013-02-27 364 dev_err(dev, "idr_a= lloc failed: %d\n", ret); 7a186941626d19 Ohad Ben-Cohen 2012-02-13 365 return ret; 400e64df6b237e Ohad Ben-Cohen 2011-10-20 366 } 15fc61106a203b Tejun Heo 2013-02-27 367 notifyid =3D ret; 400e64df6b237e Ohad Ben-Cohen 2011-10-20 368 = 48f18f89896338 Bjorn Andersson 2016-10-19 369 /* Potentially bump = max_notifyid */ 48f18f89896338 Bjorn Andersson 2016-10-19 370 if (notifyid > rproc= ->max_notifyid) 48f18f89896338 Bjorn Andersson 2016-10-19 371 rproc->max_notifyid= =3D notifyid; 48f18f89896338 Bjorn Andersson 2016-10-19 372 = 6db20ea8d85064 Ohad Ben-Cohen 2012-05-17 373 rvring->notifyid =3D= notifyid; 400e64df6b237e Ohad Ben-Cohen 2011-10-20 374 = c6aed238b7a9b1 Loic Pallardy 2018-07-27 375 /* Let the rproc kno= w the notifyid of this vring.*/ c0d631570ad54a Sjur Br=C3=A6ndeland 2013-02-21 376 rsc->vring[i].n= otifyid =3D notifyid; 400e64df6b237e Ohad Ben-Cohen 2011-10-20 377 return 0; 400e64df6b237e Ohad Ben-Cohen 2011-10-20 378 } 400e64df6b237e Ohad Ben-Cohen 2011-10-20 379 = :::::: The code at line 331 was first introduced by commit :::::: 6db20ea8d85064175c7ef594c433c6c2e6bbab83 remoteproc: allocate vrings= on demand, free when not needed :::::: TO: Ohad Ben-Cohen :::::: CC: Ohad Ben-Cohen --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============7825034472855976323==--