From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Assert that the vma->fence_size doesn't overflow and wraparound
Date: Thu, 19 Jan 2017 16:40:26 +0200 [thread overview]
Message-ID: <87inpbazad.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20170119132824.6852-1-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> A large object may need an invalid fence larger than u32 and so wrap. No
> hardware can support such large fences, so it is safe to leave the check
> as an assert.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
> drivers/gpu/drm/i915/i915_vma.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> index 68e66ffb95e8..3597e3c01342 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -115,6 +115,7 @@ vma_create(struct drm_i915_gem_object *obj,
> i915_gem_object_get_tiling(obj),
> i915_gem_object_get_stride(obj));
> GEM_BUG_ON(!IS_ALIGNED(vma->fence_size, I915_GTT_MIN_ALIGNMENT));
> + GEM_BUG_ON(vma->fence_size < vma->size); /* overflow */
>
> vma->fence_alignment = i915_gem_fence_alignment(vm->i915, vma->size,
> i915_gem_object_get_tiling(obj),
> --
> 2.11.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-01-19 14:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-19 12:58 [PATCH 1/2] drm/i915: Assert the vma can fit within the address space Chris Wilson
2017-01-19 12:58 ` [PATCH 2/2] drm/i915: Reject an attempt to create a GGTT vma larger than the GTT Chris Wilson
2017-01-19 13:18 ` Joonas Lahtinen
2017-01-19 13:24 ` Chris Wilson
2017-01-19 13:04 ` [PATCH 1/2] drm/i915: Assert the vma can fit within the address space Mika Kuoppala
2017-01-19 13:10 ` Joonas Lahtinen
2017-01-19 13:28 ` [PATCH] drm/i915: Assert that the vma->fence_size doesn't overflow and wraparound Chris Wilson
2017-01-19 14:40 ` Mika Kuoppala [this message]
2017-01-19 13:31 ` [PATCH] drm/i915: Assert that created vma has a whole number of pages Chris Wilson
2017-01-19 14:41 ` Mika Kuoppala
2017-01-19 14:30 ` [PATCH 1/2] drm/i915: Assert the vma can fit within the address space Chris Wilson
2017-01-20 11:35 ` Joonas Lahtinen
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=87inpbazad.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@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.