Skip to contentSkip to conversation

drm/amdgpu: always flush the TLB on gfx8

PATCH In review Christian König 3 participants 5 messages Jun 3, 2022 – Jun 8, 2022

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

PATCH 1/1 drm/amdgpu: always flush the TLB on gfx8

The TLB on GFX8 stores each block of 8 PTEs where any of the valid bits are set.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5 -0
index 9596c22fded6..b747488c28ad 100644
@@ -847,6 +847,11 @@ int amdgpu_vm_update_range(struct amdgpu_device *adev, struct amdgpu_vm *vm,
 	flush_tlb |= adev->gmc.xgmi.num_physical_nodes &&
 		     adev->ip_versions[GC_HWIP][0] == IP_VERSION(9, 4, 0);
 
+	/*
+	 * On GFX8 and older any 8 PTE block with a valid bit set enters the TLB
+	 */
+	flush_tlb |= adev->ip_versions[GC_HWIP][0] < IP_VERSION(9, 0, 0);
+
 	memset(&params, 0, sizeof(params));
 	params.adev = adev;
 	params.vm = vm;
Signature · 1 line
2.25.1
#1 lore raw

Hi Christian,

This patch fixes almost all GPU faults on polaris caused by 86fd5edfbdae "drm/amdgpu: rework TLB flushing".

I still get occasional faults though, about 1 every 3 runs of a subset of piglit tests.

Thanks,
Pierre-Eric

Quoted 25 lines · Christian König

The TLB on GFX8 stores each block of 8 PTEs where any of the valid bits are set.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5 -0
index 9596c22fded6..b747488c28ad 100644
@@ -847,6 +847,11 @@ int amdgpu_vm_update_range(struct amdgpu_device *adev, struct amdgpu_vm *vm,
 	flush_tlb |= adev->gmc.xgmi.num_physical_nodes &&
 		     adev->ip_versions[GC_HWIP][0] == IP_VERSION(9, 4, 0);
 
+	/*
+	 * On GFX8 and older any 8 PTE block with a valid bit set enters the TLB
+	 */
+	flush_tlb |= adev->ip_versions[GC_HWIP][0] < IP_VERSION(9, 0, 0);
+
 	memset(&params, 0, sizeof(params));
 	params.adev = adev;
 	params.vm = vm;
Reviewed-by on v1 1/1
#2 lore raw
In reply to Christian König
Quoted 5 lines · Christian König

The TLB on GFX8 stores each block of 8 PTEs where any of the valid bits are set.

Quoted 23 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5 -1
index 9596c22fded6..b747488c28ad 100644
@@ -847,6 +847,11 @@ int amdgpu_vm_update_range(struct amdgpu_device *adev, struct amdgpu_vm *vm,
        flush_tlb |= adev->gmc.xgmi.num_physical_nodes &&
                     adev->ip_versions[GC_HWIP][0] == IP_VERSION(9, 4, 0);
 
+       /*
+        * On GFX8 and older any 8 PTE block with a valid bit set enters the TLB
+        */
+       flush_tlb |= adev->ip_versions[GC_HWIP][0] < IP_VERSION(9, 0, 0);
+
        memset(&params, 0, sizeof(params));
        params.adev = adev;
        params.vm = vm;
--

2.25.1

#3 lore raw

Am 07.06.22 um 22:27 schrieb Alex Deucher:

Quoted 7 lines
Quoted 4 lines · Christian König

The TLB on GFX8 stores each block of 8 PTEs where any of the valid bits are set.

Alex could you push this? It's an important fix, but I'm seriously not feeling well at the moment.

Thanks,
Christian.

Quoted 24 lines
Quoted 24 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5 -1
index 9596c22fded6..b747488c28ad 100644
@@ -847,6 +847,11 @@ int amdgpu_vm_update_range(struct amdgpu_device *adev, struct amdgpu_vm *vm,
         flush_tlb |= adev->gmc.xgmi.num_physical_nodes &&
                      adev->ip_versions[GC_HWIP][0] == IP_VERSION(9, 4, 0);
 
+       /*
+        * On GFX8 and older any 8 PTE block with a valid bit set enters the TLB
+        */
+       flush_tlb |= adev->ip_versions[GC_HWIP][0] < IP_VERSION(9, 0, 0);
+
         memset(&params, 0, sizeof(params));
         params.adev = adev;
         params.vm = vm;
--

2.25.1

#4 lore raw

yes. will do.

Alex

Quoted 41 lines · Christian König

Am 07.06.22 um 22:27 schrieb Alex Deucher:

Quoted 7 lines
Quoted 4 lines · Christian König

The TLB on GFX8 stores each block of 8 PTEs where any of the valid bits are set.

Alex could you push this? It's an important fix, but I'm seriously not feeling well at the moment.

Thanks,
Christian.

Quoted 24 lines
Quoted 24 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5 -1
index 9596c22fded6..b747488c28ad 100644
@@ -847,6 +847,11 @@ int amdgpu_vm_update_range(struct amdgpu_device *adev, struct amdgpu_vm *vm,
         flush_tlb |= adev->gmc.xgmi.num_physical_nodes &&
                      adev->ip_versions[GC_HWIP][0] == IP_VERSION(9, 4, 0);
 
+       /*
+        * On GFX8 and older any 8 PTE block with a valid bit set enters the TLB
+        */
+       flush_tlb |= adev->ip_versions[GC_HWIP][0] < IP_VERSION(9, 0, 0);
+
         memset(&params, 0, sizeof(params));
         params.adev = adev;
         params.vm = vm;
--

2.25.1