Daniele Ceraolo Spurio 95ca7644db tests/drv_hangman: test for acthd increasing through invalid VM space
The hangcheck logic will not flag an hang if acthd keeps increasing.
However, if a malformed batch jumps to an invalid offset in the ppgtt it
can potentially continue executing through the whole address space
without triggering the hangcheck mechanism.

This patch adds a test to simulate the issue. I've kept the test running
for more than 10 minutes before killing it on a BDW and no hang occurred.
I've sampled i915_hangcheck_info a few times during the run and got the
following:

Hangcheck active, fires in 468ms
render ring:
	seqno = fffff55e [current fffff55e]
	ACTHD = 0x47df685ecc [current 0x4926b81d90]
	max ACTHD = 0x47df685ecc
	score = 0
	action = 2
	instdone read = 0xffd7ffff 0xffffffff 0xffffffff 0xffffffff
	instdone accu = 0x00000000 0x00000000 0x00000000 0x00000000

Hangcheck active, fires in 424ms
render ring:
	seqno = fffff55e [current fffff55e]
	ACTHD = 0x6c953d3a34 [current 0x6de5e76fa4]
	max ACTHD = 0x6c953d3a34
	score = 0
	action = 2
	instdone read = 0xffd7ffff 0xffffffff 0xffffffff 0xffffffff
	instdone accu = 0x00000000 0x00000000 0x00000000 0x00000000

Hangcheck active, fires in 1692ms
render ring:
	seqno = fffff55e [current fffff55e]
	ACTHD = 0x1f49b0366dc [current 0x1f4dcbd88ec]
	max ACTHD = 0x1f49b0366dc
	score = 0
	action = 2
	instdone read = 0xffd7ffff 0xffffffff 0xffffffff 0xffffffff
	instdone accu = 0x00000000 0x00000000 0x00000000 0x00000000

v2: use the new gem_wait() function (Chris)

v3: switch to unterminated batch and rename test, remove redundant
    check, update test requirements (Chris), update top comment

v4: force gpu reset if the hang detection fails (Mika)

Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Arun Siluvery <arun.siluvery@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
[Mika: removed batch_len=8]
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2016-03-01 16:57:11 +02:00
..
2014-12-10 17:11:35 +00:00
2014-12-10 17:11:35 +00:00
2016-02-18 10:30:56 +00:00
2015-11-03 19:46:11 +00:00
2016-03-01 16:57:00 +02:00
2016-01-08 19:56:49 +02:00
2016-02-18 10:30:56 +00:00
2015-11-03 19:46:11 +00:00
2015-11-03 19:46:11 +00:00
2016-02-18 10:30:56 +00:00
2015-11-03 19:46:11 +00:00
2015-11-03 19:46:11 +00:00
2015-11-03 19:46:11 +00:00
2015-11-03 19:46:11 +00:00
2015-11-03 19:46:11 +00:00
2015-11-03 19:46:11 +00:00
2016-02-19 12:10:21 +02:00
2016-02-19 12:10:21 +02:00
2015-08-21 09:37:10 +01:00
2012-01-15 16:05:43 +01:00