[PATCH v7 13/14] drm/amdgpu: validate the queue va for resuming the queue
Prike Liang
Prike.Liang at amd.com
Tue Jul 22 07:46:22 UTC 2025
It requires validating the userq VA whether is mapped before
trying to resume the queue.
Signed-off-by: Prike Liang <Prike.Liang at amd.com>
Reviewed-by: Christian König <christian.koenig at amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
index a41aaf4aaf4b..77a2f12c8dcc 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -814,11 +814,18 @@ static int
amdgpu_userq_restore_all(struct amdgpu_userq_mgr *uq_mgr)
{
struct amdgpu_usermode_queue *queue;
+ struct amdgpu_fpriv *fpriv = uq_mgr_to_fpriv(uq_mgr);
int queue_id;
int ret = 0, r;
/* Resume all the queues for this process */
idr_for_each_entry(&uq_mgr->userq_idr, queue, queue_id) {
+
+ if (!amdgpu_userq_buffer_vas_mapped(&fpriv->vm, queue)) {
+ drm_file_err(uq_mgr->file, "trying restore queue without va mappping\n");
+ continue;
+ }
+
r = amdgpu_userq_map_helper(uq_mgr, queue);
if (r)
ret = r;
--
2.34.1
More information about the amd-gfx
mailing list