mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
gpu: nvgpu: accept user vma size in vm init
Modify nvgpu_vm_init to accept low_hole, user_reserved and kernel_reserved. This will simplify argument limit checks and make code more legible. JIRA NVGPU-5302 Change-Id: I62773dd7b06264a3b6cb8896239b24c49fa69f9b Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2394901 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@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
Alex Waterman
parent
aef3367ca5
commit
49c9f0c137
@@ -347,16 +347,15 @@ static int init_mm(struct unit_module *m, struct gk20a *g)
|
||||
low_hole = SZ_4K * 16UL;
|
||||
aperture_size = GK20A_PMU_VA_SIZE;
|
||||
mm->pmu.aperture_size = GK20A_PMU_VA_SIZE;
|
||||
mm->channel.user_size = NV_MM_DEFAULT_USER_SIZE -
|
||||
NV_MM_DEFAULT_KERNEL_SIZE;
|
||||
mm->channel.user_size = NV_MM_DEFAULT_USER_SIZE;
|
||||
mm->channel.kernel_size = NV_MM_DEFAULT_KERNEL_SIZE;
|
||||
|
||||
|
||||
mm->pmu.vm = nvgpu_vm_init(g,
|
||||
g->ops.mm.gmmu.get_default_big_page_size(),
|
||||
low_hole,
|
||||
aperture_size - low_hole,
|
||||
aperture_size,
|
||||
0ULL,
|
||||
nvgpu_safe_sub_u64(aperture_size, low_hole),
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
@@ -953,7 +952,7 @@ static int check_pte_invalidated(struct unit_module *m, struct gk20a *g,
|
||||
/* Create a VM based on requirements described in NVGPU-RQCD-45 */
|
||||
static struct vm_gk20a *init_test_req_vm(struct gk20a *g)
|
||||
{
|
||||
u64 low_hole, aperture_size, kernel_reserved;
|
||||
u64 low_hole, aperture_size, kernel_reserved, user_reserved;
|
||||
bool big_pages;
|
||||
|
||||
/* Init some common attributes */
|
||||
@@ -971,10 +970,12 @@ static struct vm_gk20a *init_test_req_vm(struct gk20a *g)
|
||||
aperture_size = 128 * SZ_1G;
|
||||
/* 1.4. Have a 4GB kernel reserved space */
|
||||
kernel_reserved = 4 * SZ_1G;
|
||||
/* 1.5. User reserved space */
|
||||
user_reserved = aperture_size - kernel_reserved - low_hole;
|
||||
|
||||
return nvgpu_vm_init(g, g->ops.mm.gmmu.get_default_big_page_size(),
|
||||
low_hole, kernel_reserved,
|
||||
aperture_size, big_pages, true, true, "testmem");
|
||||
low_hole, user_reserved, kernel_reserved,
|
||||
big_pages, true, true, "testmem");
|
||||
}
|
||||
|
||||
int test_nvgpu_page_table_c1_full(struct unit_module *m, struct gk20a *g,
|
||||
|
||||
Reference in New Issue
Block a user