Bug 90808

Summary: [BDW Bisected]igt/gem_ctx_param_basic/invalid-param-get fails
Product: DRI Reporter: lu hua <huax.lu>
Component: DRM/IntelAssignee: David Weinehall <david.weinehall>
Status: CLOSED WORKSFORME QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: high CC: christophe.prigent, intel-gfx-bugs
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: BDW i915 features: GEM/Other
Attachments:
Description Flags
dmesg
none
Improved tests for context parameters
none
Updated version of the patch. none

Description lu hua 2015-06-02 03:07:02 UTC
Created attachment 116226 [details]
dmesg

==System Environment==
--------------------------
Regression: yes

good commit: drm-intel-next-queued/d0bc54f2f012d8c8c3b4315f51f408ff3d938031
bad commit: drm-intel-next-queued/a2ee48d60eed9cfb6447a4233370aee4ea88108b

Non-working platforms:  BDW

==kernel==
--------------------------
drm-intel-nightly/4b2be843fab906467eed62265f5066418c73649c
commit 4b2be843fab906467eed62265f5066418c73649c
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri May 29 19:28:41 2015 +0200

    drm-intel-nightly: 2015y-05m-29d-17h-28m-04s UTC integration manifest

==Bug detailed description==
-----------------------------
It fails on BDW with drm-intel-nightly and drm-intel-next-queued branch.
gem_ctx_param_basic@invalid-param-set also fails.

output:
IGT-Version: 1.10-g9b0a32d (x86_64) (Linux: 4.1.0-rc5_drm-intel-nightly_4b2be8_20150530+ x86_64)
Test assertion failure function __real_main49, file gem_ctx_param_basic.c:105:
Failed assertion: drmIoctl(fd, ((((2U|1U) << (((0+8)+8)+14)) | ((('d')) << (0+8)) | (((0x40 + 0x34)) << 0) | ((((sizeof(struct local_i915_gem_context_param)))) << ((0+8)+8)))), &ctx_param) < 0 && errno == 22
Stack trace:
  #0 [__igt_fail_assert+0xf1]
  #1 [__real_main49+0x5d7]
  #2 [main+0x21]
  #3 [__libc_start_main+0xf5]
  #4 [_start+0x29]
  #5 [<unknown>+0x29]
Subtest invalid-param-get failed.
**** DEBUG ****
Test assertion failure function __real_main49, file gem_ctx_param_basic.c:105:
Failed assertion: drmIoctl(fd, ((((2U|1U) << (((0+8)+8)+14)) | ((('d')) << (0+8)) | (((0x40 + 0x34)) << 0) | ((((sizeof(struct local_i915_gem_context_param)))) << ((0+8)+8)))), &ctx_param) < 0 && errno == 22
****  END  ****
Subtest invalid-param-get: FAIL (0.003s)


==Reproduce steps==
---------------------------- 
1.  ./gem_ctx_param_basic --run-subtest invalid-param-get
Comment 1 Ander Conselvan de Oliveira 2015-06-02 06:43:36 UTC
Please bisect.
Comment 2 Chris Wilson 2015-06-02 09:10:47 UTC
commit f86cc198b4f9a631f96167219cb8460ce517ca0a
Author: David Weinehall <david.weinehall@linux.intel.com>
Date:   Wed May 20 17:00:13 2015 +0300

    drm/i915: add a context parameter to {en, dis}able zero address mapping


Just igt's negative testing requires updating.
Comment 3 lu hua 2015-06-08 02:17:41 UTC
(In reply to Chris Wilson from comment #2)
> commit f86cc198b4f9a631f96167219cb8460ce517ca0a
> Author: David Weinehall <david.weinehall@linux.intel.com>
> Date:   Wed May 20 17:00:13 2015 +0300
> 
>     drm/i915: add a context parameter to {en, dis}able zero address mapping
> 
> 
> Just igt's negative testing requires updating.

I confirmed this commit is the first bad commit.
commit b1b38278e12b04cf9a227f6af2c24651cf6e8a85
Author:     David Weinehall <david.weinehall@linux.intel.com>
AuthorDate: Wed May 20 17:00:13 2015 +0300
Commit:     Daniel Vetter <daniel.vetter@ffwll.ch>
CommitDate: Fri May 29 10:15:19 2015 +0200

    drm/i915: add a context parameter to {en, dis}able zero address mapping

    Export a new context parameter that can be set/queried through the
    context_{get,set}param ioctls.  This parameter is passed as a context
    flag and decides whether or not a GPU address mapping is allowed to
    be made at address zero.  The default is to allow such mappings.

    Signed-off-by: David Weinehall <david.weinehall@intel.com>
    Acked-by: "Zou, Nanhai" <nanhai.zou@intel.com>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Comment 4 Jesse Barnes 2015-08-06 20:27:13 UTC
Fixed in igt:

commit 0b45b0746f45deea11670a8b2c949776bbbef55c
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Thu Aug 6 13:12:46 2015 -0700

    tests/gem_ctx_param_basic: fix invalid params
    
    Use -1 as the invalid param since we've added more since this test was
    created, causing expected EINVAL failures to return an unexpected error
    code.
Comment 5 Jesse Barnes 2015-08-06 21:34:46 UTC
Re-opening and assigning to David.
Comment 6 David Weinehall 2015-08-07 12:20:05 UTC
Created attachment 117577 [details] [review]
Improved tests for context parameters
Comment 7 David Weinehall 2015-08-07 12:21:02 UTC
@Jesse: What about the fix in commit 0b45b0746f45deea11670a8b2c949776bbbef55c you refer to? Have you reverted that one, or did you never push it?

Anyway, I have a version of this test that includes tests for no-zeromap too, it's been sitting on my system for quite a while.  I don't remember why I haven't submitted it to intel-gfx; possibly because the flux around the no-zeromap patch itself.

I've attached the patch here, I'll submit it to intel-gfx too.
Comment 8 David Weinehall 2015-08-10 08:30:26 UTC
Created attachment 117603 [details] [review]
Updated version of the patch.
Comment 9 Elio 2016-03-17 17:30:56 UTC
The test is working without issues, following configuration:

--- Software information ---

 ++ Kernel version                      : 4.4.4-040404-generic
 ++ Linux distribution                  : Ubuntu 15.10
 ++ Architecture                        : 64-bit
 
 ++ xf86-video-intel version            : 2.99.917
 ++ Xorg-Xserver version                : 1.17.2
 ++ DRM version                         : 2.4.64
 ++ VAAPI version                       : Intel i965 driver for Intel(R) Broadwell - 1.6.0
 ++ Cairo version                       : 1.14.2
 ++ Intel GPU Tools version             : Tag [intel-gpu-tools-1.14-74-g431f6c4] / Commit [431f6c4]
 ++ Kernel driver in use                : i915
 ++ Bios revision                       : 5.6


 --- Hardware information ---

 ++ Platform                            :
 ++ Motherboard model                   :
 ++ Motherboard type                    : NUC5i7RYB Desktop
 ++ Motherboard manufacturer            :
 ++ CPU family                          : Core i7
 ++ CPU information                     : Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz
 ++ GPU Card                            : Intel Corporation Broadwell-U Integrated Graphics (rev 09) (prog-if 00 [VGA controller])
 ++ Memory ram                          : 8 GB
 ++ Maximum memory ram allowed          : 16 GB
 ++ Display resolution                  :
 ++ CPU's number                        : 4
 ++ Hard drive capacity                 : 120 GB

Output:
 ./gem_ctx_param_basic --run-subtest invalid-param-get
IGT-Version: 1.14-g431f6c4 (x86_64) (Linux: 4.4.4-040404-generic x86_64)
Subtest invalid-param-get: SUCCESS (0.000s)

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.