struct blit_buffer scratch;
        struct i915_vma *batch;
        u64 hole;
+       u64 align;
        u32 width;
        u32 height;
 };
                goto err_free;
        }
 
-       hole_size = 2 * PAGE_ALIGN(WIDTH * HEIGHT * 4);
+       t->align = i915_vm_min_alignment(t->ce->vm, INTEL_MEMORY_LOCAL);
+       t->align = max(t->align,
+                      i915_vm_min_alignment(t->ce->vm, INTEL_MEMORY_SYSTEM));
+
+       hole_size = 2 * round_up(WIDTH * HEIGHT * 4, t->align);
        hole_size *= 2; /* room to maneuver */
-       hole_size += 2 * I915_GTT_MIN_ALIGNMENT;
+       hole_size += 2 * t->align; /* padding on either side */
 
        mutex_lock(&t->ce->vm->mutex);
        memset(&hole, 0, sizeof(hole));
        err = drm_mm_insert_node_in_range(&t->ce->vm->mm, &hole,
-                                         hole_size, 0, I915_COLOR_UNEVICTABLE,
+                                         hole_size, t->align,
+                                         I915_COLOR_UNEVICTABLE,
                                          0, U64_MAX,
                                          DRM_MM_INSERT_BEST);
        if (!err)
                goto err_put;
        }
 
-       t->hole = hole.start + I915_GTT_MIN_ALIGNMENT;
+       t->hole = hole.start + t->align;
        pr_info("Using hole at %llx\n", t->hole);
 
        err = tiled_blits_create_buffers(t, WIDTH, HEIGHT, prng);
 static int tiled_blits_prepare(struct tiled_blits *t,
                               struct rnd_state *prng)
 {
-       u64 offset = PAGE_ALIGN(t->width * t->height * 4);
+       u64 offset = round_up(t->width * t->height * 4, t->align);
        u32 *map;
        int err;
        int i;
 
 static int tiled_blits_bounce(struct tiled_blits *t, struct rnd_state *prng)
 {
-       u64 offset =
-               round_up(t->width * t->height * 4, 2 * I915_GTT_MIN_ALIGNMENT);
+       u64 offset = round_up(t->width * t->height * 4, 2 * t->align);
        int err;
 
        /* We want to check position invariant tiling across GTT eviction */
 
        /* Reposition so that we overlap the old addresses, and slightly off */
        err = tiled_blit(t,
-                        &t->buffers[2], t->hole + I915_GTT_MIN_ALIGNMENT,
+                        &t->buffers[2], t->hole + t->align,
                         &t->buffers[1], t->hole + 3 * offset / 2);
        if (err)
                return err;
 
                         u64 hole_start, u64 hole_end,
                         unsigned long end_time)
 {
+       const unsigned int min_alignment =
+               i915_vm_min_alignment(vm, INTEL_MEMORY_SYSTEM);
        I915_RND_STATE(seed_prng);
        struct i915_vma_resource *mock_vma_res;
        unsigned int size;
                I915_RND_SUBSTATE(prng, seed_prng);
                struct drm_i915_gem_object *obj;
                unsigned int *order, count, n;
-               u64 hole_size;
+               u64 hole_size, aligned_size;
 
-               hole_size = (hole_end - hole_start) >> size;
+               aligned_size = max_t(u32, ilog2(min_alignment), size);
+               hole_size = (hole_end - hole_start) >> aligned_size;
                if (hole_size > KMALLOC_MAX_SIZE / sizeof(u32))
                        hole_size = KMALLOC_MAX_SIZE / sizeof(u32);
                count = hole_size >> 1;
                }
                GEM_BUG_ON(!order);
 
-               GEM_BUG_ON(count * BIT_ULL(size) > vm->total);
-               GEM_BUG_ON(hole_start + count * BIT_ULL(size) > hole_end);
+               GEM_BUG_ON(count * BIT_ULL(aligned_size) > vm->total);
+               GEM_BUG_ON(hole_start + count * BIT_ULL(aligned_size) > hole_end);
 
                /* Ignore allocation failures (i.e. don't report them as
                 * a test failure) as we are purposefully allocating very
                }
 
                for (n = 0; n < count; n++) {
-                       u64 addr = hole_start + order[n] * BIT_ULL(size);
+                       u64 addr = hole_start + order[n] * BIT_ULL(aligned_size);
                        intel_wakeref_t wakeref;
 
-                       GEM_BUG_ON(addr + BIT_ULL(size) > vm->total);
+                       GEM_BUG_ON(addr + BIT_ULL(aligned_size) > vm->total);
 
                        if (igt_timeout(end_time,
                                        "%s timed out before %d/%d\n",
                        }
 
                        mock_vma_res->bi.pages = obj->mm.pages;
-                       mock_vma_res->node_size = BIT_ULL(size);
+                       mock_vma_res->node_size = BIT_ULL(aligned_size);
                        mock_vma_res->start = addr;
 
                        with_intel_runtime_pm(vm->gt->uncore->rpm, wakeref)
 
                i915_random_reorder(order, count, &prng);
                for (n = 0; n < count; n++) {
-                       u64 addr = hole_start + order[n] * BIT_ULL(size);
+                       u64 addr = hole_start + order[n] * BIT_ULL(aligned_size);
                        intel_wakeref_t wakeref;
 
                        GEM_BUG_ON(addr + BIT_ULL(size) > vm->total);
 {
        const u64 hole_size = hole_end - hole_start;
        struct drm_i915_gem_object *obj;
+       const unsigned int min_alignment =
+               i915_vm_min_alignment(vm, INTEL_MEMORY_SYSTEM);
        const unsigned long max_pages =
-               min_t(u64, ULONG_MAX - 1, hole_size/2 >> PAGE_SHIFT);
+               min_t(u64, ULONG_MAX - 1, (hole_size / 2) >> ilog2(min_alignment));
        const unsigned long max_step = max(int_sqrt(max_pages), 2UL);
        unsigned long npages, prime, flags;
        struct i915_vma *vma;
 
                                offset = p->offset;
                                list_for_each_entry(obj, &objects, st_link) {
+                                       u64 aligned_size = round_up(obj->base.size,
+                                                                   min_alignment);
+
                                        vma = i915_vma_instance(obj, vm, NULL);
                                        if (IS_ERR(vma))
                                                continue;
 
                                        if (p->step < 0) {
-                                               if (offset < hole_start + obj->base.size)
+                                               if (offset < hole_start + aligned_size)
                                                        break;
-                                               offset -= obj->base.size;
+                                               offset -= aligned_size;
                                        }
 
                                        err = i915_vma_pin(vma, 0, 0, offset | flags);
                                        i915_vma_unpin(vma);
 
                                        if (p->step > 0) {
-                                               if (offset + obj->base.size > hole_end)
+                                               if (offset + aligned_size > hole_end)
                                                        break;
-                                               offset += obj->base.size;
+                                               offset += aligned_size;
                                        }
                                }
 
                                offset = p->offset;
                                list_for_each_entry(obj, &objects, st_link) {
+                                       u64 aligned_size = round_up(obj->base.size,
+                                                                   min_alignment);
+
                                        vma = i915_vma_instance(obj, vm, NULL);
                                        if (IS_ERR(vma))
                                                continue;
 
                                        if (p->step < 0) {
-                                               if (offset < hole_start + obj->base.size)
+                                               if (offset < hole_start + aligned_size)
                                                        break;
-                                               offset -= obj->base.size;
+                                               offset -= aligned_size;
                                        }
 
                                        if (!drm_mm_node_allocated(&vma->node) ||
                                        }
 
                                        if (p->step > 0) {
-                                               if (offset + obj->base.size > hole_end)
+                                               if (offset + aligned_size > hole_end)
                                                        break;
-                                               offset += obj->base.size;
+                                               offset += aligned_size;
                                        }
                                }
 
                                offset = p->offset;
                                list_for_each_entry_reverse(obj, &objects, st_link) {
+                                       u64 aligned_size = round_up(obj->base.size,
+                                                                   min_alignment);
+
                                        vma = i915_vma_instance(obj, vm, NULL);
                                        if (IS_ERR(vma))
                                                continue;
 
                                        if (p->step < 0) {
-                                               if (offset < hole_start + obj->base.size)
+                                               if (offset < hole_start + aligned_size)
                                                        break;
-                                               offset -= obj->base.size;
+                                               offset -= aligned_size;
                                        }
 
                                        err = i915_vma_pin(vma, 0, 0, offset | flags);
                                        i915_vma_unpin(vma);
 
                                        if (p->step > 0) {
-                                               if (offset + obj->base.size > hole_end)
+                                               if (offset + aligned_size > hole_end)
                                                        break;
-                                               offset += obj->base.size;
+                                               offset += aligned_size;
                                        }
                                }
 
                                offset = p->offset;
                                list_for_each_entry_reverse(obj, &objects, st_link) {
+                                       u64 aligned_size = round_up(obj->base.size,
+                                                                   min_alignment);
+
                                        vma = i915_vma_instance(obj, vm, NULL);
                                        if (IS_ERR(vma))
                                                continue;
 
                                        if (p->step < 0) {
-                                               if (offset < hole_start + obj->base.size)
+                                               if (offset < hole_start + aligned_size)
                                                        break;
-                                               offset -= obj->base.size;
+                                               offset -= aligned_size;
                                        }
 
                                        if (!drm_mm_node_allocated(&vma->node) ||
                                        }
 
                                        if (p->step > 0) {
-                                               if (offset + obj->base.size > hole_end)
+                                               if (offset + aligned_size > hole_end)
                                                        break;
-                                               offset += obj->base.size;
+                                               offset += aligned_size;
                                        }
                                }
                        }
        const u64 hole_size = hole_end - hole_start;
        const unsigned long max_pages =
                min_t(u64, ULONG_MAX - 1, hole_size >> PAGE_SHIFT);
+       unsigned long min_alignment;
        unsigned long flags;
        u64 size;
 
        if (i915_is_ggtt(vm))
                flags |= PIN_GLOBAL;
 
+       min_alignment = i915_vm_min_alignment(vm, INTEL_MEMORY_SYSTEM);
+
        for_each_prime_number_from(size, 1, max_pages) {
                struct drm_i915_gem_object *obj;
                struct i915_vma *vma;
 
                for (addr = hole_start;
                     addr + obj->base.size < hole_end;
-                    addr += obj->base.size) {
+                    addr += round_up(obj->base.size, min_alignment)) {
                        err = i915_vma_pin(vma, 0, 0, addr | flags);
                        if (err) {
                                pr_err("%s bind failed at %llx + %llx [hole %llx- %llx] with err=%d\n",
 {
        struct drm_i915_gem_object *obj;
        struct i915_vma *vma;
+       unsigned int min_alignment;
        unsigned long flags;
        unsigned int pot;
        int err = 0;
        if (i915_is_ggtt(vm))
                flags |= PIN_GLOBAL;
 
+       min_alignment = i915_vm_min_alignment(vm, INTEL_MEMORY_SYSTEM);
+
        obj = i915_gem_object_create_internal(vm->i915, 2 * I915_GTT_PAGE_SIZE);
        if (IS_ERR(obj))
                return PTR_ERR(obj);
 
        /* Insert a pair of pages across every pot boundary within the hole */
        for (pot = fls64(hole_end - 1) - 1;
-            pot > ilog2(2 * I915_GTT_PAGE_SIZE);
+            pot > ilog2(2 * min_alignment);
             pot--) {
                u64 step = BIT_ULL(pot);
                u64 addr;
 
-               for (addr = round_up(hole_start + I915_GTT_PAGE_SIZE, step) - I915_GTT_PAGE_SIZE;
-                    addr <= round_down(hole_end - 2*I915_GTT_PAGE_SIZE, step) - I915_GTT_PAGE_SIZE;
+               for (addr = round_up(hole_start + min_alignment, step) - min_alignment;
+                    addr <= round_down(hole_end - (2 * min_alignment), step) - min_alignment;
                     addr += step) {
                        err = i915_vma_pin(vma, 0, 0, addr | flags);
                        if (err) {
                      unsigned long end_time)
 {
        I915_RND_STATE(prng);
+       unsigned int min_alignment;
        unsigned int size;
        unsigned long flags;
 
        if (i915_is_ggtt(vm))
                flags |= PIN_GLOBAL;
 
+       min_alignment = i915_vm_min_alignment(vm, INTEL_MEMORY_SYSTEM);
+
        /* Keep creating larger objects until one cannot fit into the hole */
        for (size = 12; (hole_end - hole_start) >> size; size++) {
                struct drm_i915_gem_object *obj;
                unsigned int *order, count, n;
                struct i915_vma *vma;
-               u64 hole_size;
+               u64 hole_size, aligned_size;
                int err = -ENODEV;
 
-               hole_size = (hole_end - hole_start) >> size;
+               aligned_size = max_t(u32, ilog2(min_alignment), size);
+               hole_size = (hole_end - hole_start) >> aligned_size;
                if (hole_size > KMALLOC_MAX_SIZE / sizeof(u32))
                        hole_size = KMALLOC_MAX_SIZE / sizeof(u32);
                count = hole_size >> 1;
                GEM_BUG_ON(vma->size != BIT_ULL(size));
 
                for (n = 0; n < count; n++) {
-                       u64 addr = hole_start + order[n] * BIT_ULL(size);
+                       u64 addr = hole_start + order[n] * BIT_ULL(aligned_size);
 
                        err = i915_vma_pin(vma, 0, 0, addr | flags);
                        if (err) {
 {
        struct drm_i915_gem_object *obj;
        unsigned long flags = PIN_OFFSET_FIXED | PIN_USER;
+       unsigned int min_alignment;
        unsigned int order = 12;
        LIST_HEAD(objects);
        int err = 0;
        u64 addr;
 
+       min_alignment = i915_vm_min_alignment(vm, INTEL_MEMORY_SYSTEM);
+
        /* Keep creating larger objects until one cannot fit into the hole */
        for (addr = hole_start; addr < hole_end; ) {
                struct i915_vma *vma;
                }
 
                i915_vma_unpin(vma);
-               addr += size;
+               addr += round_up(size, min_alignment);
 
                /*
                 * Since we are injecting allocation faults at random intervals,