1. 21 12月, 2022 1 次提交
    • P
      drm/amdkfd: Fix double release compute pasid · 41d82649
      Philip Yang 提交于
      If kfd_process_device_init_vm returns failure after vm is converted to
      compute vm and vm->pasid set to compute pasid, KFD will not take
      pdd->drm_file reference. As a result, drm close file handler maybe
      called to release the compute pasid before KFD process destroy worker to
      release the same pasid and set vm->pasid to zero, this generates below
      WARNING backtrace and NULL pointer access.
      
      Add helper amdgpu_amdkfd_gpuvm_set_vm_pasid and call it at the last step
      of kfd_process_device_init_vm, to ensure vm pasid is the original pasid
      if acquiring vm failed or is the compute pasid with pdd->drm_file
      reference taken to avoid double release same pasid.
      
       amdgpu: Failed to create process VM object
       ida_free called for id=32770 which is not allocated.
       WARNING: CPU: 57 PID: 72542 at ../lib/idr.c:522 ida_free+0x96/0x140
       RIP: 0010:ida_free+0x96/0x140
       Call Trace:
        amdgpu_pasid_free_delayed+0xe1/0x2a0 [amdgpu]
        amdgpu_driver_postclose_kms+0x2d8/0x340 [amdgpu]
        drm_file_free.part.13+0x216/0x270 [drm]
        drm_close_helper.isra.14+0x60/0x70 [drm]
        drm_release+0x6e/0xf0 [drm]
        __fput+0xcc/0x280
        ____fput+0xe/0x20
        task_work_run+0x96/0xc0
        do_exit+0x3d0/0xc10
      
       BUG: kernel NULL pointer dereference, address: 0000000000000000
       RIP: 0010:ida_free+0x76/0x140
       Call Trace:
        amdgpu_pasid_free_delayed+0xe1/0x2a0 [amdgpu]
        amdgpu_driver_postclose_kms+0x2d8/0x340 [amdgpu]
        drm_file_free.part.13+0x216/0x270 [drm]
        drm_close_helper.isra.14+0x60/0x70 [drm]
        drm_release+0x6e/0xf0 [drm]
        __fput+0xcc/0x280
        ____fput+0xe/0x20
        task_work_run+0x96/0xc0
        do_exit+0x3d0/0xc10
      Signed-off-by: NPhilip Yang <Philip.Yang@amd.com>
      Reviewed-by: NFelix Kuehling <Felix.Kuehling@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      41d82649
  2. 14 12月, 2022 1 次提交
  3. 30 11月, 2022 1 次提交
  4. 17 11月, 2022 2 次提交
  5. 16 11月, 2022 2 次提交
  6. 10 11月, 2022 1 次提交
    • F
      drm/amdgpu: Set MTYPE in PTE based on BO flags · d1a372af
      Felix Kuehling 提交于
      The same BO may need different MTYPEs and SNOOP flags in PTEs depending
      on its current location relative to the mapping GPU. Setting MTYPEs from
      clients ahead of time is not practical for coherent memory sharing.
      Instead determine the correct MTYPE for the desired coherence model and
      current BO location when updating the page tables.
      
      To maintain backwards compatibility with MTYPE-selection in
      AMDGPU_VA_OP_MAP, the coherence-model-based MTYPE selection is only
      applied if it chooses an MTYPE other than MTYPE_NC (the default).
      
      Add two AMDGPU_GEM_CREATE_... flags to indicate the coherence model. The
      default if no flag is specified is non-coherent (i.e. coarse-grained
      coherent at dispatch boundaries).
      
      Update amdgpu_amdkfd_gpuvm.c to use this new method to choose the
      correct MTYPE depending on the current memory location.
      
      v2:
      * check that bo is not NULL (e.g. PRT mappings)
      * Fix missing ~ bitmask in gmc_v11_0.c
      v3:
      * squash in "drm/amdgpu: Inherit coherence flags on dmabuf import"
      Suggested-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NFelix Kuehling <Felix.Kuehling@amd.com>
      Acked-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      d1a372af
  7. 05 11月, 2022 1 次提交
  8. 25 10月, 2022 2 次提交
  9. 18 10月, 2022 1 次提交
  10. 14 9月, 2022 2 次提交
  11. 08 9月, 2022 2 次提交
  12. 11 8月, 2022 2 次提交
  13. 29 7月, 2022 4 次提交
  14. 25 7月, 2022 1 次提交
  15. 21 7月, 2022 1 次提交
  16. 18 7月, 2022 1 次提交
  17. 13 7月, 2022 1 次提交
  18. 06 7月, 2022 1 次提交
  19. 01 7月, 2022 1 次提交
  20. 24 6月, 2022 2 次提交
  21. 15 6月, 2022 1 次提交
  22. 08 6月, 2022 2 次提交
  23. 04 6月, 2022 1 次提交
  24. 27 5月, 2022 1 次提交
  25. 16 5月, 2022 1 次提交
  26. 07 4月, 2022 2 次提交
  27. 06 4月, 2022 1 次提交
  28. 26 3月, 2022 1 次提交