mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 09:57:08 +03:00
gpu: nvgpu: API updates for newer kernel
access_ok, totalram_pages and zap_vma_ptes are updated in the newer kernel. Update accordingly. Bug 2834141 Change-Id: I3097308740f1af3092ac0a5ac2f0146db8148e12 Signed-off-by: Sagar Kamble <skamble@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2294097 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: Debarshi Dutta <ddutta@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
d0d8ef79d1
commit
6c4a0bb6cd
@@ -1633,8 +1633,13 @@ static int nvgpu_gpu_set_deterministic_opts(struct gk20a *g,
|
||||
}
|
||||
|
||||
/* Trivial sanity check first */
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
|
||||
if (!access_ok(user_channels,
|
||||
args->num_channels * sizeof(int))) {
|
||||
#else
|
||||
if (!access_ok(VERIFY_READ, user_channels,
|
||||
args->num_channels * sizeof(int))) {
|
||||
#endif
|
||||
err = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
@@ -2095,8 +2100,13 @@ static void alter_usermode_mapping(struct gk20a *g,
|
||||
* b) !poweroff and vmap_mapped -> do nothing as already mapped
|
||||
*/
|
||||
if (poweroff && vma_mapped) {
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
|
||||
zap_vma_ptes(vma, vma->vm_start, vma->vm_end - vma->vm_start);
|
||||
err = 0;
|
||||
#else
|
||||
err = zap_vma_ptes(vma, vma->vm_start,
|
||||
vma->vm_end - vma->vm_start);
|
||||
#endif
|
||||
if (err == 0) {
|
||||
vma->vm_flags = VM_NONE;
|
||||
priv->usermode_vma.vma_mapped = false;
|
||||
|
||||
Reference in New Issue
Block a user