public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/i915/gtt: Fix the boundary check for vm area
@ 2015-05-12  7:35 Mika Kuoppala
  2015-05-12  7:35 ` [PATCH 2/3] drm/i915/gtt: Allow >= 4GB sizes for vm Mika Kuoppala
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Mika Kuoppala @ 2015-05-12  7:35 UTC (permalink / raw)
  To: intel-gfx; +Cc: Chris Wilson

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 <huax.lu@intel.com>
Cc: Chris Wilson <chris@chris.wilson.co.uk>
Cc: Dave Gordon <david.s.gordon@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Michel Thierry <michel.thierry@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index e3bcc3b..17b7df0 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)
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-05-15  9:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-12  7:35 [PATCH 1/3] drm/i915/gtt: Fix the boundary check for vm area Mika Kuoppala
2015-05-12  7:35 ` [PATCH 2/3] drm/i915/gtt: Allow >= 4GB sizes for vm Mika Kuoppala
2015-05-12  8:39   ` Daniel Vetter
2015-05-12  7:35 ` [PATCH 3/3] drm/i915/gtt: Check va range against vm size Mika Kuoppala
2015-05-15  9:22   ` shuang.he
2015-05-12  8:36 ` [PATCH 1/3] drm/i915/gtt: Fix the boundary check for vm area Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox