Re: [Intel-gfx] [PATCH] drm/i915: return DRIVER_NAME for the fence driver name

2021-06-22 Thread Mason, Michael W
This fixes the NULL pointer dereference in i915_fence_get_driver_name(), 
but now it crashes in i915_fence_get_timeline with another NULL pointer
dereference. It attempts to use i915_gem_context.name, which apparently
also hasn't been initialized

static const char *i915_fence_get_timeline_name(struct dma_fence *fence)
{
const struct i915_gem_context *ctx;

/*
 * The timeline struct (as part of the ppgtt underneath a context)
 * may be freed when the request is no longer in use by the GPU.
 * We could extend the life of a context to beyond that of all
 * fences, possibly keeping the hw resource around indefinitely,
 * or we just give them a false name. Since
 * dma_fence_ops.get_timeline_name is a debug feature, the occasional
 * lie seems justifiable.
 */
if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, >flags))
return "signaled";

ctx = i915_request_gem_context(to_request(fence));
if (!ctx)
return "[" DRIVER_NAME "]";

return ctx->name;
}

<1>[  414.327761] BUG: kernel NULL pointer dereference, address: 
0020
<1>[  414.327766] #PF: supervisor read access in kernel mode
<1>[  414.327768] #PF: error_code(0x) - not-present page
<6>[  414.327769] PGD 0 P4D 0
<4>[  414.327772] Oops:  [#1] PREEMPT SMP NOPTI
<4>[  414.327774] CPU: 3 PID: 1866 Comm: chrome Tainted: G U
5.4.125 #2
<4>[  414.327776] Hardware name: Google Voxel/Voxel, BIOS 
Google_Voxel.13913.0.0 04/12/2021
<4>[  414.327781] RIP: 0010:i915_fence_get_timeline_name+0x1d/0x37
<4>[  414.327783] Code: 55 48 89 e5 48 c7 c0 ee d1 72 bd 5d c3 0f 1f 44 00 00 
55 48 89 e5 48 8b 4f 30 48 c7 c0 b4 49 72 bd f6 c1 01 75 1c 48 8b 47 60 <48> 8b 
40 20 48 85 c0 74 08 48 05 30 01 00 00 eb 07 48 c7 c0 79 7b
<4>[  414.327785] RSP: 0018:a4a300d177b8 EFLAGS: 00010246
<4>[  414.327787] RAX:  RBX: bd7a8680 RCX: 

<4>[  414.327788] RDX: 9c27b3b0f4c0 RSI: 9c27b3b0f480 RDI: 
9c27b3b0f480
<4>[  414.327789] RBP: a4a300d177b8 R08:  R09: 
0004
<4>[  414.327791] R10: 0001 R11: bca45536 R12: 
0005
<4>[  414.327792] R13: 0004 R14: 9c27b6c79bb0 R15: 
9c27b3b0f480
<4>[  414.327794] FS:  7898a2965e00() GS:9c27b7f8() 
knlGS:
<4>[  414.327795] CS:  0010 DS:  ES:  CR0: 80050033
<4>[  414.327797] CR2: 0020 CR3: 00022ded2006 CR4: 
00762ee0
<4>[  414.327798] PKRU: 5554
<4>[  414.327799] Call Trace:
<4>[  414.327804]  trace_event_raw_event_dma_fence+0xc9/0x1e5
<4>[  414.327807]  dma_fence_init+0xa6/0xca
<4>[  414.327809]  __i915_request_ctor+0x7f/0xa9
<4>[  414.327812]  setup_object+0x88/0x8a
<4>[  414.327815]  new_slab+0x22e/0x429
<4>[  414.327817]  ___slab_alloc+0x2c8/0x42e
<4>[  414.327820]  ? __i915_request_create+0x68/0x238
<4>[  414.327822]  ? __i915_request_create+0x68/0x238
<4>[  414.327824]  __slab_alloc+0x3c/0x5f
<4>[  414.327826]  kmem_cache_alloc+0x19b/0x201
<4>[  414.327828]  __i915_request_create+0x68/0x238
<4>[  414.327830]  i915_request_create+0x8a/0xca
<4>[  414.327833]  i915_gem_do_execbuffer+0x12f9/0x1830
<4>[  414.327837]  i915_gem_execbuffer2_ioctl+0x157/0x398
<4>[  414.327839]  ? i915_gem_do_execbuffer+0x1830/0x1830
<4>[  414.327840]  drm_ioctl_kernel+0x94/0xf6
<4>[  414.327842]  drm_ioctl+0x276/0x39b
<4>[  414.327845]  ? i915_gem_do_execbuffer+0x1830/0x1830
<4>[  414.327847]  do_vfs_ioctl+0x4f4/0x771
<4>[  414.327849]  ksys_ioctl+0x58/0x83
<4>[  414.327851]  __x64_sys_ioctl+0x1a/0x1e
<4>[  414.327853]  do_syscall_64+0x54/0x7e
<4>[  414.327856]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
<4>[  414.327859] RIP: 0033:0x7898a2f88f07

> -Original Message-
> From: Auld, Matthew 
> Sent: Wednesday, June 16, 2021 5:29 AM
> To: intel-gfx@lists.freedesktop.org
> Cc: dri-de...@lists.freedesktop.org; Mason, Michael W
> ; Daniel Vetter 
> Subject: [PATCH] drm/i915: return DRIVER_NAME for the fence driver name
> 
> The first tracepoint for a request is trace_dma_fence_init which is called in
> the ctor before we have properly setup the request->engine. So if it's a non-
> recycled request the rq->engine might be NULL, or some garbage value,
> which leads to a crash.
> 
> Since we are not permitted to use kmem_cache_zalloc() here with
> SLAB_TYPESAFE_BY_RCU, one approach is simply to return DRIVER_NAME.
> We can then revisit this later if we decide to get rid of
> SLAB_TYPESAFE_BY_RCU.
> 
> Fixes: 855e39e65cfc ("drm/i915: Initialise basic fence before acquiring
> seqno")
> Signed-off

Re: [Intel-gfx] [QA 2015/07/17 ww30] Testing report for `drm-intel-testing`

2015-07-31 Thread Mason, Michael W
Why are so many IGT tests blacklisted?  How does a test get put on the 
blacklist?  We've been running the full (almost) IGT suite on Chrome OS. Our 
blacklist has around 46 tests, mainly for tests that timeout, hang the system 
and don't reboot, or cause a reboot in the middle of the test. I'm wondering if 
there's some other criteria we should consider.

Thanks,
Mike


From: Intel-gfx [intel-gfx-boun...@lists.freedesktop.org] on behalf of 
christophe.prig...@linux.intel.com [christophe.prig...@linux.intel.com]
Sent: Saturday, July 25, 2015 7:53 AM
To: vet...@linux.intel.com; Vetter, Daniel
Cc: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [QA 2015/07/17 ww30] Testing report for `drm-intel-testing`

Hello,

We launched Intel GPU Tools on 6 platforms: Skylake-Y, Braswell-M,
Broadwell-U, Baytrail M and T, Haswell-ULT to validate kernel 4.12-rc2 tag
drm-intel-testing-2015-07-17.
Here are the results:

New bugs reported:

https://bugs.freedesktop.org/show_bug.cgi?id=91447 [BSW-BDW-U]
igt/kms_frontbuffer_tracking
https://bugs.freedesktop.org/show_bug.cgi?id=91349 [BSW-BYT-M]
igt/gem_eio/throttle result is crash
https://bugs.freedesktop.org/show_bug.cgi?id=91453 [BYT-M]
igt/gem_eio/execbuf result is crash
https://bugs.freedesktop.org/show_bug.cgi?id=91439 [byt]
igt/drv_module_reload not set to timeout (Asus T100 TA)
https://bugs.freedesktop.org/show_bug.cgi?id=91454 [hsw] igt/
gem_render_linear_blits@swap-thrash test is timing out
https://bugs.freedesktop.org/show_bug.cgi?id=91455 [hsw] igt/
gem_reloc_vs_gpu@forked-interruptible-faulting-reloc-thrash-inactive-hang
not set to time out (NUC)

Test Environment:

kernel 4.2-rc2 from git://anongit.freedesktop.org/drm-intel tag
drm-intel-testing-2015-07-17
Mesa: mesa-10.6.2 from http://cgit.freedesktop.org/mesa/mesa/
Xf86_video_intel: 2.99.917 from
http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/
Libdrm: libdrm-2.4.62 from http://cgit.freedesktop.org/mesa/drm/
Cairo: 1.14.2 from http://cgit.freedesktop.org/cairo
libva: libva-1.6.0 from http://cgit.freedesktop.org/libva/
intel-driver: 1.6.0 from http://cgit.freedesktop.org/vaapi/intel-driver
xorg: 1.17.99 installed with script git_xorg.sh
Xserver: xorg-server-1.17.2 from http://cgit.freedesktop.org/xorg/xserver
Intel-gpu-tools: 1.11 8ad1e4077879a111f341dbfd2e0fee84efc9f57e from
http://cgit.freedesktop.org/xorg/app/intel-gpu-tools/

Results:

Platform| Available | Blacklisted   | Skipped   | Executed  
| % Pass| % Exe
--
SKL | 5756  | 4029  | 145   | 1582  
| 19.53%| 91.60%
BSW | 5756  | 3882  | 178   | 1696  
| 44.22%| 90.50%
BDW-U   | 5756  | 4017  | 149   | 1590  
| 56.86%| 91.43%
BYT-T   | 5756  | 3851  | 972   | 933   
| 65.70%| 48.98%
BYT-M   | 5756  | 3851  | 661   | 1244  
| 72.03%| 65.30%
HSW-U   | 5763  | 3806  | 806   | 1151  
| 86.27%| 58.81%
--

Last week results:

Platform| Total | Executed  | Pass  | % Executed| % Pass
-
SKL | 1745  | 1644  | 276   | 94.21%| 16.79%
BSW | 1887  | 1087  | 855   | 57.60%| 78.66%
BDW-U   | 1755  | 1614  | 1063  | 91.97%| 65.86%
BYT-T   | 1920  | 1472  | 736   | 76.67%| 50.00%
BYT-M   | 1920  | 1840  | 322   | 95.83%| 17.50%
HSW-U   | 1894  | 1714  | 1275  | 90.50%| 74.39%
-

Known bugs:

SKL
https://bugs.freedesktop.org/show_bug.cgi?id=89959
[SKL]igt/gem_concurrent_blit subcase sporadically causes system hang and
*ERROR* blitter: timed out waiting for forcewake ack to clear.
https://bugs.freedesktop.org/show_bug.cgi?id=89728 [HSW/BDW/BSW/SKL
bisected] igt/pm_rps/ subcases reset and blocking fail
https://bugs.freedesktop.org/show_bug.cgi?id=89928
[SKL]igt/gem_evict_everything/forked-mempressure-interruptible takes more
than 10 minutes
https://bugs.freedesktop.org/show_bug.cgi?id=90546 [BDW/BSW/SKL
bisected]igt/pm_rpm/drm-resources-equal fails
https://bugs.freedesktop.org/show_bug.cgi?id=86763 [BSW/SKL]igt/kms_plane
some 

Re: [Intel-gfx] [PATCH i-g-t] scripts/run-tests.sh: Allow adding excluded tests on resume

2015-05-27 Thread Mason, Michael W
Abandoning this patch because the piglit patch on which it depends was not 
accepted. I will submit a new patch that uses the approved piglit change.

From: Mason, Michael W
Sent: Monday, May 18, 2015 2:59 PM
To: intel-gfx@lists.freedesktop.org
Cc: Mason, Michael W
Subject: [PATCH i-g-t] scripts/run-tests.sh: Allow adding excluded tests on 
resume

The following piglit patch allows additional excluded tests
to be specified when resuming a test run:

http://lists.freedesktop.org/archives/piglit/2015-May/016032.html

This patch allows run-tests.sh to take advantage of that. Of course,
it won't work until the piglit patch is merged.

Signed-off-by: Mike Mason michael.w.ma...@intel.com
---
 scripts/run-tests.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh
index 5f83dcf..d289466 100755
--- a/scripts/run-tests.sh
+++ b/scripts/run-tests.sh
@@ -116,7 +116,7 @@ if [ ! -x $PIGLIT ]; then
 fi

 if [ x$RESUME != x ]; then
-   sudo IGT_TEST_ROOT=$IGT_TEST_ROOT $PIGLIT resume $RESULTS
+   sudo IGT_TEST_ROOT=$IGT_TEST_ROOT $PIGLIT resume $RESULTS $EXCLUDE
 else
mkdir -p $RESULTS
sudo IGT_TEST_ROOT=$IGT_TEST_ROOT $PIGLIT run igt $RESULTS 
$VERBOSE $EXCLUDE $FILTER
--
2.1.0

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] gem_tiled_fence_blits and OOM

2015-04-14 Thread Mason, Michael W
We're running i-g-t on Chrome OS and seeing gem_tiled_fence_blits failures.  
More specifically, the test is getting killed by the OOM killer, sometimes 
leading to hangs and reboots.  This happens consistently when the UI is 
running.  When the UI is stopped, the test passes.  This makes sense since 
there's more memory available.

I noticed the test uses intel_get_total_ram_mb() in the calculation that 
determines how many buffers to allocate.  Excuse the perhaps naïve question, 
but shouldn't that be intel_get_avail_ram_mb()?  When I change the test to use 
that call it passes consistently with no OOM issues. I realize that might be 
the wrong fix.  I just want to understand why.

Thanks,
Mike Mason
Chrome OS Validation Engineer
SSG/OTC - Open Source Technology Center

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t 1/1] Add kms_flip_event_leak to .gitignore

2014-08-15 Thread Mason, Michael W
This patch just adds kms_flip_event_leak to tests/.gitignore.

Signed-off-by: Mike Mason michael.w.ma...@intel.com
---
 tests/.gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/.gitignore b/tests/.gitignore index d14d87b..3da061e 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -121,6 +121,7 @@ kms_cursor_crc
 kms_fbc_crc
 kms_fence_pin_leak
 kms_flip
+kms_flip_event_leak
 kms_flip_tiling
 kms_force_connector
 kms_mmio_vs_cs_flip
--
1.9.1
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t 1/1] scripts: Allow multiple -t and -x regular expressions for run-tests.sh

2014-08-15 Thread Mason, Michael W
Piglit allows multiple -t and -x regular expressions to be
given on the command line. This patch enables run-tests.sh to
support that as well.

Signed-off-by: Mike Mason michael.w.ma...@intel.com
---
 scripts/run-tests.sh | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh
index cf77473..d0e0c67 100755
--- a/scripts/run-tests.sh
+++ b/scripts/run-tests.sh
@@ -55,8 +55,10 @@ function print_help {
echo   (default: $RESULTS)
echo   -s  create html summary
echo   -t regex  only include tests that match the regular 
expression
+   echo   (can be used more than once)
echo   -v  enable verbose mode
echo   -x regex  exclude tests that match the regular expression
+   echo   (can be used more than once)
echo 
echo Useful patterns for test filtering are described in 
tests/NAMING-CONVENTION
 }
@@ -78,9 +80,9 @@ while getopts :dhlr:st:vx: opt; do
l) list_tests; exit ;;
r) RESULTS=$OPTARG ;;
s) SUMMARY=html ;;
-   t) FILTER=-t $OPTARG ;;
+   t) FILTER=$FILTER -t $OPTARG ;;
v) VERBOSE=-v ;;
-   x) EXCLUDE=-x $OPTARG ;;
+   x) EXCLUDE=$EXCLUDE -x $OPTARG ;;
:)
echo Option -$OPTARG requires an argument.
exit 1
-- 
1.9.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t 1/1] tests: Fix seg fault when gem_mmap is run without specifying a subtest

2014-08-15 Thread Mason, Michael W
From: Mike Mason michael.w.ma...@intel.com

gem_mmap seg faults when all tests are run together. This occurs because
the new-object subtest closes the gem object, but short-mmap assumes
it still exists. Thus gem_mmap__cpu() returns nil for addr and memset()
seg faults. This patch makes new-object and short-mmap create and
close their own gem objects.

Signed-off-by: Mike Mason michael.w.ma...@intel.com
---
 tests/gem_mmap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/gem_mmap.c b/tests/gem_mmap.c
index 334bd76..33ffe45 100644
--- a/tests/gem_mmap.c
+++ b/tests/gem_mmap.c
@@ -62,10 +62,8 @@ igt_main
igt_assert(ret == -1  errno == ENOENT);
}

-   igt_fixture
-   handle = gem_create(fd, OBJECT_SIZE);
-
igt_subtest(new-object) {
+   handle = gem_create(fd, OBJECT_SIZE);
arg.handle = handle;
arg.offset = 0;
arg.size = OBJECT_SIZE;
@@ -94,9 +92,11 @@ igt_main

igt_subtest(short-mmap) {
igt_assert(OBJECT_SIZE  4096);
+   handle = gem_create(fd, OBJECT_SIZE);
addr = gem_mmap__cpu(fd, handle, 4096, PROT_WRITE);
memset(addr, 0, 4096);
munmap(addr, 4096);
+   gem_close(fd, handle);
}

igt_fixture
-- 
1.9.1
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx