All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915: Reject an attempt to create a GGTT vma larger than the GTT
Date: Thu, 19 Jan 2017 15:18:03 +0200	[thread overview]
Message-ID: <1484831883.3275.7.camel@linux.intel.com> (raw)
In-Reply-To: <20170119125847.28917-2-chris@chris-wilson.co.uk>

On to, 2017-01-19 at 12:58 +0000, Chris Wilson wrote:
> For accessing large objects through the global GTT we enforce the use of
> partial views, and sanity check that the vma->size doesn't overflow and
> fits within the address space. To prevent 4GiB triggering the assert,
> catch the attempt to create the full sized vma early.
> 
> Testcase: igt/gem_exec_reloc/gtt-32
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

<SNIP>

> @@ -3679,6 +3679,12 @@ i915_gem_object_ggtt_pin(struct drm_i915_gem_object *obj,
>  
>  	lockdep_assert_held(&obj->base.dev->struct_mutex);
>  
> +	/* Disallow a single VMA to occupy the entire GGTT, and catch any
> +	 * attempt to create a normal VMA larger than the GGTT.
> +	 */
> +	if (!view && obj->base.size >= vm->total)
> +		return ERR_PTR(-ENOSPC);

Too sloppy. How many bytes less than the full size are OK?

Change the test to be > vm->total and then it's better.

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-01-19 13:18 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 [this message]
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
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=1484831883.3275.7.camel@linux.intel.com \
    --to=joonas.lahtinen@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.