From 68dbfedd4f837d1bf2bab128500140f5d8cfadac Mon Sep 17 00:00:00 2001 From: David Nieto Date: Thu, 26 Oct 2017 15:00:47 -0700 Subject: gpu: nvgpu: fix pte location functions Modify the recursive loop in pte_find to make sure it is targeting the proper pde page size. JIRA NVGPUGV100-36 Change-Id: Ib3673d8d9f1bd3c907d532f9e2562ecdc5dda4af Signed-off-by: David Nieto Reviewed-on: https://git-master.nvidia.com/r/1586739 Reviewed-by: Alex Waterman Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: svc-mobile-coverity Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/mm/gmmu.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/gpu/nvgpu/common/mm') diff --git a/drivers/gpu/nvgpu/common/mm/gmmu.c b/drivers/gpu/nvgpu/common/mm/gmmu.c index 1eed3a3b..d6aaf8cd 100644 --- a/drivers/gpu/nvgpu/common/mm/gmmu.c +++ b/drivers/gpu/nvgpu/common/mm/gmmu.c @@ -828,6 +828,11 @@ static int __nvgpu_locate_pte(struct gk20a *g, struct vm_gk20a *vm, if (!pd_next->mem) return -EINVAL; + attrs->pgsz = l->get_pgsz(g, pd, pd_idx); + + if (attrs->pgsz >= gmmu_nr_page_sizes) + return -EINVAL; + return __nvgpu_locate_pte(g, vm, pd_next, vaddr, lvl + 1, attrs, data, pd_out, pd_idx_out, -- cgit v1.2.2