All of lore.kernel.org
 help / color / mirror / Atom feed
* [drm-drm-misc:drm-misc-next 4/4] drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:766 amdgpu_gem_op_ioctl() warn: should 'robj->tbo.page_alignment << 12' be a 64 bit type?
@ 2021-04-23 23:05 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-04-23 23:05 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: "Christian König" <christian.koenig@amd.com>
CC: Matthew Auld <matthew.auld@intel.com>

tree:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
head:   c777dc9e793342ecdfc95045d2127a3ea32791a0
commit: c777dc9e793342ecdfc95045d2127a3ea32791a0 [4/4] drm/ttm: move the page_alignment into the BO v2
:::::: branch date: 9 hours ago
:::::: commit date: 9 hours ago
config: ia64-randconfig-m031-20210423 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:766 amdgpu_gem_op_ioctl() warn: should 'robj->tbo.page_alignment << 12' be a 64 bit type?

vim +766 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c

d38ceaf99ed015 Alex Deucher                   2015-04-20  739  
d38ceaf99ed015 Alex Deucher                   2015-04-20  740  int amdgpu_gem_op_ioctl(struct drm_device *dev, void *data,
d38ceaf99ed015 Alex Deucher                   2015-04-20  741  			struct drm_file *filp)
d38ceaf99ed015 Alex Deucher                   2015-04-20  742  {
1348969ab68cb8 Luben Tuikov                   2020-08-24  743  	struct amdgpu_device *adev = drm_to_adev(dev);
d38ceaf99ed015 Alex Deucher                   2015-04-20  744  	struct drm_amdgpu_gem_op *args = data;
d38ceaf99ed015 Alex Deucher                   2015-04-20  745  	struct drm_gem_object *gobj;
b4ae4fe6cdbbfe shaoyunl                       2019-03-26  746  	struct amdgpu_vm_bo_base *base;
d38ceaf99ed015 Alex Deucher                   2015-04-20  747  	struct amdgpu_bo *robj;
d38ceaf99ed015 Alex Deucher                   2015-04-20  748  	int r;
d38ceaf99ed015 Alex Deucher                   2015-04-20  749  
a8ad0bd84f9860 Chris Wilson                   2016-05-09  750  	gobj = drm_gem_object_lookup(filp, args->handle);
d38ceaf99ed015 Alex Deucher                   2015-04-20  751  	if (gobj == NULL) {
d38ceaf99ed015 Alex Deucher                   2015-04-20  752  		return -ENOENT;
d38ceaf99ed015 Alex Deucher                   2015-04-20  753  	}
d38ceaf99ed015 Alex Deucher                   2015-04-20  754  	robj = gem_to_amdgpu_bo(gobj);
d38ceaf99ed015 Alex Deucher                   2015-04-20  755  
d38ceaf99ed015 Alex Deucher                   2015-04-20  756  	r = amdgpu_bo_reserve(robj, false);
d38ceaf99ed015 Alex Deucher                   2015-04-20  757  	if (unlikely(r))
d38ceaf99ed015 Alex Deucher                   2015-04-20  758  		goto out;
d38ceaf99ed015 Alex Deucher                   2015-04-20  759  
d38ceaf99ed015 Alex Deucher                   2015-04-20  760  	switch (args->op) {
d38ceaf99ed015 Alex Deucher                   2015-04-20  761  	case AMDGPU_GEM_OP_GET_GEM_CREATE_INFO: {
d38ceaf99ed015 Alex Deucher                   2015-04-20  762  		struct drm_amdgpu_gem_create_in info;
7ecc245a8ce32f Christian König                2017-07-26  763  		void __user *out = u64_to_user_ptr(args->value);
d38ceaf99ed015 Alex Deucher                   2015-04-20  764  
c105de2828e139 Gerd Hoffmann                  2019-08-05  765  		info.bo_size = robj->tbo.base.size;
c777dc9e793342 Christian König                2021-02-05 @766  		info.alignment = robj->tbo.page_alignment << PAGE_SHIFT;
6d7d9c5aa212d0 Kent Russell                   2017-08-08  767  		info.domains = robj->preferred_domains;
d38ceaf99ed015 Alex Deucher                   2015-04-20  768  		info.domain_flags = robj->flags;
4c28fb0b27ad58 Christian König                2015-08-28  769  		amdgpu_bo_unreserve(robj);
d38ceaf99ed015 Alex Deucher                   2015-04-20  770  		if (copy_to_user(out, &info, sizeof(info)))
d38ceaf99ed015 Alex Deucher                   2015-04-20  771  			r = -EFAULT;
d38ceaf99ed015 Alex Deucher                   2015-04-20  772  		break;
d38ceaf99ed015 Alex Deucher                   2015-04-20  773  	}
d8f65a2376268d Marek Olšák                    2015-05-27  774  	case AMDGPU_GEM_OP_SET_PLACEMENT:
803d89ade4ede1 Christopher James Halse Rogers 2017-04-03  775  		if (robj->prime_shared_count && (args->value & AMDGPU_GEM_DOMAIN_VRAM)) {
803d89ade4ede1 Christopher James Halse Rogers 2017-04-03  776  			r = -EINVAL;
803d89ade4ede1 Christopher James Halse Rogers 2017-04-03  777  			amdgpu_bo_unreserve(robj);
803d89ade4ede1 Christopher James Halse Rogers 2017-04-03  778  			break;
803d89ade4ede1 Christopher James Halse Rogers 2017-04-03  779  		}
cc325d19134756 Christian König                2016-02-08  780  		if (amdgpu_ttm_tt_get_usermm(robj->tbo.ttm)) {
d38ceaf99ed015 Alex Deucher                   2015-04-20  781  			r = -EPERM;
4c28fb0b27ad58 Christian König                2015-08-28  782  			amdgpu_bo_unreserve(robj);
d38ceaf99ed015 Alex Deucher                   2015-04-20  783  			break;
d38ceaf99ed015 Alex Deucher                   2015-04-20  784  		}
b4ae4fe6cdbbfe shaoyunl                       2019-03-26  785  		for (base = robj->vm_bo; base; base = base->next)
b4ae4fe6cdbbfe shaoyunl                       2019-03-26  786  			if (amdgpu_xgmi_same_hive(amdgpu_ttm_adev(robj->tbo.bdev),
b4ae4fe6cdbbfe shaoyunl                       2019-03-26  787  				amdgpu_ttm_adev(base->vm->root.base.bo->tbo.bdev))) {
b4ae4fe6cdbbfe shaoyunl                       2019-03-26  788  				r = -EINVAL;
b4ae4fe6cdbbfe shaoyunl                       2019-03-26  789  				amdgpu_bo_unreserve(robj);
b4ae4fe6cdbbfe shaoyunl                       2019-03-26  790  				goto out;
b4ae4fe6cdbbfe shaoyunl                       2019-03-26  791  			}
b4ae4fe6cdbbfe shaoyunl                       2019-03-26  792  
b4ae4fe6cdbbfe shaoyunl                       2019-03-26  793  
6d7d9c5aa212d0 Kent Russell                   2017-08-08  794  		robj->preferred_domains = args->value & (AMDGPU_GEM_DOMAIN_VRAM |
d38ceaf99ed015 Alex Deucher                   2015-04-20  795  							AMDGPU_GEM_DOMAIN_GTT |
d38ceaf99ed015 Alex Deucher                   2015-04-20  796  							AMDGPU_GEM_DOMAIN_CPU);
6d7d9c5aa212d0 Kent Russell                   2017-08-08  797  		robj->allowed_domains = robj->preferred_domains;
1ea863fd736eed Christian König                2015-12-18  798  		if (robj->allowed_domains == AMDGPU_GEM_DOMAIN_VRAM)
1ea863fd736eed Christian König                2015-12-18  799  			robj->allowed_domains |= AMDGPU_GEM_DOMAIN_GTT;
1ea863fd736eed Christian König                2015-12-18  800  
e1eb899b45781b Christian König                2017-08-25  801  		if (robj->flags & AMDGPU_GEM_CREATE_VM_ALWAYS_VALID)
e1eb899b45781b Christian König                2017-08-25  802  			amdgpu_vm_bo_invalidate(adev, robj, true);
e1eb899b45781b Christian König                2017-08-25  803  
4c28fb0b27ad58 Christian König                2015-08-28  804  		amdgpu_bo_unreserve(robj);
d38ceaf99ed015 Alex Deucher                   2015-04-20  805  		break;
d38ceaf99ed015 Alex Deucher                   2015-04-20  806  	default:
4c28fb0b27ad58 Christian König                2015-08-28  807  		amdgpu_bo_unreserve(robj);
d38ceaf99ed015 Alex Deucher                   2015-04-20  808  		r = -EINVAL;
d38ceaf99ed015 Alex Deucher                   2015-04-20  809  	}
d38ceaf99ed015 Alex Deucher                   2015-04-20  810  
d38ceaf99ed015 Alex Deucher                   2015-04-20  811  out:
e07ddb0ce7cde6 Emil Velikov                   2020-05-15  812  	drm_gem_object_put(gobj);
d38ceaf99ed015 Alex Deucher                   2015-04-20  813  	return r;
d38ceaf99ed015 Alex Deucher                   2015-04-20  814  }
d38ceaf99ed015 Alex Deucher                   2015-04-20  815  

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

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-23 23:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 23:05 [drm-drm-misc:drm-misc-next 4/4] drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:766 amdgpu_gem_op_ioctl() warn: should 'robj->tbo.page_alignment << 12' be a 64 bit type? kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.