Skip to content

venus: fix a race condition between gem close and gem handle tracking

Yiwei Zhang requested to merge zzyiwei/mesa:vn-bo-racy-fix into main

What does this MR do and why?

venus: fix a race condition between gem close and gem handle tracking

After using sparse array to manager virtgpu bo, we set gem_handle to 0
to indicate that the bo is invalid. However, the gem handle gets closed
before that and can be reused by another newly created bo, leading to
the tracked gem handle being unexpectedly zero'ed out.

Fixes: 88f481dd742 ("venus: make sure gem_handle and vn_renderer_bo are 1:1")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>

/cc @ryanneph

Merge request reports