aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdkfd/kfd_svm.h
diff options
context:
space:
mode:
authorGravatar Alex Sierra <alex.sierra@amd.com> 2021-05-05 14:15:50 -0500
committerGravatar Alex Deucher <alexander.deucher@amd.com> 2021-07-01 00:05:41 -0400
commit1d5dbfe6c06a5269b535f8e6b13569f32c42ea60 (patch)
tree9b48ab364d61ba4a2db6418d2b4006762ead63fa /drivers/gpu/drm/amd/amdkfd/kfd_svm.h
parentdrm/amdkfd: use hmm range fault to get both domain pfns (diff)
downloadlinux-1d5dbfe6c06a5269b535f8e6b13569f32c42ea60.tar.gz
linux-1d5dbfe6c06a5269b535f8e6b13569f32c42ea60.tar.bz2
linux-1d5dbfe6c06a5269b535f8e6b13569f32c42ea60.zip
drm/amdkfd: classify and map mixed svm range pages in GPU
[Why] svm ranges can have mixed pages from device or system memory. A good example is, after a prange has been allocated in VRAM and a copy-on-write is triggered by a fork. This invalidates some pages inside the prange. Endding up in mixed pages. [How] By classifying each page inside a prange, based on its type. Device or system memory, during dma mapping call. If page corresponds to VRAM domain, a flag is set to its dma_addr entry for each GPU. Then, at the GPU page table mapping. All group of contiguous pages within the same type are mapped with their proper pte flags. v2: Instead of using ttm_res to calculate vram pfns in the svm_range. It is now done by setting the vram real physical address into drm_addr array. This makes more flexible VRAM management, plus removes the need to have a BO reference in the svm_range. v3: Remove mapping member from svm_range Signed-off-by: Alex Sierra <alex.sierra@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_svm.h')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_svm.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.h b/drivers/gpu/drm/amd/amdkfd/kfd_svm.h
index 9a7744a12dab..41115a220c2b 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.h
@@ -35,6 +35,7 @@
#include "amdgpu.h"
#include "kfd_priv.h"
+#define SVM_RANGE_VRAM_DOMAIN (1UL << 0)
#define SVM_ADEV_PGMAP_OWNER(adev)\
((adev)->hive ? (void *)(adev)->hive : (void *)(adev))
@@ -113,7 +114,6 @@ struct svm_range {
struct list_head update_list;
struct list_head remove_list;
struct list_head insert_list;
- struct amdgpu_bo_va_mapping mapping;
uint64_t npages;
dma_addr_t *dma_addr[MAX_GPU_INSTANCE];
struct ttm_resource *ttm_res;