From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915: Limit the scattergather coalescing to 32bits
Date: Fri, 14 Oct 2016 16:38:35 +0100 [thread overview]
Message-ID: <bb44575e-698d-3ab0-5495-be5205063cf2@linux.intel.com> (raw)
In-Reply-To: <20161014151811.26513-2-chris@chris-wilson.co.uk>
On 14/10/2016 16:18, Chris Wilson wrote:
> The scattergather list uses a 32bit size counter, we should avoid
> exceeding it.
>
> Fixes: 871dfbd67d4e ("drm/i915: Allow compaction upto SWIOTLB max segment size")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/i915_gem.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 0d1dc04302ec..858569419134 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -2238,7 +2238,7 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj)
>
> max_segment = swiotlb_max_size();
> if (!max_segment)
> - max_segment = obj->base.size;
> + max_segment = rounddown(UINT_MAX, PAGE_SIZE);
>
> st = kmalloc(sizeof(*st), GFP_KERNEL);
> if (st == NULL)
I suppose it could be possible to get more that 4GiB of of contiguous pages.
sg_alloc_table_from_pages seems broken as well, for this, and more so,
for using longs and stuffing them into ints.
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-10-14 15:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-14 15:18 [PATCH 1/2] drm/i915: Document our internal limit on object size Chris Wilson
2016-10-14 15:18 ` [PATCH 2/2] drm/i915: Limit the scattergather coalescing to 32bits Chris Wilson
2016-10-14 15:38 ` Tvrtko Ursulin [this message]
2016-10-14 15:43 ` Chris Wilson
2016-10-14 15:45 ` Tvrtko Ursulin
2016-10-14 15:24 ` [PATCH 1/2] drm/i915: Document our internal limit on object size Chris Wilson
2016-10-14 15:43 ` Tvrtko Ursulin
2016-10-14 15:49 ` Tvrtko Ursulin
2016-10-14 16:03 ` Chris Wilson
2016-10-14 16:08 ` Chris Wilson
2016-10-14 17:50 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] " 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=bb44575e-698d-3ab0-5495-be5205063cf2@linux.intel.com \
--to=tvrtko.ursulin@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox