Commit 444fa5b1 authored by Liviu Dudau's avatar Liviu Dudau Committed by Steven Price
Browse files

drm/panthor: Lock XArray when getting entries for the VM



Similar to commit cac07570 ("drm/panthor: Fix race when converting
group handle to group object") we need to use the XArray's internal
locking when retrieving a vm pointer from there.

v2: Removed part of the patch that was trying to protect fetching
the heap pointer from XArray, as that operation is protected by
the @pool->lock.

Fixes: 647810ec ("drm/panthor: Add the MMU/VM logical block")
Reported-by: default avatarJann Horn <jannh@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarLiviu Dudau <liviu.dudau@arm.com>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: default avatarSteven Price <steven.price@arm.com>
Signed-off-by: default avatarSteven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241106185806.389089-1-liviu.dudau@arm.com
parent 052ef642
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1580,7 +1580,9 @@ panthor_vm_pool_get_vm(struct panthor_vm_pool *pool, u32 handle)
{
	struct panthor_vm *vm;

	xa_lock(&pool->xa);
	vm = panthor_vm_get(xa_load(&pool->xa, handle));
	xa_unlock(&pool->xa);

	return vm;
}