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 <[email protected]>

<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 <[email protected]>

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

Reply via email to