Skip to contentSkip to conversation

drm/amdgpu: remove vm sanity check from amdgpu_vm_make_compute

PATCH In review Xiaogang.Chen 2 participants 2 messages Jun 19, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: remove vm sanity check from amdgpu_vm_make_compute

From: Xiaogang Chen <[email protected]>

Since we allow kfd and graphic operate on same GPU VM to have interoperation between them GPU VM may have been used by graphic vm operations before kfd turn a GFX VM into a compute VM. Remove vm clean checking at amdgpu_vm_make_compute.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
index eff73c428b12..33f05297ab7e 100644
@@ -2246,7 +2246,7 @@ int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm)
 		return r;
 
 	/* Sanity checks */
-	if (!amdgpu_vm_pt_is_root_clean(adev, vm)) {
+	if (pte_support_ats && !amdgpu_vm_pt_is_root_clean(adev, vm)) {
 		r = -EINVAL;
 		goto unreserve_bo;
 	}
Signature · 1 line
2.25.1
#1 lore raw
Quoted 16 lines · Xiaogang.Chen

From: Xiaogang Chen <[email protected]>

Since we allow kfd and graphic operate on same GPU VM to have interoperation between them GPU VM may have been used by graphic vm operations before kfd turn a GFX VM into a compute VM. Remove vm clean checking at amdgpu_vm_make_compute.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
index eff73c428b12..33f05297ab7e 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm) · line 2249

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
@@ -2246,7 +2246,7 @@ int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm)
  		return r;
 
  	/* Sanity checks */
-	if (!amdgpu_vm_pt_is_root_clean(adev, vm)) {
+	if (pte_support_ats && !amdgpu_vm_pt_is_root_clean(adev, vm)) {

I think the correct condition here would be "pte_support_ats != vm->pte_support_ats", because that's what's used to reinitialize the page table just below. I think it would be even cleaner if you moved that check inside the "if (pte_support_ats != vm->pte_support_ats)" block below.

Regards,
  Felix

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
  		r = -EINVAL;
  		goto unreserve_bo;
  	}