Skip to contentSkip to conversation

drm/amdkfd: Delete a duplicate statement in set_pasid_vmid_mapping()

PATCH In review Zhao, Yong 2 participants 5 messages Oct 22, 2018 – Oct 23, 2018 4 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

Zhao, Yong

author
#0 lore raw

PATCH 1/2 drm/amdkfd: Delete a duplicate statement in set_pasid_vmid_mapping()

The same statement is later done in kgd_set_pasid_vmid_mapping() already, so no need to in set_pasid_vmid_mapping() again.

Change-Id Iaf64b90c7dcb59944fb2012a58473dd063e73c60
---
 drivers/gpu/drm/amd/amdkfd/cik_regs.h                 | 2 --
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 9 +--------
 2 files changed, 1 insertion(+), 10 deletions(-)
drivers/gpu/drm/amd/amdkfd/cik_regs.h +0 -2
index 37ce6dd..8e2a166 100644
@@ -68,6 +68,4 @@
 
 #define GRBM_GFX_INDEX					0x30800
 
-#define	ATC_VMID_PASID_MAPPING_VALID			(1U << 31)
-
 #endif
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +1 -8
index dfd8f9e5..fb9d66e 100644
@@ -846,15 +846,8 @@ static int
 set_pasid_vmid_mapping(struct device_queue_manager *dqm, unsigned int pasid,
 			unsigned int vmid)
 {
-	uint32_t pasid_mapping;
-
-	pasid_mapping = (pasid == 0) ? 0 :
-		(uint32_t)pasid |
-		ATC_VMID_PASID_MAPPING_VALID;
-
 	return dqm->dev->kfd2kgd->set_pasid_vmid_mapping(
-						dqm->dev->kgd, pasid_mapping,
-						vmid);
+						dqm->dev->kgd, pasid, vmid);
 }
 
 static void init_interrupts(struct device_queue_manager *dqm)
Signature · 6 lines
2.7.4

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

A message that is not in the archive (sent off-list or not yet received): 1540233186-3456-1-git-send-email-Yong.Zhao-5C7GfCeVMHo@public.gmane.org

author
#2 lore raw

PATCH 2/2 drm/amdkfd: page_table_base already have the flags needed

The flags are added when calling amdgpu_gmc_pd_addr().

Change-Id Idd85b1ac35d3d100154df8229ea20721d9a7045c
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 5 ++---
 drivers/gpu/drm/amd/amdkfd/kfd_priv.h             | 1 +
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c +2 -3
index 54c3690..60b5f56c 100644
@@ -978,7 +978,6 @@ static void set_vm_context_page_table_base(struct kgd_dev *kgd, uint32_t vmid,
 		uint64_t page_table_base)
 {
 	struct amdgpu_device *adev = get_amdgpu_device(kgd);
-	uint64_t base = page_table_base | AMDGPU_PTE_VALID;
 
 	if (!amdgpu_amdkfd_is_kfd_vmid(adev, vmid)) {
 		pr_err("trying to set page table base for wrong VMID %u\n",
@@ -990,7 +989,7 @@ static void set_vm_context_page_table_base(struct kgd_dev *kgd, uint32_t vmid,
 	 * now, all processes share the same address space size, like
 	 * on GFX8 and older.
 	 */
-	mmhub_v1_0_setup_vm_pt_regs(adev, vmid, base);
+	mmhub_v1_0_setup_vm_pt_regs(adev, vmid, page_table_base);
 
-	gfxhub_v1_0_setup_vm_pt_regs(adev, vmid, base);
+	gfxhub_v1_0_setup_vm_pt_regs(adev, vmid, page_table_base);
 }
drivers/gpu/drm/amd/amdkfd/kfd_priv.h +1 -0
index 53ff86d..dec8e64 100644
@@ -507,6 +507,7 @@ struct qcm_process_device {
 	 * All the memory management data should be here too
 	 */
 	uint64_t gds_context_area;
+	/* Contains page table flags such as AMDGPU_PTE_VALID since gfx9 */
 	uint64_t page_table_base;
 	uint32_t sh_mem_config;
 	uint32_t sh_mem_bases;
Signature · 6 lines
2.7.4

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

A message that is not in the archive (sent off-list or not yet received): 1540233186-3456-2-git-send-email-Yong.Zhao-5C7GfCeVMHo@public.gmane.org

author
#4 lore raw

Re: [PATCH 2/2] drm/amdkfd: page_table_base already have the flags needed

How about those two patches?

Yong

________________________________
From: Zhao, Yong
Sent: Monday, October 22, 2018 2:33:26 PM
To: [email protected]; brahma_sw_dev
Cc: Zhao, Yong
Subject: [PATCH 2/2] drm/amdkfd: page_table_base already have the flags needed

The flags are added when calling amdgpu_gmc_pd_addr().

Change-Id Idd85b1ac35d3d100154df8229ea20721d9a7045c
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 5 ++---
 drivers/gpu/drm/amd/amdkfd/kfd_priv.h             | 1 +
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c +2 -3
index 54c3690..60b5f56c 100644
@@ -978,7 +978,6 @@ static void set_vm_context_page_table_base(struct kgd_dev *kgd, uint32_t vmid,
                 uint64_t page_table_base)
 {
         struct amdgpu_device *adev = get_amdgpu_device(kgd);
-       uint64_t base = page_table_base | AMDGPU_PTE_VALID;
 
         if (!amdgpu_amdkfd_is_kfd_vmid(adev, vmid)) {
                 pr_err("trying to set page table base for wrong VMID %u\n",
@@ -990,7 +989,7 @@ static void set_vm_context_page_table_base(struct kgd_dev *kgd, uint32_t vmid,
          * now, all processes share the same address space size, like
          * on GFX8 and older.
          */
-       mmhub_v1_0_setup_vm_pt_regs(adev, vmid, base);
+       mmhub_v1_0_setup_vm_pt_regs(adev, vmid, page_table_base);
 
-       gfxhub_v1_0_setup_vm_pt_regs(adev, vmid, base);
+       gfxhub_v1_0_setup_vm_pt_regs(adev, vmid, page_table_base);
 }
drivers/gpu/drm/amd/amdkfd/kfd_priv.h +1 -0
index 53ff86d..dec8e64 100644
@@ -507,6 +507,7 @@ struct qcm_process_device {
          * All the memory management data should be here too
          */
         uint64_t gds_context_area;
+       /* Contains page table flags such as AMDGPU_PTE_VALID since gfx9 */
         uint64_t page_table_base;
         uint32_t sh_mem_config;
         uint32_t sh_mem_bases;

--
2.7.4

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

A message that is not in the archive (sent off-list or not yet received): BL0PR12MB2500DD8AAC17A29418807EC2F0F50-b4cIHhjg/p89/[email protected]

#6 lore raw

Re: [PATCH 2/2] drm/amdkfd: page_table_base already have the flags needed

The series is Reviewed-by: Felix Kuehling <[email protected]>

Quoted 59 lines · Yong

How about those two patches?

Yong

------------------------------------------------------------------------
*From:* Zhao, Yong
*Sent:* Monday, October 22, 2018 2:33:26 PM
*To:* [email protected]; brahma_sw_dev
*Cc:* Zhao, Yong
*Subject:* [PATCH 2/2] drm/amdkfd: page_table_base already have the flags needed

The flags are added when calling amdgpu_gmc_pd_addr().

Change-Id Idd85b1ac35d3d100154df8229ea20721d9a7045c

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 5 ++--- drivers/gpu/drm/amd/amdkfd/kfd_priv.h             | 1 +

 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c +0 -1
index 54c3690..60b5f56c 100644
@@ -978,7 +978,6 @@ static void set_vm_context_page_table_base(struct
 kgd_dev *kgd, uint32_t vmid,
                  uint64_t page_table_base)
  {
          struct amdgpu_device *adev = get_amdgpu_device(kgd);
-       uint64_t base = page_table_base | AMDGPU_PTE_VALID;


         if (!amdgpu_amdkfd_is_kfd_vmid(adev, vmid)) { pr_err("trying to set page table base for wrong VMID %u\n",

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c +1 -1
@@ -990,7 +989,7 @@ static void set_vm_context_page_table_base(struct
 kgd_dev *kgd, uint32_t vmid,
           * now, all processes share the same address space size, like
           * on GFX8 and older.
           */
-       mmhub_v1_0_setup_vm_pt_regs(adev, vmid, base);
+       mmhub_v1_0_setup_vm_pt_regs(adev, vmid, page_table_base);


-       gfxhub_v1_0_setup_vm_pt_regs(adev, vmid, base); +       gfxhub_v1_0_setup_vm_pt_regs(adev, vmid, page_table_base); }

drivers/gpu/drm/amd/amdkfd/kfd_priv.h +1 -0
index 53ff86d..dec8e64 100644
@@ -507,6 +507,7 @@ struct qcm_process_device {
           * All the memory management data should be here too
           */
          uint64_t gds_context_area;
+       /* Contains page table flags such as AMDGPU_PTE_VALID since
Quoted 7 lines

gfx9 */
         uint64_t page_table_base;
         uint32_t sh_mem_config;
         uint32_t sh_mem_bases;

Signature · 1 line
2.7.4

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

A message that is not in the archive (sent off-list or not yet received): f2a19dc1-db2f-1c85-b940-d024fea31792-5C7GfCeVMHo@public.gmane.org

author
#8 lore raw

Re: [PATCH 2/2] drm/amdkfd: page_table_base already have the flags needed

Pushed. Thanks!

Yong

________________________________
From: Kuehling, Felix
Sent: Tuesday, October 23, 2018 4:43:05 PM
To: Zhao, Yong; [email protected]; brahma_sw_dev
Subject: Re: [PATCH 2/2] drm/amdkfd: page_table_base already have the flags needed

The series is Reviewed-by: Felix Kuehling <[email protected]>

Quoted 60 lines · Yong

How about those two patches?

Yong

------------------------------------------------------------------------
*From:* Zhao, Yong
*Sent:* Monday, October 22, 2018 2:33:26 PM
*To:* [email protected]; brahma_sw_dev *Cc:* Zhao, Yong
*Subject:* [PATCH 2/2] drm/amdkfd: page_table_base already have the flags needed

The flags are added when calling amdgpu_gmc_pd_addr().

Change-Id Idd85b1ac35d3d100154df8229ea20721d9a7045c
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 5 ++---
 drivers/gpu/drm/amd/amdkfd/kfd_priv.h             | 1 +
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c +0 -1
index 54c3690..60b5f56c 100644
@@ -978,7 +978,6 @@ static void set_vm_context_page_table_base(struct
 kgd_dev *kgd, uint32_t vmid,
                 uint64_t page_table_base)
 {
         struct amdgpu_device *adev = get_amdgpu_device(kgd);
-       uint64_t base = page_table_base | AMDGPU_PTE_VALID;
 
         if (!amdgpu_amdkfd_is_kfd_vmid(adev, vmid)) {

pr_err("trying to set page table base for wrong VMID
%u\n",

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c +2 -2
@@ -990,7 +989,7 @@ static void set_vm_context_page_table_base(struct
 kgd_dev *kgd, uint32_t vmid,
          * now, all processes share the same address space size, like
          * on GFX8 and older.
          */
-       mmhub_v1_0_setup_vm_pt_regs(adev, vmid, base);
+       mmhub_v1_0_setup_vm_pt_regs(adev, vmid, page_table_base);
 
-       gfxhub_v1_0_setup_vm_pt_regs(adev, vmid, base);
+       gfxhub_v1_0_setup_vm_pt_regs(adev, vmid, page_table_base);

}

drivers/gpu/drm/amd/amdkfd/kfd_priv.h +1 -0
index 53ff86d..dec8e64 100644
@@ -507,6 +507,7 @@ struct qcm_process_device {
          * All the memory management data should be here too
          */
         uint64_t gds_context_area;
+       /* Contains page table flags such as AMDGPU_PTE_VALID since

gfx9 */

Quoted 6 lines
         uint64_t page_table_base;
         uint32_t sh_mem_config;
         uint32_t sh_mem_bases;

--
2.7.4

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