aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/4166-Fix-SVM-missing-on-Raven.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.14.71/4166-Fix-SVM-missing-on-Raven.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.14.71/4166-Fix-SVM-missing-on-Raven.patch85
1 files changed, 85 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.14.71/4166-Fix-SVM-missing-on-Raven.patch b/common/recipes-kernel/linux/linux-yocto-4.14.71/4166-Fix-SVM-missing-on-Raven.patch
new file mode 100644
index 00000000..f5ef7205
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.14.71/4166-Fix-SVM-missing-on-Raven.patch
@@ -0,0 +1,85 @@
+From 709b7d9804f9a25e771b3aed96902313ca65b8ca Mon Sep 17 00:00:00 2001
+From: Yong Zhao <yong.zhao@amd.com>
+Date: Thu, 5 Apr 2018 15:37:09 -0400
+Subject: [PATCH 4166/5725] Fix SVM missing on Raven
+
+gpuvm_base and gpuvm_limit are used in Thunk to reserve SVM, but we
+accidentally set them as 0, resulting in no SVM on Raven. To fix that,
+we set both the value the same as on Vega10.
+
+As part of the fix, we moved GPUVM aperture initialization into
+ASIC-specific kfd_init_apertures_* functions for all ASICs.
+
+Fix: SWDEV-149576
+
+Change-Id: I76ab262900ed8880944b755080f93dca5c8ea8bb
+Signed-off-by: Yong Zhao <yong.zhao@amd.com>
+---
+ drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c | 36 +++++++++++++++++++++-------
+ 1 file changed, 28 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c b/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c
+index 2c00711..5672710 100644
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c
+@@ -332,9 +332,22 @@ void kfd_init_apertures_vi(struct kfd_process_device *pdd, uint8_t id)
+ pdd->lds_base = MAKE_LDS_APP_BASE_VI();
+ pdd->lds_limit = MAKE_LDS_APP_LIMIT(pdd->lds_base);
+
+- pdd->gpuvm_base = MAKE_GPUVM_APP_BASE_VI(id + 1);
+- pdd->gpuvm_limit = MAKE_GPUVM_APP_LIMIT(
+- pdd->gpuvm_base, pdd->dev->shared_resources.gpuvm_size);
++ if (!pdd->dev->device_info->needs_iommu_device) {
++ /* dGPUs: SVM aperture starting at 0
++ * with small reserved space for kernel.
++ * Set them to CANONICAL addresses.
++ */
++ pdd->gpuvm_base = SVM_USER_BASE;
++ pdd->gpuvm_limit =
++ pdd->dev->shared_resources.gpuvm_size - 1;
++ } else {
++ /* set them to non CANONICAL addresses, and no SVM is
++ * allocated.
++ */
++ pdd->gpuvm_base = MAKE_GPUVM_APP_BASE_VI(id + 1);
++ pdd->gpuvm_limit = MAKE_GPUVM_APP_LIMIT(pdd->gpuvm_base,
++ pdd->dev->shared_resources.gpuvm_size);
++ }
+
+ pdd->scratch_base = MAKE_SCRATCH_APP_BASE_VI();
+ pdd->scratch_limit = MAKE_SCRATCH_APP_LIMIT(pdd->scratch_base);
+@@ -345,6 +358,16 @@ void kfd_init_apertures_v9(struct kfd_process_device *pdd, uint8_t id)
+ pdd->lds_base = MAKE_LDS_APP_BASE_V9();
+ pdd->lds_limit = MAKE_LDS_APP_LIMIT(pdd->lds_base);
+
++ /* Raven needs SVM to support graphic handle, etc. Leave the small
++ * reserved space before SVM on Raven as well, even though we don't
++ * have to.
++ * Set gpuvm_base and gpuvm_limit to CANONICAL addresses so that they
++ * are used in Thunk to reserve SVM.
++ */
++ pdd->gpuvm_base = SVM_USER_BASE;
++ pdd->gpuvm_limit =
++ pdd->dev->shared_resources.gpuvm_size - 1;
++
+ pdd->scratch_base = MAKE_SCRATCH_APP_BASE_V9();
+ pdd->scratch_limit = MAKE_SCRATCH_APP_LIMIT(pdd->scratch_base);
+ }
+@@ -397,12 +420,9 @@ int kfd_init_apertures(struct kfd_process *process)
+ }
+
+ if (!dev->device_info->needs_iommu_device) {
+- /* dGPUs: SVM aperture starting at 0
+- * with small reserved space for kernel
++ /* dGPUs: the reserved space for kernel
++ * before SVM
+ */
+- pdd->gpuvm_base = SVM_USER_BASE;
+- pdd->gpuvm_limit =
+- dev->shared_resources.gpuvm_size - 1;
+ pdd->qpd.cwsr_base = SVM_CWSR_BASE;
+ pdd->qpd.ib_base = SVM_IB_BASE;
+ }
+--
+2.7.4
+