[gabbayo:amdkfd-next 10/53] drivers/gpu/drm/amd/amdkfd/kfd_process.c:289:37: sparse: constant 0x2000000000000 is so big it is long

kbuild test robot fengguang.wu at intel.com
Fri Jan 5 02:42:47 UTC 2018


tree:   git://people.freedesktop.org/~gabbayo/linux amdkfd-next
head:   9f0a0b41ffccf9a76b19ea263ae16d2d5888093e
commit: 373d7080896a3cb3b28ae3a2abdafb7bb87552b1 [10/53] drm/amdkfd: Add CWSR support
reproduce:
        # apt-get install sparse
        git checkout 373d7080896a3cb3b28ae3a2abdafb7bb87552b1
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)


vim +289 drivers/gpu/drm/amd/amdkfd/kfd_process.c

   273	
   274	static int kfd_process_init_cwsr(struct kfd_process *p, struct file *filep)
   275	{
   276		int err = 0;
   277		unsigned long  offset;
   278		struct kfd_process_device *temp, *pdd = NULL;
   279		struct kfd_dev *dev = NULL;
   280		struct qcm_process_device *qpd = NULL;
   281	
   282		mutex_lock(&p->mutex);
   283		list_for_each_entry_safe(pdd, temp, &p->per_device_data,
   284					per_device_list) {
   285			dev = pdd->dev;
   286			qpd = &pdd->qpd;
   287			if (!dev->cwsr_enabled || qpd->cwsr_kaddr)
   288				continue;
 > 289			offset = (dev->id | KFD_MMAP_RESERVED_MEM_MASK) << PAGE_SHIFT;
   290			qpd->tba_addr = (int64_t)vm_mmap(filep, 0,
   291				KFD_CWSR_TBA_TMA_SIZE, PROT_READ | PROT_EXEC,
   292				MAP_SHARED, offset);
   293	
   294			if (IS_ERR_VALUE(qpd->tba_addr)) {
   295				pr_err("Failure to set tba address. error -%d.\n",
   296					(int)qpd->tba_addr);
   297				err = qpd->tba_addr;
   298				qpd->tba_addr = 0;
   299				qpd->cwsr_kaddr = NULL;
   300				goto out;
   301			}
   302	
   303			memcpy(qpd->cwsr_kaddr, dev->cwsr_isa, dev->cwsr_isa_size);
   304	
   305			qpd->tma_addr = qpd->tba_addr + KFD_CWSR_TMA_OFFSET;
   306			pr_debug("set tba :0x%llx, tma:0x%llx, cwsr_kaddr:%p for pqm.\n",
   307				qpd->tba_addr, qpd->tma_addr, qpd->cwsr_kaddr);
   308		}
   309	out:
   310		mutex_unlock(&p->mutex);
   311		return err;
   312	}
   313	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation


More information about the dri-devel mailing list