Skip to content

Commit be14184

Browse files
airlieddakr
authored andcommitted
nouveau/uvmm: fix addr/range calcs for remap operations
dEQP-VK.sparse_resources.image_rebind.2d_array.r64i.128_128_8 was causing a remap operation like the below. op_remap: prev: 0000003fffed0000 00000000000f0000 00000000a5abd18a 0000000000000000 op_remap: next: op_remap: unmap: 0000003fffed0000 0000000000100000 0 op_map: map: 0000003ffffc0000 0000000000010000 000000005b1ba33c 00000000000e0000 This was resulting in an unmap operation from 0x3fffed0000+0xf0000, 0x100000 which was corrupting the pagetables and oopsing the kernel. Fixes the prev + unmap range calcs to use start/end and map back to addr/range. Signed-off-by: Dave Airlie <[email protected]> Fixes: b88baab ("drm/nouveau: implement new VM_BIND uAPI") Cc: Danilo Krummrich <[email protected]> Signed-off-by: Danilo Krummrich <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent c60ebc5 commit be14184

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpu/drm/nouveau/nouveau_uvmm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -812,15 +812,15 @@ op_remap(struct drm_gpuva_op_remap *r,
812812
struct drm_gpuva_op_unmap *u = r->unmap;
813813
struct nouveau_uvma *uvma = uvma_from_va(u->va);
814814
u64 addr = uvma->va.va.addr;
815-
u64 range = uvma->va.va.range;
815+
u64 end = uvma->va.va.addr + uvma->va.va.range;
816816

817817
if (r->prev)
818818
addr = r->prev->va.addr + r->prev->va.range;
819819

820820
if (r->next)
821-
range = r->next->va.addr - addr;
821+
end = r->next->va.addr;
822822

823-
op_unmap_range(u, addr, range);
823+
op_unmap_range(u, addr, end - addr);
824824
}
825825

826826
static int

0 commit comments

Comments
 (0)