Skip to content

KFD user queue validation

Philip Yang amd-gfx regressions 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest9 patches 8 repliesIn review
  2. v19 patches 8 repliesSuperseded

Changes in v2 from the cover letter

- patch 3/9, keep wptr_bo_gart in struct queue

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9drm/amdkfd: kfd_bo_mapped_dev support partitiondrivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c drivers/gpu/drm/amd/amdkfd/kfd_chardev.c+5 -40 replies
2/9drm/amdkfd: amdkfd_free_gtt_mem clear the correct pointerdrivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +5 more+16 -160 replies
3/9drm/amdkfd: Refactor queue wptr_bo GART mappingdrivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +4 more+116 -680 replies
4/9drm/amdkfd: Validate user queue buffersdrivers/gpu/drm/amd/amdkfd/kfd_priv.h drivers/gpu/drm/amd/amdkfd/kfd_queue.c+40 -26 replies
5/9drm/amdkfd: Ensure user queue buffers residencydrivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c drivers/gpu/drm/amd/amdgpu/amdgpu_object.h drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +2 more+49 -90 replies
6/9drm/amdkfd: Validate user queue svm memory residencydrivers/gpu/drm/amd/amdkfd/kfd_queue.c drivers/gpu/drm/amd/amdkfd/kfd_svm.c drivers/gpu/drm/amd/amdkfd/kfd_svm.h+122 -10 replies
7/9drm/amdkfd: Validate user queue updatedrivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c+31 -10 replies
8/9drm/amdkfd: Store queue cwsr area size to node propertiesdrivers/gpu/drm/amd/amdkfd/kfd_priv.h drivers/gpu/drm/amd/amdkfd/kfd_queue.c drivers/gpu/drm/amd/amdkfd/kfd_topology.c +1 more+82 -00 replies
9/9drm/amdkfd: Validate queue cwsr area and eop buffer sizedrivers/gpu/drm/amd/amdkfd/kfd_queue.c+42 -40 replies

Reviews trailers per patch

7 of 9 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchFelix Kuehling
SeriesR-b
1/9R-b
2/9R-b
3/9
4/9R-b
5/9
6/9R-b
7/9R-b
8/9R-b
9/9R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/9] KFD user queue validation

This patch series do additional queue buffers validation in the queue creation IOCTLS, fail the queue creation if buffers not mapped on the GPU with the expected size.

Ensure queue buffers residency by tracking the GPUVM virtual addresses for queue buffers to return error if the user tries to free and unmap them when the qeueu is active, or evict the queue if SVM memory is unmapped and freed from CPU.

Patch 1-2 is prepration work and general fix.

v2:
- patch 3/9, keep wptr_bo_gart in struct queue

Philip Yang (9):
drm/amdkfd: kfd_bo_mapped_dev support partition drm/amdkfd: amdkfd_free_gtt_mem clear the correct pointer drm/amdkfd: Refactor queue wptr_bo GART mapping drm/amdkfd: Validate user queue buffers drm/amdkfd: Ensure user queue buffers residency drm/amdkfd: Validate user queue svm memory residency drm/amdkfd: Validate user queue update drm/amdkfd: Store queue cwsr area size to node properties drm/amdkfd: Validate queue cwsr area and eop buffer size

 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c    |  14 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h    |   6 +-
 .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c  |  24 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.h    |   6 +
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c      |  61 +---
 drivers/gpu/drm/amd/amdkfd/kfd_device.c       |   4 +-
 .../drm/amd/amdkfd/kfd_device_queue_manager.c |   8 +-
 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c  |   2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_priv.h         |  19 +-
 drivers/gpu/drm/amd/amdkfd/kfd_process.c      |   2 +-
 .../amd/amdkfd/kfd_process_queue_manager.c    |  79 +++-
 drivers/gpu/drm/amd/amdkfd/kfd_queue.c        | 336 ++++++++++++++++++
 drivers/gpu/drm/amd/amdkfd/kfd_svm.c          |  12 +
 drivers/gpu/drm/amd/amdkfd/kfd_svm.h          |   1 +
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c     |   2 +
 drivers/gpu/drm/amd/amdkfd/kfd_topology.h     |   4 +
 16 files changed, 489 insertions(+), 91 deletions(-)
Signature · 1 line
2.43.2