Skip to content

Commit 48ea1e3

Browse files
mthierryjnikula
authored andcommitted
drm/i915/gen9: Set PIN_ZONE_4G end to 4GB - 1 page
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> Link: http://patchwork.freedesktop.org/patch/msgid/1452512367-23614-1-git-send-email-michel.thierry@intel.com Cc: drm-intel-fixes@lists.freedesktop.org Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (cherry picked from commit 1892faa) Signed-off-by: Jani Nikula <jani.nikula@intel.com>
1 parent de05133 commit 48ea1e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/i915/i915_gem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3484,7 +3484,7 @@ i915_gem_object_bind_to_vm(struct drm_i915_gem_object *obj,
34843484
if (flags & PIN_MAPPABLE)
34853485
end = min_t(u64, end, dev_priv->gtt.mappable_end);
34863486
if (flags & PIN_ZONE_4G)
3487-
end = min_t(u64, end, (1ULL << 32));
3487+
end = min_t(u64, end, (1ULL << 32) - PAGE_SIZE);
34883488

34893489
if (alignment == 0)
34903490
alignment = flags & PIN_MAPPABLE ? fence_alignment :

0 commit comments

Comments
 (0)