All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH igt] lib: Use C99 initialisers to clear context parameters
Date: Wed, 7 Mar 2018 15:06:37 +0000	[thread overview]
Message-ID: <885ebe1f-d6f7-52ee-c678-5535dfe2aa71@linux.intel.com> (raw)
In-Reply-To: <152043363042.17960.3054812213936788355@mail.alporthouse.com>


On 07/03/2018 14:40, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2018-03-07 14:36:34)
>>
>> On 07/03/2018 12:17, Chris Wilson wrote:
>>> valgrind complains we feed uninitialised stack into the CONTEXT_SETPARAM
>>> ioctl. It is unused by the kernel, but valgrind doesn't know that and
>>> it's easy enough to clear the struct to prevent the warning.
>>>
>>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>>> ---
>>>    lib/igt_gt.c | 29 ++++++++++++-----------------
>>>    1 file changed, 12 insertions(+), 17 deletions(-)
>>>
>>> diff --git a/lib/igt_gt.c b/lib/igt_gt.c
>>> index 799ca1ae..168c5a07 100644
>>> --- a/lib/igt_gt.c
>>> +++ b/lib/igt_gt.c
>>> @@ -126,11 +126,10 @@ void igt_require_hang_ring(int fd, int ring)
>>>    
>>>    static unsigned context_get_ban(int fd, unsigned ctx)
>>>    {
>>> -     struct drm_i915_gem_context_param param;
>>> -
>>> -     param.param = I915_CONTEXT_PARAM_BANNABLE;
>>> -     param.value = 0;
>>> -     param.size = 0;
>>> +     struct drm_i915_gem_context_param param = {
>>> +             .ctx_id = ctx,
>>
>> Where was this assignment before? Was it all broken as well as upsetting
>> Valgrind?
> 
> It existed only in the callers imagination. Broken is an
> overstatement, since no one varied from the defaults, i.e. the caller
> has to mix in using PARAM_BANNABLE with igt_hang_ctx.

gem_reset_stats is doing that, both with default and own context. But I 
don't feel like untangling this right now. Whatever it is supposed to 
be, if it breaks, it was broken anyway and not a fault of this patch. so:

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2018-03-07 15:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07 12:17 [igt-dev] [PATCH igt] lib: Use C99 initialisers to clear context parameters Chris Wilson
2018-03-07 12:47 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-03-07 13:48 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2018-03-07 14:36 ` [igt-dev] [PATCH igt] " Tvrtko Ursulin
2018-03-07 14:40   ` Chris Wilson
2018-03-07 15:06     ` Tvrtko Ursulin [this message]
2018-03-07 15:14       ` Chris Wilson

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=885ebe1f-d6f7-52ee-c678-5535dfe2aa71@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.