mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
nvgpu: don't unmap unallocated global ctx buffers
In nvgpu_gr_ctx_unmap_global_ctx_buffers(), don't unmap buffers that were never allocated. Issue warning in nvgpu_gmmu_do_update_page_table() if unmapping and virt_addr is 0. Bug 200648688 Bug 3093183 Change-Id: Ia2cb5f40bbb6c35575705571eb8c900f4495d58e Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2408315 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
Alex Waterman
parent
f5f9cd9cba
commit
dac7c587e9
@@ -182,9 +182,11 @@ static void nvgpu_gr_ctx_unmap_global_ctx_buffers(struct gk20a *g,
|
||||
nvgpu_log_fn(g, " ");
|
||||
|
||||
for (i = 0U; i < NVGPU_GR_CTX_VA_COUNT; i++) {
|
||||
if (g_bfr_va[i] != 0ULL) {
|
||||
nvgpu_gr_global_ctx_buffer_unmap(global_ctx_buffer,
|
||||
g_bfr_index[i], vm, g_bfr_va[i]);
|
||||
}
|
||||
}
|
||||
|
||||
(void) memset(g_bfr_va, 0, sizeof(gr_ctx->global_ctx_buffer_va));
|
||||
(void) memset(g_bfr_index, 0, sizeof(gr_ctx->global_ctx_buffer_index));
|
||||
|
||||
@@ -726,6 +726,8 @@ static int nvgpu_gmmu_do_update_page_table(struct vm_gk20a *vm,
|
||||
* This is considered an unmap. Just pass in 0 as the physical
|
||||
* address for the entire GPU range.
|
||||
*/
|
||||
nvgpu_assert(virt_addr != 0ULL);
|
||||
|
||||
err = nvgpu_set_pd_level(vm, &vm->pdb,
|
||||
0U,
|
||||
0,
|
||||
|
||||
Reference in New Issue
Block a user