mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: keep usermode region flags on railgate
When the gpu is railgated, the usermode region mappings must be cleared. This is already done with zap_vma_ptes() but as an extra measure the vm flags are also zeroed. That is an oversight, so delete that code; in particular the VM_DONTCOPY flag is important so that the mapping does not follow fork, as the design does not allow that. Bug 200726443 Change-Id: I84ed4e38b7de1f0c8cbf4cca6276abfa2409ac3b Signed-off-by: Konsta Hölttä <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2538481 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com> Reviewed-by: Sagar Kamble <skamble@nvidia.com> Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
524418980d
commit
e44ece25ba
@@ -87,7 +87,6 @@ struct gk20a_ctrl_priv {
|
||||
struct nvgpu_list_node list;
|
||||
struct {
|
||||
struct vm_area_struct *vma;
|
||||
unsigned long flags;
|
||||
bool vma_mapped;
|
||||
} usermode_vma;
|
||||
};
|
||||
@@ -2306,7 +2305,6 @@ int gk20a_ctrl_dev_mmap(struct file *filp, struct vm_area_struct *vma)
|
||||
vma->vm_end - vma->vm_start, vma->vm_page_prot);
|
||||
if (!err) {
|
||||
priv->usermode_vma.vma = vma;
|
||||
priv->usermode_vma.flags = vma->vm_flags;
|
||||
vma->vm_private_data = priv;
|
||||
priv->usermode_vma.vma_mapped = true;
|
||||
}
|
||||
@@ -2361,19 +2359,16 @@ static int alter_usermode_mapping(struct gk20a *g,
|
||||
vma->vm_end - vma->vm_start);
|
||||
#endif
|
||||
if (err == 0) {
|
||||
vma->vm_flags = VM_NONE;
|
||||
priv->usermode_vma.vma_mapped = false;
|
||||
} else {
|
||||
nvgpu_err(g, "can't remove usermode mapping");
|
||||
}
|
||||
} else {
|
||||
vma->vm_flags = priv->usermode_vma.flags;
|
||||
err = io_remap_pfn_range(vma, vma->vm_start,
|
||||
g->usermode_regs_bus_addr >> PAGE_SHIFT,
|
||||
vma->vm_end - vma->vm_start, vma->vm_page_prot);
|
||||
if (err != 0) {
|
||||
nvgpu_err(g, "can't restore usermode mapping");
|
||||
vma->vm_flags = VM_NONE;
|
||||
} else {
|
||||
priv->usermode_vma.vma_mapped = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user