Skip to contentSkip to conversation

drm/amdgpu: change page_table_base_addr caculation in mes queue property

PATCH In review Yifan Zhang 4 participants 9 messages Aug 25, 2023 – Aug 29, 2023

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

PATCH v3 1/2 drm/amdgpu: change page_table_base_addr caculation in mes queue property

current method doesn't work for GTT domain page table, change it to support both VRAM and GTT domain.

v2: rename member for pde (Christian)

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 6 ++----
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +2 -4
index 10ce5557bb11..06a178dde38c 100644
@@ -259,7 +259,7 @@ int amdgpu_mes_create_process(struct amdgpu_device *adev, int pasid,
 	process->vm = vm;
 	process->pasid = pasid;
 	process->process_quantum = adev->mes.default_process_quantum;
-	process->pd_gpu_addr = amdgpu_bo_gpu_offset(vm->root.bo);
+	process->root_pde = amdgpu_gmc_pd_addr(vm->root.bo);
 
 	amdgpu_mes_unlock(&adev->mes);
 	return 0;
@@ -621,9 +621,7 @@ int amdgpu_mes_add_hw_queue(struct amdgpu_device *adev, int gang_id,
 	/* add hw queue to mes */
 	queue_input.process_id = gang->process->pasid;
 
-	queue_input.page_table_base_addr =
-		adev->vm_manager.vram_base_offset + gang->process->pd_gpu_addr -
-		adev->gmc.vram_start;
+	queue_input.page_table_base_addr =gang->process->root_pde;
 
 	queue_input.process_va_start = 0;
 	queue_input.process_va_end =
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h +1 -1
index a27b424ffe00..01ecbfd57ba1 100644
@@ -140,7 +140,7 @@ struct amdgpu_mes {
 struct amdgpu_mes_process {
 	int			pasid;
 	struct			amdgpu_vm *vm;
-	uint64_t		pd_gpu_addr;
+	uint64_t		root_pde;
 	struct amdgpu_bo 	*proc_ctx_bo;
 	uint64_t 		proc_ctx_gpu_addr;
 	void 			*proc_ctx_cpu_ptr;
Signature · 1 line
2.37.3
#1 lore raw

PATCH v3 2/2 drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

To decrease VRAM pressure for APUs, put page tables to GTT domain for gfx10 and newer APUs.

v2: only enable it for gfx10 and newer APUs (Alex, Christian)

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c +6 -3
index 96d601e209b8..4603d87c61a0 100644
@@ -515,10 +515,13 @@ int amdgpu_vm_pt_create(struct amdgpu_device *adev, struct amdgpu_vm *vm,
 	bp.size = amdgpu_vm_pt_size(adev, level);
 	bp.byte_align = AMDGPU_GPU_PAGE_SIZE;
 
-	if (!adev->gmc.is_app_apu)
-		bp.domain = AMDGPU_GEM_DOMAIN_VRAM;
-	else
+	if (adev->gmc.is_app_apu ||
+		((adev->flags & AMD_IS_APU) &&
+		(adev->ip_versions[GC_HWIP][0] >= IP_VERSION(10, 3, 3))))
 		bp.domain = AMDGPU_GEM_DOMAIN_GTT;
+	else
+		bp.domain = AMDGPU_GEM_DOMAIN_VRAM;
+
 
 	bp.domain = amdgpu_bo_get_preferred_domain(adev, bp.domain);
 	bp.flags = AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS |
Signature · 1 line
2.37.3
#2 lore raw

RE: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

[AMD Official Use Only - General]

Ping

-----Original Message-----
From: Zhang, Yifan <[email protected]>
Sent: Friday, August 25, 2023 8:34 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Zhang, Yifan <[email protected]>
Subject: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

To decrease VRAM pressure for APUs, put page tables to GTT domain for gfx10 and newer APUs.

v2: only enable it for gfx10 and newer APUs (Alex, Christian)

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c +6 -3
index 96d601e209b8..4603d87c61a0 100644
@@ -515,10 +515,13 @@ int amdgpu_vm_pt_create(struct amdgpu_device *adev, struct amdgpu_vm *vm,
        bp.size = amdgpu_vm_pt_size(adev, level);
        bp.byte_align = AMDGPU_GPU_PAGE_SIZE;
 
-       if (!adev->gmc.is_app_apu)
-               bp.domain = AMDGPU_GEM_DOMAIN_VRAM;
-       else
+       if (adev->gmc.is_app_apu ||
+               ((adev->flags & AMD_IS_APU) &&
+               (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(10, 3, 3))))
                bp.domain = AMDGPU_GEM_DOMAIN_GTT;
+       else
+               bp.domain = AMDGPU_GEM_DOMAIN_VRAM;
+
 
        bp.domain = amdgpu_bo_get_preferred_domain(adev, bp.domain);
        bp.flags = AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS |

--
2.37.3

#3 lore raw

Re: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

Is that now validated with IOMMU in non pass through mode?

Christian.

Am 28.08.23 um 10:58 schrieb Zhang, Yifan:

Quoted 44 lines

[AMD Official Use Only - General]

Ping

-----Original Message-----
From: Zhang, Yifan <[email protected]>
Sent: Friday, August 25, 2023 8:34 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Zhang, Yifan <[email protected]>
Subject: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

To decrease VRAM pressure for APUs, put page tables to GTT domain for gfx10 and newer APUs.

v2: only enable it for gfx10 and newer APUs (Alex, Christian)

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c | 9 ++++++---
  1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c +6 -4
index 96d601e209b8..4603d87c61a0 100644
@@ -515,10 +515,13 @@ int amdgpu_vm_pt_create(struct amdgpu_device *adev, struct amdgpu_vm *vm,
         bp.size = amdgpu_vm_pt_size(adev, level);
         bp.byte_align = AMDGPU_GPU_PAGE_SIZE;
 
-       if (!adev->gmc.is_app_apu)
-               bp.domain = AMDGPU_GEM_DOMAIN_VRAM;
-       else
+       if (adev->gmc.is_app_apu ||
+               ((adev->flags & AMD_IS_APU) &&
+               (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(10, 3, 3))))
                 bp.domain = AMDGPU_GEM_DOMAIN_GTT;
+       else
+               bp.domain = AMDGPU_GEM_DOMAIN_VRAM;
+
 
         bp.domain = amdgpu_bo_get_preferred_domain(adev, bp.domain);
         bp.flags = AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS |
--

2.37.3

#4 lore raw

RE: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

[Public]

Not yet. It will be only enabled for gfx10.3.3 and later APU initially, IOMMU is pass through in these ASIC.

-----Original Message-----
From: Christian König <[email protected]>
Sent: Monday, August 28, 2023 5:41 PM
To: Zhang, Yifan <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>
Subject: Re: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

Is that now validated with IOMMU in non pass through mode?

Christian.

Am 28.08.23 um 10:58 schrieb Zhang, Yifan:

Quoted 44 lines

[AMD Official Use Only - General]

Ping

-----Original Message-----
From: Zhang, Yifan <[email protected]>
Sent: Friday, August 25, 2023 8:34 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Zhang, Yifan <[email protected]>
Subject: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

To decrease VRAM pressure for APUs, put page tables to GTT domain for gfx10 and newer APUs.

v2: only enable it for gfx10 and newer APUs (Alex, Christian)

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c | 9 ++++++---
  1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c +6 -4
index 96d601e209b8..4603d87c61a0 100644
@@ -515,10 +515,13 @@ int amdgpu_vm_pt_create(struct amdgpu_device *adev, struct amdgpu_vm *vm,
         bp.size = amdgpu_vm_pt_size(adev, level);
         bp.byte_align = AMDGPU_GPU_PAGE_SIZE;
 
-       if (!adev->gmc.is_app_apu)
-               bp.domain = AMDGPU_GEM_DOMAIN_VRAM;
-       else
+       if (adev->gmc.is_app_apu ||
+               ((adev->flags & AMD_IS_APU) &&
+               (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(10, 3, 3))))
                 bp.domain = AMDGPU_GEM_DOMAIN_GTT;
+       else
+               bp.domain = AMDGPU_GEM_DOMAIN_VRAM;
+
 
         bp.domain = amdgpu_bo_get_preferred_domain(adev, bp.domain);
         bp.flags = AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS |
--

2.37.3

maintainer
#5 lore raw

Re: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

Well, there seems to be a very basic misunderstood here: The IOMMU isolation level is *not* ASIC dependent!

Try to set amd_iommu=force_isolation on the kernel command line.

This is a configuration option customers can use to harden their systems and when this isn't properly tested we can't allow page tables in system memory.

Regards,
Christian.

Am 28.08.23 um 13:23 schrieb Zhang, Yifan:

Quoted 60 lines

[Public]

Not yet. It will be only enabled for gfx10.3.3 and later APU initially, IOMMU is pass through in these ASIC.

-----Original Message-----
From: Christian König <[email protected]>
Sent: Monday, August 28, 2023 5:41 PM
To: Zhang, Yifan <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>
Subject: Re: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

Is that now validated with IOMMU in non pass through mode?

Christian.

Am 28.08.23 um 10:58 schrieb Zhang, Yifan:

Quoted 44 lines

[AMD Official Use Only - General]

Ping

-----Original Message-----
From: Zhang, Yifan <[email protected]>
Sent: Friday, August 25, 2023 8:34 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Zhang, Yifan <[email protected]>
Subject: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

To decrease VRAM pressure for APUs, put page tables to GTT domain for gfx10 and newer APUs.

v2: only enable it for gfx10 and newer APUs (Alex, Christian)

---
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c | 9 ++++++---
   1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c +6 -4
index 96d601e209b8..4603d87c61a0 100644
@@ -515,10 +515,13 @@ int amdgpu_vm_pt_create(struct amdgpu_device *adev, struct amdgpu_vm *vm,
          bp.size = amdgpu_vm_pt_size(adev, level);
          bp.byte_align = AMDGPU_GPU_PAGE_SIZE;
 
-       if (!adev->gmc.is_app_apu)
-               bp.domain = AMDGPU_GEM_DOMAIN_VRAM;
-       else
+       if (adev->gmc.is_app_apu ||
+               ((adev->flags & AMD_IS_APU) &&
+               (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(10, 3, 3))))
                  bp.domain = AMDGPU_GEM_DOMAIN_GTT;
+       else
+               bp.domain = AMDGPU_GEM_DOMAIN_VRAM;
+
 
          bp.domain = amdgpu_bo_get_preferred_domain(adev, bp.domain);
          bp.flags = AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS |
--

2.37.3

#6 lore raw

Re: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

[AMD Official Use Only - General]

Technically the AMD IOMMU uses direct mapping mode for any device which claims to support ATS in order to support the IOMMUv2 functionality, but that was also the case with Raven systems which were problematic when remapping mode was enabled. That said, now that IOMMUv2 support has been removed, there's no reason to use direct mapping in the IOMMU driver so that may change.

Alex

________________________________
From: Koenig, Christian <[email protected]>
Sent: Monday, August 28, 2023 7:30 AM
To: Zhang, Yifan <[email protected]>; Christian König <[email protected]>; [email protected] <[email protected]>
Cc: Deucher, Alexander <[email protected]>
Subject: Re: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

Well, there seems to be a very basic misunderstood here: The IOMMU isolation level is *not* ASIC dependent!

Try to set amd_iommu=force_isolation on the kernel command line.

This is a configuration option customers can use to harden their systems and when this isn't properly tested we can't allow page tables in system memory.

Regards,
Christian.

Am 28.08.23 um 13:23 schrieb Zhang, Yifan:

Quoted 60 lines

[Public]

Not yet. It will be only enabled for gfx10.3.3 and later APU initially, IOMMU is pass through in these ASIC.

-----Original Message-----
From: Christian König <[email protected]>
Sent: Monday, August 28, 2023 5:41 PM
To: Zhang, Yifan <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>
Subject: Re: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

Is that now validated with IOMMU in non pass through mode?

Christian.

Am 28.08.23 um 10:58 schrieb Zhang, Yifan:

Quoted 44 lines

[AMD Official Use Only - General]

Ping

-----Original Message-----
From: Zhang, Yifan <[email protected]>
Sent: Friday, August 25, 2023 8:34 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Zhang, Yifan <[email protected]>
Subject: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

To decrease VRAM pressure for APUs, put page tables to GTT domain for gfx10 and newer APUs.

v2: only enable it for gfx10 and newer APUs (Alex, Christian)

---
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c | 9 ++++++---
   1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c +6 -4
index 96d601e209b8..4603d87c61a0 100644
@@ -515,10 +515,13 @@ int amdgpu_vm_pt_create(struct amdgpu_device *adev, struct amdgpu_vm *vm,
          bp.size = amdgpu_vm_pt_size(adev, level);
          bp.byte_align = AMDGPU_GPU_PAGE_SIZE;
 
-       if (!adev->gmc.is_app_apu)
-               bp.domain = AMDGPU_GEM_DOMAIN_VRAM;
-       else
+       if (adev->gmc.is_app_apu ||
+               ((adev->flags & AMD_IS_APU) &&
+               (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(10, 3, 3))))
                  bp.domain = AMDGPU_GEM_DOMAIN_GTT;
+       else
+               bp.domain = AMDGPU_GEM_DOMAIN_VRAM;
+
 
          bp.domain = amdgpu_bo_get_preferred_domain(adev, bp.domain);
          bp.flags = AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS |
--

2.37.3

#7 lore raw

RE: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

[AMD Official Use Only - General]

Validated on Phoenix and Raphael w/ IOMMU remapping mode, and found random page fault when launching Xorg. I will debug this issue and update the patch.

Best Regards,
Yifan

From: Deucher, Alexander <[email protected]>
Sent: Tuesday, August 29, 2023 2:06 AM
To: Koenig, Christian <[email protected]>; Zhang, Yifan <[email protected]>; Christian König <[email protected]>; [email protected]
Subject: Re: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

[AMD Official Use Only - General]

Technically the AMD IOMMU uses direct mapping mode for any device which claims to support ATS in order to support the IOMMUv2 functionality, but that was also the case with Raven systems which were problematic when remapping mode was enabled. That said, now that IOMMUv2 support has been removed, there's no reason to use direct mapping in the IOMMU driver so that may change.

Alex

________________________________
From: Koenig, Christian <[email protected]<mailto:[email protected]>>
Sent: Monday, August 28, 2023 7:30 AM
To: Zhang, Yifan <[email protected]<mailto:[email protected]>>; Christian König <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>
Cc: Deucher, Alexander <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

Well, there seems to be a very basic misunderstood here: The IOMMU isolation level is *not* ASIC dependent!

Try to set amd_iommu=force_isolation on the kernel command line.

This is a configuration option customers can use to harden their systems and when this isn't properly tested we can't allow page tables in system memory.

Regards,
Christian.

Am 28.08.23 um 13:23 schrieb Zhang, Yifan:

Quoted 60 lines

[Public]

Not yet. It will be only enabled for gfx10.3.3 and later APU initially, IOMMU is pass through in these ASIC.

-----Original Message-----
From: Christian König <[email protected]<mailto:[email protected]>>
Sent: Monday, August 28, 2023 5:41 PM
To: Zhang, Yifan <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]>
Cc: Deucher, Alexander <[email protected]<mailto:[email protected]>>; Koenig, Christian <[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

Is that now validated with IOMMU in non pass through mode?

Christian.

Am 28.08.23 um 10:58 schrieb Zhang, Yifan:

Quoted 44 lines

[AMD Official Use Only - General]

Ping

-----Original Message-----
From: Zhang, Yifan <[email protected]<mailto:[email protected]>>
Sent: Friday, August 25, 2023 8:34 AM
To: [email protected]<mailto:[email protected]>
Cc: Deucher, Alexander <[email protected]<mailto:[email protected]>>; Koenig, Christian <[email protected]<mailto:[email protected]>>; Zhang, Yifan <[email protected]<mailto:[email protected]>>
Subject: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

To decrease VRAM pressure for APUs, put page tables to GTT domain for gfx10 and newer APUs.

v2: only enable it for gfx10 and newer APUs (Alex, Christian)

---
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c | 9 ++++++---
   1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c +6 -4
index 96d601e209b8..4603d87c61a0 100644
@@ -515,10 +515,13 @@ int amdgpu_vm_pt_create(struct amdgpu_device *adev, struct amdgpu_vm *vm,
          bp.size = amdgpu_vm_pt_size(adev, level);
          bp.byte_align = AMDGPU_GPU_PAGE_SIZE;
 
-       if (!adev->gmc.is_app_apu)
-               bp.domain = AMDGPU_GEM_DOMAIN_VRAM;
-       else
+       if (adev->gmc.is_app_apu ||
+               ((adev->flags & AMD_IS_APU) &&
+               (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(10, 3, 3))))
                  bp.domain = AMDGPU_GEM_DOMAIN_GTT;
+       else
+               bp.domain = AMDGPU_GEM_DOMAIN_VRAM;
+
 
          bp.domain = amdgpu_bo_get_preferred_domain(adev, bp.domain);
          bp.flags = AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS |
--

2.37.3

maintainer
#8 lore raw

Keyword Review - Re: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

*sigh* yeah that's exactly what we have seen before as well. Let me know when you need help with that.

Regards,
Christian.

Am 29.08.23 um 08:17 schrieb Zhang, Yifan:

Quoted 111 lines

[AMD Official Use Only - General]

Validated on Phoenix and Raphael w/ IOMMU remapping mode, and found random page fault when launching Xorg. I will debug this issue and update the patch.

Best Regards,

Yifan

*From:* Deucher, Alexander <[email protected]>
*Sent:* Tuesday, August 29, 2023 2:06 AM
*To:* Koenig, Christian <[email protected]>; Zhang, Yifan <[email protected]>; Christian König <[email protected]>; [email protected] *Subject:* Re: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

[AMD Official Use Only - General]

Technically the AMD IOMMU uses direct mapping mode for any device which claims to support ATS in order to support the IOMMUv2 functionality, but that was also the case with Raven systems which were problematic when remapping mode was enabled.  That said, now that IOMMUv2 support has been removed, there's no reason to use direct mapping in the IOMMU driver so that may change.

Alex

------------------------------------------------------------------------

*From:*Koenig, Christian <[email protected]>
*Sent:* Monday, August 28, 2023 7:30 AM
*To:* Zhang, Yifan <[email protected]>; Christian König <[email protected]>; [email protected] <[email protected]> *Cc:* Deucher, Alexander <[email protected]>
*Subject:* Re: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory for gfx10 onwards APUs

Well, there seems to be a very basic misunderstood here: The IOMMU isolation level is *not* ASIC dependent!

Try to set amd_iommu=force_isolation on the kernel command line.

This is a configuration option customers can use to harden their systems and when this isn't properly tested we can't allow page tables in system memory.

Regards,
Christian.

Am 28.08.23 um 13:23 schrieb Zhang, Yifan:

Quoted 3 lines

[Public]

Not yet. It will be only enabled for gfx10.3.3 and later APU

initially, IOMMU is pass through in these ASIC.

Quoted 6 lines

-----Original Message-----
From: Christian König <[email protected]>
Sent: Monday, August 28, 2023 5:41 PM
To: Zhang, Yifan <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig,

Christian <[email protected]>

Quoted 1 line

Subject: Re: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT

memory for gfx10 onwards APUs

Quoted 15 lines

Is that now validated with IOMMU in non pass through mode?

Christian.

Am 28.08.23 um 10:58 schrieb Zhang, Yifan:

Quoted 9 lines

[AMD Official Use Only - General]

Ping

-----Original Message-----
From: Zhang, Yifan <[email protected]>
Sent: Friday, August 25, 2023 8:34 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig,

Christian <[email protected]>; Zhang, Yifan <[email protected]>

Quoted 1 line
Quoted 1 line

Subject: [PATCH v3 2/2] drm/amdgpu: Put page tables to GTT memory

for gfx10 onwards APUs

Quoted 2 lines
Quoted 2 lines

To decrease VRAM pressure for APUs, put page tables to GTT domain

for gfx10 and newer APUs.

Quoted 9 lines

Review

Quoted 9 lines

v2: only enable it for gfx10 and newer APUs (Alex, Christian)

---
    drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c | 9 ++++++---

    1 file changed, 6 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c

Quoted 4 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c int amdgpu_vm_pt_create(struct amdgpu_device

Quoted 4 lines

index 96d601e209b8..4603d87c61a0 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c +0 -0
@@ -515,10 +515,13 @@ int amdgpu_vm_pt_create(struct amdgpu_device 

*adev, struct amdgpu_vm *vm,

Quoted 19 lines
Quoted 19 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c +6 -3
            bp.size = amdgpu_vm_pt_size(adev, level);
            bp.byte_align = AMDGPU_GPU_PAGE_SIZE;
 
-       if (!adev->gmc.is_app_apu)
-               bp.domain = AMDGPU_GEM_DOMAIN_VRAM;
-       else
+       if (adev->gmc.is_app_apu ||
+               ((adev->flags & AMD_IS_APU) &&
+ (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(10, 3, 3))))
                    bp.domain = AMDGPU_GEM_DOMAIN_GTT;
+       else
+               bp.domain = AMDGPU_GEM_DOMAIN_VRAM;
+
 
            bp.domain = amdgpu_bo_get_preferred_domain(adev, bp.domain);

           bp.flags = AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS | --
2.37.3