From 525489f26eba34804de93a07d6035fc3458deeab Mon Sep 17 00:00:00 2001 From: Thomas Fleury Date: Tue, 1 Aug 2017 17:17:34 -0700 Subject: gpu: nvgpu: fix debugfs to disable big pages After setting 'Y' in disable_bigpage, in native SMMU case, we could still see 64K GMMU pages beeing used. Fixed the following: - enforce disable_bigpage in nvgpu_vm_map - update GPU characteristics so that new clients know whether or not big pages are enabled. For instance this may affect how CUDA requests memory mapping. JIRA EVLR-1694 Change-Id: I62841096add3bd798c5c11090054f82c8a2be832 Signed-off-by: Thomas Fleury Reviewed-on: https://git-master.nvidia.com/r/1532429 Reviewed-by: Richard Zhao GVS: Gerrit_Virtual_Submit Reviewed-by: svccoveritychecker Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/common/linux/vm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/common/linux/vm.c') diff --git a/drivers/gpu/nvgpu/common/linux/vm.c b/drivers/gpu/nvgpu/common/linux/vm.c index d47d6bb1..dec05209 100644 --- a/drivers/gpu/nvgpu/common/linux/vm.c +++ b/drivers/gpu/nvgpu/common/linux/vm.c @@ -260,7 +260,10 @@ u64 nvgpu_vm_map(struct vm_gk20a *vm, map_offset = offset_align; bfr.align = nvgpu_get_buffer_alignment(g, sgl, aperture); - bfr.pgsz_idx = __get_pte_size(vm, map_offset, + if (g->mm.disable_bigpage) + bfr.pgsz_idx = gmmu_page_size_small; + else + bfr.pgsz_idx = __get_pte_size(vm, map_offset, min_t(u64, bfr.size, bfr.align)); mapping_size = mapping_size ? mapping_size : bfr.size; -- cgit v1.2.2