[Intel-gfx] [PATCH] drm/i915: Store device pointer in contexts for late tracepoint usafe

Jani Nikula jani.nikula at linux.intel.com
Mon Jun 29 04:49:39 PDT 2015


On Mon, 29 Jun 2015, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> On Mon, Jun 29, 2015 at 02:40:15PM +0300, Jani Nikula wrote:
>> On Thu, 07 May 2015, Chris Wilson <chris at chris-wilson.co.uk> wrote:
>> > On Wed, May 06, 2015 at 01:16:30PM +0200, Daniel Vetter wrote:
>> >> On Tue, May 05, 2015 at 09:17:29AM +0100, Chris Wilson wrote:
>> >> > [ 1572.417121] BUG: unable to handle kernel NULL pointer dereference at           (null)
>> >> > [ 1572.421010] IP: [<ffffffffa00b2514>] ftrace_raw_event_i915_context+0x5d/0x70 [i915]
>> >> > [ 1572.424970] PGD 1766a3067 PUD 1767a2067 PMD 0
>> >> > [ 1572.428892] Oops: 0000 [#1] SMP
>> >> > [ 1572.432787] Modules linked in: ipv6 dm_mod iTCO_wdt iTCO_vendor_support snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_controller snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_timer snd soundcore serio_raw pcspkr lpc_ich i2c_i801 mfd_core battery ac acpi_cpufreq i915 button video drm_kms_helper drm
>> >> > [ 1572.441720] CPU: 2 PID: 18853 Comm: kworker/u8:0 Not tainted 4.0.0_kcloud_3f0360_20150429+ #588
>> >> > [ 1572.446298] Workqueue: i915 i915_gem_retire_work_handler [i915]
>> >> > [ 1572.450876] task: ffff880002f428f0 ti: ffff880035724000 task.ti: ffff880035724000
>> >> > [ 1572.455557] RIP: 0010:[<ffffffffa00b2514>]  [<ffffffffa00b2514>] ftrace_raw_event_i915_context+0x5d/0x70 [i915]
>> >> > [ 1572.460423] RSP: 0018:ffff880035727ce8  EFLAGS: 00010286
>> >> > [ 1572.465262] RAX: ffff880073f1643c RBX: ffff880002da9058 RCX: ffff880073e5db40
>> >> > [ 1572.470179] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff880035727ce8
>> >> > [ 1572.475107] RBP: ffff88007bb11a00 R08: 0000000000000000 R09: 0000000000000000
>> >> > [ 1572.480034] R10: 0000000000362200 R11: 0000000000000008 R12: 0000000000000000
>> >> > [ 1572.484952] R13: ffff880035727d78 R14: ffff880002dc1c98 R15: ffff880002dc1dc8
>> >> > [ 1572.489886] FS:  0000000000000000(0000) GS:ffff88017fd00000(0000) knlGS:0000000000000000
>> >> > [ 1572.494883] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
>> >> > [ 1572.499859] CR2: 0000000000000000 CR3: 000000017572a000 CR4: 00000000001006e0
>> >> > [ 1572.504842] Stack:
>> >> > [ 1572.509834]  ffff88017b0090c0 ffff880073f16438 ffff880002da9058 ffff880073f1643c
>> >> > [ 1572.514904]  0000000000000246 ffff880100000000 ffff88007bb11a00 ffff880002ddeb10
>> >> > [ 1572.519985]  ffff8801759f79c0 ffffffffa0092ff0 0000000000000000 ffff88007bb11a00
>> >> > [ 1572.525049] Call Trace:
>> >> > [ 1572.530093]  [<ffffffffa0092ff0>] ? i915_gem_context_free+0xa8/0xc1 [i915]
>> >> > [ 1572.535227]  [<ffffffffa009b969>] ? i915_gem_request_free+0x4e/0x50 [i915]
>> >> > [ 1572.540347]  [<ffffffffa00b5533>] ? intel_execlists_retire_requests+0x14c/0x159 [i915]
>> >> > [ 1572.545500]  [<ffffffffa009d9ea>] ? i915_gem_retire_requests+0x9d/0xeb [i915]
>> >> > [ 1572.550664]  [<ffffffffa009dd8c>] ? i915_gem_retire_work_handler+0x4c/0x61 [i915]
>> >> > [ 1572.555825]  [<ffffffff8104ca7f>] ? process_one_work+0x1b2/0x31d
>> >> > [ 1572.560951]  [<ffffffff8104d278>] ? worker_thread+0x24d/0x339
>> >> > [ 1572.566033]  [<ffffffff8104d02b>] ? cancel_delayed_work_sync+0xa/0xa
>> >> > [ 1572.571140]  [<ffffffff81050b25>] ? kthread+0xce/0xd6
>> >> > [ 1572.576191]  [<ffffffff81050a57>] ? kthread_create_on_node+0x162/0x162
>> >> > [ 1572.581228]  [<ffffffff8179b3c8>] ? ret_from_fork+0x58/0x90
>> >> > [ 1572.586259]  [<ffffffff81050a57>] ? kthread_create_on_node+0x162/0x162
>> >> > [ 1572.591318] Code: de 48 89 e7 e8 09 4d 00 e1 48 85 c0 74 27 48 89 68 10 48 8b 55 38 48 89 e7 48 89 50 18 48 8b 55 10 48 8b 12 48 8b 12 48 8b 52 38 <8b> 12 89 50 08 e8 95 4d 00 e1 48 83 c4 30 5b 5d 41 5c c3 41 55
>> >> > [ 1572.596981] RIP  [<ffffffffa00b2514>] ftrace_raw_event_i915_context+0x5d/0x70 [i915]
>> >> > [ 1572.602464]  RSP <ffff880035727ce8>
>> >> > [ 1572.607911] CR2: 0000000000000000
>> >> > 
>> >> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90112#c23
>> >> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
>> >> 
>> >> Could we do an igt for this, maybe using the sysfs trace interface?
>> >
>> > I wonder if it is as simple as:
>> >
>> > tracefs=/sys/kernel/tracing
>> >
>> > function set_tracing {
>> > 	for i in `find $tracefs/i915 -name enable`; do $i
>> > 		echo $1 > $i
>> > 	done
>> > 	echo $1 > $tracefs/enable
>> > }
>> >
>> > set_tracing 1
>> >
>> > ./gem_ctx_basic
>> > ./gem_foo_basic
>> > ./gem_bar_basic
>> > ./gem_baz_basic
>> >
>> > set_tracing 0
>> 
>> Is the patch still valid?
>
> Yes.

I could use some review here....


> -Chris
>
> -- 
> Chris Wilson, Intel Open Source Technology Centre

-- 
Jani Nikula, Intel Open Source Technology Center


More information about the Intel-gfx mailing list