mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
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>
This commit is contained in:
committed by
mobile promotions
parent
d91ea322e1
commit
f3d22faef8
@@ -97,14 +97,6 @@ void vgpu_locked_gmmu_unmap(struct vm_gk20a *vm,
|
||||
|
||||
gk20a_dbg_fn("");
|
||||
|
||||
if (va_allocated) {
|
||||
err = __nvgpu_vm_free_va(vm, vaddr, pgsz_idx);
|
||||
if (err) {
|
||||
nvgpu_err(g, "failed to free va");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
msg.cmd = TEGRA_VGPU_CMD_AS_UNMAP;
|
||||
msg.handle = vgpu_get_handle(g);
|
||||
p->handle = vm->handle;
|
||||
@@ -113,6 +105,11 @@ void vgpu_locked_gmmu_unmap(struct vm_gk20a *vm,
|
||||
if (err || msg.ret)
|
||||
nvgpu_err(g, "failed to update gmmu ptes on unmap");
|
||||
|
||||
if (va_allocated) {
|
||||
err = __nvgpu_vm_free_va(vm, vaddr, pgsz_idx);
|
||||
if (err)
|
||||
nvgpu_err(g, "failed to free va");
|
||||
}
|
||||
/* TLB invalidate handled on server side */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user