Matthew Auld ecc4d2a52d drm/i915/userptr: fix size calculation
If we create a rather large userptr object(e.g 1ULL << 32) we might
shift past the type-width of num_pages: (int)num_pages << PAGE_SHIFT,
resulting in a totally bogus sg_table, which fortunately will eventually
manifest as:

gen8_ppgtt_insert_huge:463 GEM_BUG_ON(iter->sg->length < page_size)
kernel BUG at drivers/gpu/drm/i915/gt/gen8_ppgtt.c:463!

v2: more unsigned long
    prefer I915_GTT_PAGE_SIZE

Fixes: 5cc9ed4b9a7a ("drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20200117132413.1170563-2-matthew.auld@intel.com
(cherry picked from commit 8e78871bc1e5efec22c950d3fd24ddb63d4ff28a)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2020-01-21 09:03:00 +02:00
..
2020-01-17 05:54:18 -08:00
2020-01-16 19:42:08 -08:00
2019-12-01 18:43:25 -08:00
2019-11-30 14:35:43 -08:00
2019-12-01 18:42:02 -08:00
2020-01-04 10:41:08 -08:00
2019-12-06 08:28:51 -08:00
2019-12-03 13:58:22 -08:00
2019-12-03 14:37:12 -08:00
2020-01-18 12:08:57 -08:00
2020-01-13 18:50:18 -08:00
2019-12-01 18:43:25 -08:00
2019-12-05 11:43:31 -08:00
2019-11-25 19:40:40 -08:00
2019-12-05 11:28:14 -08:00
2020-01-06 12:04:31 -08:00
2019-12-01 18:39:24 -08:00
2020-01-18 12:12:36 -08:00
2020-01-16 19:42:08 -08:00
2020-01-06 12:34:44 -08:00
2019-12-27 17:28:41 -08:00
2020-01-17 19:40:06 +01:00
2019-12-07 14:51:04 -08:00
2019-12-03 13:58:22 -08:00
2019-11-14 13:06:33 +08:00
2019-12-21 06:24:56 -08:00