From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v30 4/5] drm/i915: Expose RPCS (SSEU) configuration to userspace (Gen11 only)
Date: Thu, 31 Jan 2019 09:34:03 +0000 [thread overview]
Message-ID: <29dc943c-5948-51b0-6555-44d22cff7744@linux.intel.com> (raw)
In-Reply-To: <154892612583.14784.8937255877792138080@skylake-alporthouse-com>
On 31/01/2019 09:15, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2019-01-31 08:47:37)
>> + /*
>> + * Some future proofing on the types since the uAPI is wider than the
>> + * current internal implementation.
>> + */
>> + if (WARN_ON((fls(user->slice_mask) >
>> + sizeof(context->slice_mask) * BITS_PER_BYTE) ||
>> + (fls(user->subslice_mask) >
>> + sizeof(context->subslice_mask) * BITS_PER_BYTE) ||
>> + overflows_type(user->min_eus_per_subslice,
>> + context->min_eus_per_subslice) ||
>> + overflows_type(user->max_eus_per_subslice,
>> + context->max_eus_per_subslice)))
>
> fls(0) is not well-defined, so
>
> if (order_base_2(user->slice_mask) > BITS_PER_TYPE(context->slice_mask))
> return -EINVAL;
>
> etc
>
> Don't WARN_ON() for user controlled variables.
Looks I was thinking it is not user controllable eg. was supposed to be
the reminder of a too narrow internal type. But that is obviously not
true.. Also not sure why I did not use overflows_type for all.
Thanks,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-01-31 9:33 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-30 9:34 [PATCH 0/5] Per context dynamic (sub)slice power-gating Tvrtko Ursulin
2019-01-30 9:34 ` [PATCH 1/5] drm/i915: Record the sseu configuration per-context & engine Tvrtko Ursulin
2019-01-30 9:40 ` Chris Wilson
2019-01-30 9:56 ` Tvrtko Ursulin
2019-01-30 10:14 ` [PATCH v16 " Tvrtko Ursulin
2019-01-30 9:34 ` [PATCH 2/5] drm/i915/perf: lock powergating configuration to default when active Tvrtko Ursulin
2019-01-30 9:34 ` [PATCH 3/5] drm/i915: Add timeline barrier support Tvrtko Ursulin
2019-01-30 9:34 ` [PATCH 4/5] drm/i915: Expose RPCS (SSEU) configuration to userspace (Gen11 only) Tvrtko Ursulin
2019-01-30 9:45 ` Chris Wilson
2019-01-30 9:59 ` Tvrtko Ursulin
2019-01-30 10:15 ` [PATCH v29 " Tvrtko Ursulin
2019-01-31 8:47 ` [PATCH v30 " Tvrtko Ursulin
2019-01-31 9:15 ` Chris Wilson
2019-01-31 9:34 ` Tvrtko Ursulin [this message]
2019-01-31 10:47 ` [PATCH v31 " Tvrtko Ursulin
2019-01-31 10:59 ` Chris Wilson
2019-01-31 11:46 ` Joonas Lahtinen
2019-01-30 9:34 ` [PATCH 5/5] drm/i915/selftests: Context SSEU reconfiguration tests Tvrtko Ursulin
2019-01-30 9:47 ` ✗ Fi.CI.CHECKPATCH: warning for Per context dynamic (sub)slice power-gating (rev21) Patchwork
2019-01-30 9:50 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-01-30 10:12 ` ✓ Fi.CI.BAT: success " Patchwork
2019-01-30 11:12 ` ✗ Fi.CI.CHECKPATCH: warning for Per context dynamic (sub)slice power-gating (rev23) Patchwork
2019-01-30 11:15 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-01-30 11:31 ` ✗ Fi.CI.IGT: failure for Per context dynamic (sub)slice power-gating (rev21) Patchwork
2019-01-30 11:45 ` ✓ Fi.CI.BAT: success for Per context dynamic (sub)slice power-gating (rev23) Patchwork
2019-01-30 13:12 ` ✗ Fi.CI.CHECKPATCH: warning for Per context dynamic (sub)slice power-gating (rev24) Patchwork
2019-01-30 13:15 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-01-30 13:34 ` ✓ Fi.CI.BAT: success " Patchwork
2019-01-30 13:52 ` ✗ Fi.CI.CHECKPATCH: warning for Per context dynamic (sub)slice power-gating (rev25) Patchwork
2019-01-30 13:55 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-01-30 14:14 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-01-30 16:23 ` ✗ Fi.CI.CHECKPATCH: warning for Per context dynamic (sub)slice power-gating (rev26) Patchwork
2019-01-30 16:26 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-01-30 16:45 ` ✓ Fi.CI.BAT: success " Patchwork
2019-01-30 20:51 ` ✓ Fi.CI.IGT: " Patchwork
2019-01-31 7:25 ` Tvrtko Ursulin
2019-01-31 7:30 ` Chris Wilson
2019-01-31 8:26 ` ✗ Fi.CI.CHECKPATCH: warning for Per context dynamic (sub)slice power-gating (rev27) Patchwork
2019-01-31 8:29 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-01-31 8:48 ` ✓ Fi.CI.BAT: success " Patchwork
2019-01-31 9:49 ` ✗ Fi.CI.CHECKPATCH: warning for Per context dynamic (sub)slice power-gating (rev28) Patchwork
2019-01-31 9:51 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-01-31 10:14 ` ✓ Fi.CI.BAT: success " Patchwork
2019-01-31 11:11 ` ✗ Fi.CI.CHECKPATCH: warning for Per context dynamic (sub)slice power-gating (rev29) Patchwork
2019-01-31 11:14 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-01-31 11:32 ` ✓ Fi.CI.BAT: success " Patchwork
2019-01-31 21:49 ` ✓ Fi.CI.IGT: " Patchwork
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=29dc943c-5948-51b0-6555-44d22cff7744@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=chris@chris-wilson.co.uk \
/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