summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
authorSourab Gupta <sourabg@nvidia.com>2017-11-23 09:27:18 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-01-04 03:36:08 -0500
commitfcdde6ad8ae0aa22b8edeb6a9462e7f2a1a213ce (patch)
tree655df3a8ffec6d8864da86423448db05519167bf /drivers/gpu/nvgpu/include
parent7240b3c2515413583722e35f9ef2a7745961531d (diff)
gpu: nvgpu: add guest_managed field in vm_gk20a
Add a field in vm_gk20a to identify guest managed VM, with the corresponding checks to ensure that there's no kernel section for guest managed VMs. Also make the __nvgpu_vm_init function available globally, so that the vm can be allocated elsewhere, requisite fields set, and passed to the function to initialize the vm. Change-Id: Iad841d1b8ff9c894fe9d350dc43d74247e9c5512 Signed-off-by: Sourab Gupta <sourabg@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1617171 Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/vm.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/vm.h b/drivers/gpu/nvgpu/include/nvgpu/vm.h
index e091f181..1689444c 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/vm.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/vm.h
@@ -150,6 +150,7 @@ struct vm_gk20a {
150 150
151 bool big_pages; /* enable large page support */ 151 bool big_pages; /* enable large page support */
152 bool enable_ctag; 152 bool enable_ctag;
153 bool guest_managed; /* whether the vm addr space is managed by guest */
153 154
154 u32 big_page_size; 155 u32 big_page_size;
155 156
@@ -284,6 +285,19 @@ int nvgpu_insert_mapped_buf(struct vm_gk20a *vm,
284void nvgpu_remove_mapped_buf(struct vm_gk20a *vm, 285void nvgpu_remove_mapped_buf(struct vm_gk20a *vm,
285 struct nvgpu_mapped_buf *mapped_buffer); 286 struct nvgpu_mapped_buf *mapped_buffer);
286 287
288/*
289 * Initialize a preallocated vm
290 */
291int __nvgpu_vm_init(struct mm_gk20a *mm,
292 struct vm_gk20a *vm,
293 u32 big_page_size,
294 u64 low_hole,
295 u64 kernel_reserved,
296 u64 aperture_size,
297 bool big_pages,
298 bool userspace_managed,
299 char *name);
300
287struct vm_gk20a *nvgpu_vm_init(struct gk20a *g, 301struct vm_gk20a *nvgpu_vm_init(struct gk20a *g,
288 u32 big_page_size, 302 u32 big_page_size,
289 u64 low_hole, 303 u64 low_hole,