@@ -330,12 +330,6 @@ static void kfd_init_apertures_vi(struct kfd_process_device *pdd, uint8_t id)
330330pdd->gpuvm_limit =
331331pdd->dev->kfd->shared_resources.gpuvm_size - 1;
332332333-/* dGPUs: the reserved space for kernel
334- * before SVM
335- */
336-pdd->qpd.cwsr_base = SVM_CWSR_BASE;
337-pdd->qpd.ib_base = SVM_IB_BASE;
338-339333pdd->scratch_base = MAKE_SCRATCH_APP_BASE_VI();
340334pdd->scratch_limit = MAKE_SCRATCH_APP_LIMIT(pdd->scratch_base);
341335}
@@ -345,18 +339,18 @@ static void kfd_init_apertures_v9(struct kfd_process_device *pdd, uint8_t id)
345339pdd->lds_base = MAKE_LDS_APP_BASE_V9();
346340pdd->lds_limit = MAKE_LDS_APP_LIMIT(pdd->lds_base);
347341348-pdd->gpuvm_base = PAGE_SIZE;
342+/* Raven needs SVM to support graphic handle, etc. Leave the small
343+ * reserved space before SVM on Raven as well, even though we don't
344+ * have to.
345+ * Set gpuvm_base and gpuvm_limit to CANONICAL addresses so that they
346+ * are used in Thunk to reserve SVM.
347+ */
348+pdd->gpuvm_base = SVM_USER_BASE;
349349pdd->gpuvm_limit =
350350pdd->dev->kfd->shared_resources.gpuvm_size - 1;
351351352352pdd->scratch_base = MAKE_SCRATCH_APP_BASE_V9();
353353pdd->scratch_limit = MAKE_SCRATCH_APP_LIMIT(pdd->scratch_base);
354-355-/*
356- * Place TBA/TMA on opposite side of VM hole to prevent
357- * stray faults from triggering SVM on these pages.
358- */
359-pdd->qpd.cwsr_base = pdd->dev->kfd->shared_resources.gpuvm_size;
360354}
361355362356int kfd_init_apertures(struct kfd_process *process)
@@ -413,6 +407,12 @@ int kfd_init_apertures(struct kfd_process *process)
413407return -EINVAL;
414408 }
415409 }
410+411+/* dGPUs: the reserved space for kernel
412+ * before SVM
413+ */
414+pdd->qpd.cwsr_base = SVM_CWSR_BASE;
415+pdd->qpd.ib_base = SVM_IB_BASE;
416416 }
417417418418dev_dbg(kfd_device, "node id %u\n", id);