public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: John Harrison <John.C.Harrison@Intel.com>
To: Mika Kuoppala <mika.kuoppala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Clean the request structure on alloc
Date: Fri, 05 Dec 2014 18:02:35 +0000	[thread overview]
Message-ID: <5481F33B.1070100@Intel.com> (raw)
In-Reply-To: <5481F158.7040202@Intel.com>

But yes, the reasoning why it crashes without the zero fill is correct. 
Dodgy context pointers that used to be ignored now get processed. Doing 
the zero fill keeps it all sane.

On 05/12/2014 17:54, John Harrison wrote:
> This is already part of the seqno/request patch series and has been 
> right from the start. See email 'drm/i915: Zero fill the request 
> structure'.
>
> On 05/12/2014 17:54, Mika Kuoppala wrote:
>> Otherwise we might end up referencing uninitialized fields.
>> This is apparent when we try to cleanup the preallocated request
>> on ring reset, before any request has been submitted to the ring.
>> The request->ctx is foobar and we end up freeing the foobarness.
>>
>> References: https://bugs.freedesktop.org/show_bug.cgi?id=86959
>> References: https://bugs.freedesktop.org/show_bug.cgi?id=86962
>> References: https://bugs.freedesktop.org/show_bug.cgi?id=86992
>> Cc: John Harrison <John.C.Harrison@Intel.com>
>> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
>> ---
>>   drivers/gpu/drm/i915/intel_ringbuffer.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c 
>> b/drivers/gpu/drm/i915/intel_ringbuffer.c
>> index 79b4ca5..2c6c6f8 100644
>> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
>> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
>> @@ -2030,7 +2030,7 @@ intel_ring_alloc_request(struct intel_engine_cs 
>> *ring)
>>       if (ring->outstanding_lazy_request)
>>           return 0;
>>   -    request = kmalloc(sizeof(*request), GFP_KERNEL);
>> +    request = kzalloc(sizeof(*request), GFP_KERNEL);
>>       if (request == NULL)
>>           return -ENOMEM;
>

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

  reply	other threads:[~2014-12-05 18:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05 17:54 [PATCH] drm/i915: Clean the request structure on alloc Mika Kuoppala
2014-12-05 17:54 ` John Harrison
2014-12-05 18:02   ` John Harrison [this message]
2014-12-05 20:44     ` Daniel Vetter
2014-12-05 18:09   ` Mika Kuoppala
2014-12-05 21:41 ` shuang.he

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5481F33B.1070100@Intel.com \
    --to=john.c.harrison@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox