aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMika Kuoppala <[email protected]>2015-05-12 10:35:08 +0300
committerDaniel Vetter <[email protected]>2015-05-20 11:25:47 +0200
commitf3e06f1156f1adf17dc44144ad3b774c2d414e47 (patch)
tree5a45df45fb3ba0501dffd39db82d8238f0ffaf75
parentaf99ceda2d09ca57f6f3de2f71ae0d32a51c7016 (diff)
drm/i915/gtt: Fix the boundary check for vm area
The check for start + length >= total_vm_size is wrong since start + length can be exactly the size of the vm. Fix the check to allow allocation to boundary. Fixes a regression in commit 4dd738e9cd79 ("drm/i915: Fix 32b overflow check in gen8_ppgtt_alloc_page_directories") Testcase: igt/gem_evict_everything/swapping-interruptible Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90399 Tested-by: Lu Hua <[email protected]> Cc: Chris Wilson <[email protected]> Cc: Dave Gordon <[email protected]> Cc: Ville Syrjälä <[email protected]> Cc: Michel Thierry <[email protected]> Signed-off-by: Mika Kuoppala <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index e3bcc3ba7e40..17b7df0b561f 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -757,7 +757,7 @@ static int gen8_ppgtt_alloc_page_directories(struct i915_hw_ppgtt *ppgtt,
WARN_ON(!bitmap_empty(new_pds, GEN8_LEGACY_PDPES));
/* FIXME: upper bound must not overflow 32 bits */
- WARN_ON((start + length) >= (1ULL << 32));
+ WARN_ON((start + length) > (1ULL << 32));
gen8_for_each_pdpe(pd, pdp, start, length, temp, pdpe) {
if (pd)