summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAparna Das <aparnad@nvidia.com>2018-04-09 16:49:38 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-04-10 14:23:39 -0400
commitf3d22faef874901808746d957d2f97e6ca07a977 (patch)
tree9c5203faaa354060872317a46a270ace9108603c
parentd91ea322e1a6ae51ae8e017d09bfaf3e139ecf2d (diff)
nvgpu: vgpu: fix gmmu unmap
Unmap gpu va at vsrv before freeing the address at guest to ensure there is no valid IPA to PA mapping when the address is reallocated at guest. Bug 200399982 Change-Id: If9375c69eac0f0dee23995f61b6486465618bf10 Signed-off-by: Aparna Das <aparnad@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1691532 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/vgpu/mm_vgpu.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
index c10a1982..cba77ecf 100644
--- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
@@ -97,14 +97,6 @@ void vgpu_locked_gmmu_unmap(struct vm_gk20a *vm,
97 97
98 gk20a_dbg_fn(""); 98 gk20a_dbg_fn("");
99 99
100 if (va_allocated) {
101 err = __nvgpu_vm_free_va(vm, vaddr, pgsz_idx);
102 if (err) {
103 nvgpu_err(g, "failed to free va");
104 return;
105 }
106 }
107
108 msg.cmd = TEGRA_VGPU_CMD_AS_UNMAP; 100 msg.cmd = TEGRA_VGPU_CMD_AS_UNMAP;
109 msg.handle = vgpu_get_handle(g); 101 msg.handle = vgpu_get_handle(g);
110 p->handle = vm->handle; 102 p->handle = vm->handle;
@@ -113,6 +105,11 @@ void vgpu_locked_gmmu_unmap(struct vm_gk20a *vm,
113 if (err || msg.ret) 105 if (err || msg.ret)
114 nvgpu_err(g, "failed to update gmmu ptes on unmap"); 106 nvgpu_err(g, "failed to update gmmu ptes on unmap");
115 107
108 if (va_allocated) {
109 err = __nvgpu_vm_free_va(vm, vaddr, pgsz_idx);
110 if (err)
111 nvgpu_err(g, "failed to free va");
112 }
116 /* TLB invalidate handled on server side */ 113 /* TLB invalidate handled on server side */
117} 114}
118 115