Re: [PATCH] drm/virtio: delay pinning the pages till first use

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Maksym,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm/drm-next]
[also build test ERROR on next-20211104]
[cannot apply to v5.15]
[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/Maksym-Wezdecki/drm-virtio-delay-pinning-the-pages-till-first-use/20211102-193430
base:   git://anongit.freedesktop.org/drm/drm drm-next
config: i386-buildonly-randconfig-r002-20211101 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 264d3b6d4e08401c5b50a85bd76e80b3461d77e6)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/1795d2fd78a334a37a02dba76ac1e314cf122467
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Maksym-Wezdecki/drm-virtio-delay-pinning-the-pages-till-first-use/20211102-193430
        git checkout 1795d2fd78a334a37a02dba76ac1e314cf122467
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/virtio/virtgpu_object.c:254:11: error: variable 'ents' is uninitialized when used here [-Werror,-Wuninitialized]
                                                       ents, nents);
                                                       ^~~~
   drivers/gpu/drm/virtio/virtgpu_object.c:219:35: note: initialize the variable 'ents' to silence this warning
           struct virtio_gpu_mem_entry *ents;
                                            ^
                                             = NULL
>> drivers/gpu/drm/virtio/virtgpu_object.c:254:17: error: variable 'nents' is uninitialized when used here [-Werror,-Wuninitialized]
                                                       ents, nents);
                                                             ^~~~~
   drivers/gpu/drm/virtio/virtgpu_object.c:220:20: note: initialize the variable 'nents' to silence this warning
           unsigned int nents;
                             ^
                              = 0
   2 errors generated.


vim +/ents +254 drivers/gpu/drm/virtio/virtgpu_object.c

2f2aa13724d568 Gerd Hoffmann   2020-02-07  210  
dc5698e80cf724 Dave Airlie     2013-09-09  211  int virtio_gpu_object_create(struct virtio_gpu_device *vgdev,
4441235f9566e6 Gerd Hoffmann   2019-03-18  212  			     struct virtio_gpu_object_params *params,
530b28426a94b8 Gerd Hoffmann   2019-03-18  213  			     struct virtio_gpu_object **bo_ptr,
530b28426a94b8 Gerd Hoffmann   2019-03-18  214  			     struct virtio_gpu_fence *fence)
dc5698e80cf724 Dave Airlie     2013-09-09  215  {
e2324300f427ff Gerd Hoffmann   2019-08-29  216  	struct virtio_gpu_object_array *objs = NULL;
c66df701e783bc Gerd Hoffmann   2019-08-29  217  	struct drm_gem_shmem_object *shmem_obj;
dc5698e80cf724 Dave Airlie     2013-09-09  218  	struct virtio_gpu_object *bo;
2f2aa13724d568 Gerd Hoffmann   2020-02-07  219  	struct virtio_gpu_mem_entry *ents;
2f2aa13724d568 Gerd Hoffmann   2020-02-07  220  	unsigned int nents;
dc5698e80cf724 Dave Airlie     2013-09-09  221  	int ret;
dc5698e80cf724 Dave Airlie     2013-09-09  222  
dc5698e80cf724 Dave Airlie     2013-09-09  223  	*bo_ptr = NULL;
dc5698e80cf724 Dave Airlie     2013-09-09  224  
c66df701e783bc Gerd Hoffmann   2019-08-29  225  	params->size = roundup(params->size, PAGE_SIZE);
c66df701e783bc Gerd Hoffmann   2019-08-29  226  	shmem_obj = drm_gem_shmem_create(vgdev->ddev, params->size);
c66df701e783bc Gerd Hoffmann   2019-08-29  227  	if (IS_ERR(shmem_obj))
c66df701e783bc Gerd Hoffmann   2019-08-29  228  		return PTR_ERR(shmem_obj);
c66df701e783bc Gerd Hoffmann   2019-08-29  229  	bo = gem_to_virtio_gpu_obj(&shmem_obj->base);
dc5698e80cf724 Dave Airlie     2013-09-09  230  
556c62e85f9b97 Matthew Wilcox  2018-10-30  231  	ret = virtio_gpu_resource_id_get(vgdev, &bo->hw_res_handle);
e2324300f427ff Gerd Hoffmann   2019-08-29  232  	if (ret < 0)
e2324300f427ff Gerd Hoffmann   2019-08-29  233  		goto err_free_gem;
e2324300f427ff Gerd Hoffmann   2019-08-29  234  
530b28426a94b8 Gerd Hoffmann   2019-03-18  235  	bo->dumb = params->dumb;
530b28426a94b8 Gerd Hoffmann   2019-03-18  236  
e2324300f427ff Gerd Hoffmann   2019-08-29  237  	if (fence) {
e2324300f427ff Gerd Hoffmann   2019-08-29  238  		ret = -ENOMEM;
e2324300f427ff Gerd Hoffmann   2019-08-29  239  		objs = virtio_gpu_array_alloc(1);
e2324300f427ff Gerd Hoffmann   2019-08-29  240  		if (!objs)
e2324300f427ff Gerd Hoffmann   2019-08-29  241  			goto err_put_id;
c66df701e783bc Gerd Hoffmann   2019-08-29  242  		virtio_gpu_array_add_obj(objs, &bo->base.base);
e2324300f427ff Gerd Hoffmann   2019-08-29  243  
e2324300f427ff Gerd Hoffmann   2019-08-29  244  		ret = virtio_gpu_array_lock_resv(objs);
e2324300f427ff Gerd Hoffmann   2019-08-29  245  		if (ret != 0)
e2324300f427ff Gerd Hoffmann   2019-08-29  246  			goto err_put_objs;
e2324300f427ff Gerd Hoffmann   2019-08-29  247  	}
e2324300f427ff Gerd Hoffmann   2019-08-29  248  
897b4d1acaf563 Gerd Hoffmann   2020-09-23  249  	if (params->blob) {
3389082bb98296 Vivek Kasireddy 2021-04-12  250  		if (params->blob_mem == VIRTGPU_BLOB_MEM_GUEST)
3389082bb98296 Vivek Kasireddy 2021-04-12  251  			bo->guest_blob = true;
3389082bb98296 Vivek Kasireddy 2021-04-12  252  
897b4d1acaf563 Gerd Hoffmann   2020-09-23  253  		virtio_gpu_cmd_resource_create_blob(vgdev, bo, params,
897b4d1acaf563 Gerd Hoffmann   2020-09-23 @254  						    ents, nents);
897b4d1acaf563 Gerd Hoffmann   2020-09-23  255  	} else if (params->virgl) {
30172efbfb842c Gurchetan Singh 2020-09-23  256  		virtio_gpu_cmd_resource_create_3d(vgdev, bo, params,
30172efbfb842c Gurchetan Singh 2020-09-23  257  						  objs, fence);
30172efbfb842c Gurchetan Singh 2020-09-23  258  	} else {
1795d2fd78a334 mwezdeck        2021-11-02  259  		ret = virtio_gpu_object_shmem_init(vgdev, bo, &ents, &nents);
1795d2fd78a334 mwezdeck        2021-11-02  260  		if (ret != 0) {
1795d2fd78a334 mwezdeck        2021-11-02  261  			virtio_gpu_array_put_free(objs);
1795d2fd78a334 mwezdeck        2021-11-02  262  			virtio_gpu_free_object(&shmem_obj->base);
1795d2fd78a334 mwezdeck        2021-11-02  263  			return ret;
1795d2fd78a334 mwezdeck        2021-11-02  264  		}
30172efbfb842c Gurchetan Singh 2020-09-23  265  		virtio_gpu_cmd_create_resource(vgdev, bo, params,
30172efbfb842c Gurchetan Singh 2020-09-23  266  					       objs, fence);
c76d4ab764adae Gurchetan Singh 2020-04-01  267  		virtio_gpu_object_attach(vgdev, bo, ents, nents);
30172efbfb842c Gurchetan Singh 2020-09-23  268  	}
dc5698e80cf724 Dave Airlie     2013-09-09  269  
dc5698e80cf724 Dave Airlie     2013-09-09  270  	*bo_ptr = bo;
dc5698e80cf724 Dave Airlie     2013-09-09  271  	return 0;
e2324300f427ff Gerd Hoffmann   2019-08-29  272  
e2324300f427ff Gerd Hoffmann   2019-08-29  273  err_put_objs:
e2324300f427ff Gerd Hoffmann   2019-08-29  274  	virtio_gpu_array_put_free(objs);
e2324300f427ff Gerd Hoffmann   2019-08-29  275  err_put_id:
e2324300f427ff Gerd Hoffmann   2019-08-29  276  	virtio_gpu_resource_id_put(vgdev, bo->hw_res_handle);
e2324300f427ff Gerd Hoffmann   2019-08-29  277  err_free_gem:
c66df701e783bc Gerd Hoffmann   2019-08-29  278  	drm_gem_shmem_free_object(&shmem_obj->base);
e2324300f427ff Gerd Hoffmann   2019-08-29  279  	return ret;
dc5698e80cf724 Dave Airlie     2013-09-09  280  }
1795d2fd78a334 mwezdeck        2021-11-02  281  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux