From eade809c265ada214c6c47e1ad9db1706c868da0 Mon Sep 17 00:00:00 2001 From: Sami Kiminki Date: Fri, 22 May 2015 20:48:22 +0300 Subject: gpu: nvgpu: Separate kernel and user GPU VA regions Separate the kernel and userspace regions in the GPU virtual address space. Do this by reserving the last part of the GPU VA aperture for the kernel, and extend GPU VA aperture accordingly for regular address spaces. This prevents the kernel polluting the userspace-visible GPU VA regions, and thus, makes the success of fixed-address mapping more predictable. Bug 200077571 Change-Id: I63f0e73d4c815a4a9fa4a9ce568709974690ef0f Signed-off-by: Sami Kiminki Reviewed-on: http://git-master/r/747191 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/vgpu/mm_vgpu.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/vgpu/mm_vgpu.c') diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c index c73037b6..2b23c4e6 100644 --- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c @@ -34,9 +34,12 @@ static int vgpu_init_mm_setup_sw(struct gk20a *g) mm->g = g; /*TBD: make channel vm size configurable */ - mm->channel.size = 1ULL << NV_GMMU_VA_RANGE; + mm->channel.user_size = NV_MM_DEFAULT_USER_SIZE; + mm->channel.kernel_size = NV_MM_DEFAULT_KERNEL_SIZE; - gk20a_dbg_info("channel vm size: %dMB", (int)(mm->channel.size >> 20)); + gk20a_dbg_info("channel vm size: user %dMB kernel %dMB", + (int)(mm->channel.user_size >> 20), + (int)(mm->channel.kernel_size >> 20)); /* gk20a_init_gpu_characteristics expects this to be populated */ vm->big_page_size = big_page_size; @@ -276,8 +279,8 @@ static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share, vm->big_page_size = big_page_size; vm->va_start = big_page_size << 10; /* create a one pde hole */ - vm->va_limit = mm->channel.size; /* note this means channel.size is - really just the max */ + vm->va_limit = mm->channel.user_size; /* note this means channel.size + is really just the max */ msg.cmd = TEGRA_VGPU_CMD_AS_ALLOC_SHARE; msg.handle = platform->virt_handle; -- cgit v1.2.2