Skip to content

Commit 0f35b0a

Browse files
fee1-deadalexdeucher
authored andcommitted
Revert "drm/amdkfd: Relocate TBA/TMA to opposite side of VM hole"
That commit causes NULL pointer dereferences in dmesgs when running applications using ROCm, including clinfo, blender, and PyTorch, since v6.6.1. Revert it to fix blender again. This reverts commit 96c211f. Closes: ROCm/ROCm#2596 Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2991 Reviewed-by: Jay Cornwall <jay.cornwall@amd.com> Signed-off-by: Kaibo Ma <ent3rm4n@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent c966dc0 commit 0f35b0a

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,6 @@ static void kfd_init_apertures_vi(struct kfd_process_device *pdd, uint8_t id)
330330
pdd->gpuvm_limit =
331331
pdd->dev->kfd->shared_resources.gpuvm_size - 1;
332332

333-
/* 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-
339333
pdd->scratch_base = MAKE_SCRATCH_APP_BASE_VI();
340334
pdd->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)
345339
pdd->lds_base = MAKE_LDS_APP_BASE_V9();
346340
pdd->lds_limit = MAKE_LDS_APP_LIMIT(pdd->lds_base);
347341

348-
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;
349349
pdd->gpuvm_limit =
350350
pdd->dev->kfd->shared_resources.gpuvm_size - 1;
351351

352352
pdd->scratch_base = MAKE_SCRATCH_APP_BASE_V9();
353353
pdd->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
}
361355

362356
int kfd_init_apertures(struct kfd_process *process)
@@ -413,6 +407,12 @@ int kfd_init_apertures(struct kfd_process *process)
413407
return -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
}
417417

418418
dev_dbg(kfd_device, "node id %u\n", id);

0 commit comments

Comments
 (0)