public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Michel Thierry <michel.thierry@intel.com>
Cc: intel-gfx@lists.freedesktop.org, artur.harasimiuk@intel.com
Subject: Re: [PATCH] drm/i915/gen9: Set PIN_ZONE_4G end to 4GB - 1 page
Date: Mon, 11 Jan 2016 11:51:03 +0000	[thread overview]
Message-ID: <20160111115103.GS652@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <1452512367-23614-1-git-send-email-michel.thierry@intel.com>

On Mon, Jan 11, 2016 at 11:39:27AM +0000, Michel Thierry wrote:
> Kernel and userspace are able to handle 4GB (1<<32) address space range,
> but "A32 Stateless Model" is not. According to documentation, A32 accesses
> are based on General State Base Address and bound checking is in place.
> Because size field (instruction State Base Address) limitation, it is not
> possible to address full 4GB memory region.
> 
> A32 Stateless Model is used by some libraries and without this patch, the
> last page of 4GB address space is not accessible in 32bit processes.
> 
> Reported-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
> Signed-off-by: Michel Thierry <michel.thierry@intel.com>

That seems reasonably in line with the flag, and a caveat I think we
live with (GGTT which is already 4G max can't use the last page, even if
we hadn't already given it away).

> ---
>  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 6c60e04..ddc21d4 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3488,7 +3488,7 @@ i915_gem_object_bind_to_vm(struct drm_i915_gem_object *obj,
>  	if (flags & PIN_MAPPABLE)
>  		end = min_t(u64, end, dev_priv->gtt.mappable_end);
>  	if (flags & PIN_ZONE_4G)
> -		end = min_t(u64, end, (1ULL << 32));
> +		end = min_t(u64, end, (1ULL << 32) - PAGE_SIZE);

Bah, I came here expecting to find a mistake with brackets and u64
promotion. Spoilsport.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-01-11 11:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-11 11:39 [PATCH] drm/i915/gen9: Set PIN_ZONE_4G end to 4GB - 1 page Michel Thierry
2016-01-11 11:51 ` Chris Wilson [this message]
2016-01-11 11:53 ` ✓ success: Fi.CI.BAT Patchwork
2016-01-12 16:50   ` Daniel Vetter

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=20160111115103.GS652@nuc-i3427.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=artur.harasimiuk@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=michel.thierry@intel.com \
    /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