Skip to contentSkip to conversation

drm/amdkfd: change SDMA MQD memory type

PATCH In review Eric Huang 3 participants 3 messages Feb 26, 2020

Subsystems (3)
lore
Share & tools
lore

Eric Huang

author
#0 lore raw

PATCH 1/1 drm/amdkfd: change SDMA MQD memory type

SDMA MQD memory type is NC that causes MQD data overwritten accidentally by an old stable cache line. Changing it to UC default for GART will fix the issue.

Change-Id If609f47c78cb97e2c8dc930df2ab5c10c29dfe56
---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +1 -1
index 692abfd..77ea0f0 100644
@@ -1734,7 +1734,7 @@ static int allocate_hiq_sdma_mqd(struct device_queue_manager *dqm)
 
 	retval = amdgpu_amdkfd_alloc_gtt_mem(dev->kgd, size,
 		&(mem_obj->gtt_mem), &(mem_obj->gpu_addr),
-		(void *)&(mem_obj->cpu_ptr), true);
+		(void *)&(mem_obj->cpu_ptr), false);
 
 	return retval;
 }
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Acked-by on v1 1/1
#1 lore raw

[AMD Official Use Only - Internal Distribution Only]

It looks good to me. I was thinking maybe we should go one step further, adding more explanation comments around the MQD control stack workaround, so that people have a clearer idea of what's that MQD control stack workaround is about. We can do that in a following commit.

________________________________
From: amd-gfx <[email protected]> on behalf of Eric Huang <[email protected]>
Sent: Wednesday, February 26, 2020 2:37 PM
To: [email protected] <[email protected]>
Cc: Huang, JinHuiEric <[email protected]>
Subject: [PATCH] drm/amdkfd: change SDMA MQD memory type

SDMA MQD memory type is NC that causes MQD data overwritten accidentally by an old stable cache line. Changing it to UC default for GART will fix the issue.

Change-Id If609f47c78cb97e2c8dc930df2ab5c10c29dfe56
---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +1 -1
index 692abfd..77ea0f0 100644
@@ -1734,7 +1734,7 @@ static int allocate_hiq_sdma_mqd(struct device_queue_manager *dqm)
 
         retval = amdgpu_amdkfd_alloc_gtt_mem(dev->kgd, size,
                 &(mem_obj->gtt_mem), &(mem_obj->gpu_addr),
-               (void *)&(mem_obj->cpu_ptr), true);
+               (void *)&(mem_obj->cpu_ptr), false);
 
         return retval;
 }

--
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cyong.zhao%40amd.com%7C2cbbb3322952475590f508d7baf34ce6%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637183426468344453&amp;sdata=2zCqxZJFXSbBlezU7UIZxc%2FQC0PBTum90MmIjCioHGw%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Eric Huang
Quoted 3 lines · Eric Huang

SDMA MQD memory type is NC that causes MQD data overwritten accidentally by an old stable cache line. Changing it to UC default for GART will fix the issue.

Maybe add a statement here, that the mqd_gfx9 parameter is meant for control stacks that are allocated together with user mode queue MQDs. Setting mqd_gfx9 to true maps the control stack pages as NC. Here it was accidentally applied to SDMA MQDs, which are allocated together with the HIQ MQD. Setting the mqd_gfx9 to false avoids that.

Quoted 3 lines
Change-Id If609f47c78cb97e2c8dc930df2ab5c10c29dfe56
Quoted 9 lines
---
  drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +0 -0
index 692abfd..77ea0f0 100644

drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c static int allocate_hiq_sdma_mqd(struct device_queue_manager *dqm) · line 1740

Quoted 8 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +1 -1
@@ -1734,7 +1734,7 @@ static int allocate_hiq_sdma_mqd(struct device_queue_manager *dqm)
 
  	retval = amdgpu_amdkfd_alloc_gtt_mem(dev->kgd, size,
  		&(mem_obj->gtt_mem), &(mem_obj->gpu_addr),
-		(void *)&(mem_obj->cpu_ptr), true);
+		(void *)&(mem_obj->cpu_ptr), false);
 
  	return retval;
  }

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx