summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/mm
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2018-01-16 19:44:18 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-01-19 20:29:13 -0500
commitb8dbc853d79a086c30b4be5e15d25cc305320e8b (patch)
tree626089c643c490116d9a515f224b6e683cc386d0 /drivers/gpu/nvgpu/common/mm
parent137006fe783a0829a26f4f179f19f3d73fc050c4 (diff)
gpu: nvgpu: Use real PDE size to determine pte_blk_order
In the buddy allocator use the actual size of the PDE to determine the pte_blk_order field which is used to determine what page size a buddy has (or doesn't). Previously this was just set as the large page size times 1024 which would over allocate PDE ranges for Pascal+ chips. This caused userspace, which was using the real PDE size, to sometime allocate small and large pages in what the buddy allocator mistakenly thought was one PDE. Bug 200105199 Change-Id: I7ab7db7962015fc268bad61b558a18704133e1cb Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1639731 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/mm')
-rw-r--r--drivers/gpu/nvgpu/common/mm/buddy_allocator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/buddy_allocator.c b/drivers/gpu/nvgpu/common/mm/buddy_allocator.c
index a2546e9d..e5a9b62b 100644
--- a/drivers/gpu/nvgpu/common/mm/buddy_allocator.c
+++ b/drivers/gpu/nvgpu/common/mm/buddy_allocator.c
@@ -1255,7 +1255,7 @@ int __nvgpu_buddy_allocator_init(struct gk20a *g, struct nvgpu_allocator *__a,
1255 1255
1256 a->vm = vm; 1256 a->vm = vm;
1257 if (flags & GPU_ALLOC_GVA_SPACE) { 1257 if (flags & GPU_ALLOC_GVA_SPACE) {
1258 pde_size = ((u64)vm->big_page_size) << 10; 1258 pde_size = 1ULL << nvgpu_vm_pde_coverage_bit_count(vm);
1259 a->pte_blk_order = balloc_get_order(a, pde_size); 1259 a->pte_blk_order = balloc_get_order(a, pde_size);
1260 } 1260 }
1261 1261