Re: [PATCH v10 5/5] drm/i915/selftests: Introduce live tests of private PAT management

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

 



Hi Zhi,

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on next-20170913]
[cannot apply to v4.13]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Zhi-Wang/drm-i915-Factor-out-setup_private_pat/20170912-152713
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-a0-09140023 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All errors (new ones prefixed by >>):

   cc1: warnings being treated as errors
   drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'intel_ppat_get':
   drivers/gpu/drm/i915/i915_gem_gtt.c:2791: error: 'entry' may be used uninitialized in this function
   In file included from drivers/gpu/drm/i915/i915_gem_gtt.c:3767:
   drivers/gpu/drm/i915/selftests/i915_gem_gtt.c: In function 'igt_ppat_get':
>> drivers/gpu/drm/i915/selftests/i915_gem_gtt.c:1365: error: 'entry' may be used uninitialized in this function
   drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'gen8_ppgtt_insert_4lvl':
   drivers/gpu/drm/i915/i915_gem_gtt.c:938: error: 'iter.sg' is used uninitialized in this function
   drivers/gpu/drm/i915/i915_gem_gtt.c:939: error: 'iter.dma' is used uninitialized in this function
   drivers/gpu/drm/i915/i915_gem_gtt.c: In function 'gen8_ppgtt_insert_3lvl':
   drivers/gpu/drm/i915/i915_gem_gtt.c:921: error: 'iter.sg' is used uninitialized in this function
   drivers/gpu/drm/i915/i915_gem_gtt.c:922: error: 'iter.dma' is used uninitialized in this function

vim +/entry +1365 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c

  1359	
  1360	static int igt_ppat_get(void *arg)
  1361	{
  1362		struct drm_i915_private *i915 = arg;
  1363		struct intel_ppat *ppat = &i915->ppat;
  1364		const struct intel_ppat_entry **entries, **p;
> 1365		const struct intel_ppat_entry *entry;
  1366		unsigned int size = 0;
  1367		int i, ret;
  1368	
  1369		if (!ppat->max_entries)
  1370			return 0;
  1371	
  1372		ret = igt_ppat_check(i915);
  1373		if (ret)
  1374			return ret;
  1375	
  1376		/* case 1: perfect match */
  1377		ret = perform_perfect_match_test(ppat);
  1378		if (ret) {
  1379			pr_err("fail on perfect match test\n");
  1380			return ret;
  1381		}
  1382	
  1383		/* case 2: alloc new entries */
  1384		entries = NULL;
  1385		ret = 0;
  1386	
  1387		while (!bitmap_full(ppat->used, ppat->max_entries)) {
  1388			p = krealloc(entries, (size + 1) *
  1389					   sizeof(struct intel_ppat_entry *),
  1390					   GFP_KERNEL);
  1391			if (!p) {
  1392				ret = -ENOMEM;
  1393				goto ppat_put;
  1394			}
  1395	
  1396			entries = p;
  1397	
  1398			p = &entries[size++];
  1399			*p = NULL;
  1400	
  1401			entry = generate_and_check_new_value(ppat);
  1402			if (IS_ERR(entry)) {
  1403				ret = PTR_ERR(entry);
  1404				pr_err("fail on alloc new entries test\n");
  1405				goto ppat_put;
  1406			}
  1407			*p = entry;
  1408		}
  1409	
  1410		/* case 3: negative test 1, suppose PPAT table is full now */
  1411		ret = perform_negative_test(ppat);
  1412		if (ret) {
  1413			pr_err("fail on negative test 1\n");
  1414			goto ppat_put;
  1415		}
  1416	
  1417		/* case 4: partial match */
  1418		ret = perform_partial_match_test(ppat);
  1419		if (ret) {
  1420			pr_err("fail on partial match test\n");
  1421			goto ppat_put;
  1422		}
  1423	
  1424		/* case 3: negative test 2, suppose PPAT table is still full now */
  1425		ret = perform_negative_test(ppat);
  1426		if (ret) {
  1427			pr_err("fail on negative test 2\n");
  1428			goto ppat_put;
  1429		}
  1430	
  1431		/* case 5: re-alloc test, make a hole and it should work again */
  1432		if (entries) {
  1433			for(i = 0; i < size; i++) {
  1434				entry = entries[i];
  1435	
  1436				ret = put_and_check_entry(entry);
  1437				entries[i] = NULL;
  1438				if (ret) {
  1439					pr_err("fail on re-alloc test\n");
  1440					goto ppat_put;
  1441				}
  1442	
  1443				entry = generate_and_check_new_value(ppat);
  1444				if (IS_ERR(entry)) {
  1445					ret = PTR_ERR(entry);
  1446					pr_err("fail on re-alloc test\n");
  1447					goto ppat_put;
  1448				}
  1449				entries[i] = entry;
  1450			}
  1451		}
  1452	
  1453	ppat_put:
  1454		if (entries) {
  1455			for (i = 0; i < size; i++) {
  1456				if (IS_ERR(entries[i]) || !entries[i])
  1457					continue;
  1458	
  1459				if (ret)
  1460					intel_ppat_put(entry);
  1461				else
  1462					ret = put_and_check_entry(entries[i]);
  1463			}
  1464			kfree(entries);
  1465			entries = NULL;
  1466		}
  1467		if (ret)
  1468			return ret;
  1469	
  1470		return igt_ppat_check(i915);
  1471	}
  1472	

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

Attachment: .config.gz
Description: application/gzip

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux