aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdkfd/kfd_svm.h
diff options
context:
space:
mode:
authorGravatar Felix Kuehling <Felix.Kuehling@amd.com> 2021-06-10 18:39:56 -0400
committerGravatar Alex Deucher <alexander.deucher@amd.com> 2021-06-15 17:25:41 -0400
commit5a75ea56e36937d7d01545c53fae91e234ea0de6 (patch)
treeaa961556c6a9070909405505b7b839aa2cef91bb /drivers/gpu/drm/amd/amdkfd/kfd_svm.h
parentdrm/amd/display: Extend AUX timeout for DP initial reads (diff)
downloadlinux-5a75ea56e36937d7d01545c53fae91e234ea0de6.tar.gz
linux-5a75ea56e36937d7d01545c53fae91e234ea0de6.tar.bz2
linux-5a75ea56e36937d7d01545c53fae91e234ea0de6.zip
drm/amdkfd: Disable SVM per GPU, not per process
When some GPUs don't support SVM, don't disabe it for the entire process. That would be inconsistent with the information the process got from the topology, which indicates SVM support per GPU. Instead disable SVM support only for the unsupported GPUs. This is done by checking any per-device attributes against the bitmap of supported GPUs. Also use the supported GPU bitmap to initialize access bitmaps for new SVM address ranges. Don't handle recoverable page faults from unsupported GPUs. (I don't think there will be unsupported GPUs that can generate recoverable page faults. But better safe than sorry.) Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Reviewed-by: Philip Yang <philip.yang@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.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.h b/drivers/gpu/drm/amd/amdkfd/kfd_svm.h
index 573f984b81fe..0c0fc399395e 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.h
@@ -175,6 +175,11 @@ void svm_range_dma_unmap(struct device *dev, dma_addr_t *dma_addr,
void svm_range_free_dma_mappings(struct svm_range *prange);
void svm_range_prefault(struct svm_range *prange, struct mm_struct *mm);
+/* SVM API and HMM page migration work together, device memory type
+ * is initialized to not 0 when page migration register device memory.
+ */
+#define KFD_IS_SVM_API_SUPPORTED(dev) ((dev)->pgmap.type != 0)
+
#else
struct kfd_process;
@@ -201,6 +206,8 @@ static inline int svm_range_schedule_evict_svm_bo(
return -EINVAL;
}
+#define KFD_IS_SVM_API_SUPPORTED(dev) false
+
#endif /* IS_ENABLED(CONFIG_HSA_AMD_SVM) */
#endif /* KFD_SVM_H_ */