On 06/04/2018 02:43 PM, Christian König wrote:
Actually that is not correct. According to the documentation the PRT flag should
work for huge pages as well.

Mmm, I checked the doc earlier, didn't find the PRT flag for PDE.

In CTS PRT test, the reserved PRT mapping introduces huge page mapping, so later tiled bo mapping cannot make sure the corresponding PTE is set as PRT.
Then following access triggers VM fault.

Jerry


Christian.

Am 04.06.2018 um 07:59 schrieb Zhou, David(ChunMing):
Good catch, Reviewed-by: Chunming  Zhou <david1.z...@amd.com>

-----Original Message-----
From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf Of
Junwei Zhang
Sent: Monday, June 04, 2018 10:04 AM
To: amd-gfx@lists.freedesktop.org
Cc: Zhang, Jerry <jerry.zh...@amd.com>
Subject: [PATCH] drm/amdgpu: skip huge page for PRT mapping

PRT mapping doesn't support huge page, since it's per PTE basis.

Signed-off-by: Junwei Zhang <jerry.zh...@amd.com>
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 850cd66..4ce8bb0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1111,7 +1111,8 @@ static void amdgpu_vm_handle_huge_pages(struct
amdgpu_pte_update_params *p,
      /* In the case of a mixed PT the PDE must point to it*/
      if (p->adev->asic_type >= CHIP_VEGA10 && !p->src &&
-        nptes == AMDGPU_VM_PTE_COUNT(p->adev)) {
+        nptes == AMDGPU_VM_PTE_COUNT(p->adev) &&
+        !(flags & AMDGPU_PTE_PRT)) {
          /* Set the huge page flag to stop scanning at this PDE */
          flags |= AMDGPU_PDE_PTE;
      }

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to