drm/amdgpu: flush TLB if valid PDE turns into PTE
authorPhilip Yang <Philip.Yang@amd.com>
Wed, 12 May 2021 12:02:46 +0000 (08:02 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 20 May 2021 02:33:54 +0000 (22:33 -0400)
commitbf546940d5aa15852f58d59158965737505edc03
tree27839d0f1dacea03c4d3322af3cdf622af2fbb7a
parenta6ce1e1aab3fafbd97e39c4dc08add725f3abd66
drm/amdgpu: flush TLB if valid PDE turns into PTE

Mapping huge page, 2MB aligned address with 2MB size, uses PDE0 as PTE.
If previously valid PDE0, PDE0.V=1 and PDE0.P=0 turns into PTE, this
requires TLB flush, otherwise page table walker will not read updated
PDE0.

Change page table update mapping to return table_freed flag to indicate
the previously valid PDE may have turned into a PTE if page table is
freed.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
drivers/gpu/drm/amd/amdkfd/kfd_svm.c