summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSami Kiminki <skiminki@nvidia.com>2015-05-04 11:41:23 -0400
committerTerje Bergstrom <tbergstrom@nvidia.com>2015-11-18 12:45:07 -0500
commit9d2c9072c8b9a7742db3974d6027df9d44e0953f (patch)
tree15ed7e5a3495db6032b43381641d102837decfad /include
parent503d3a0b1002685e65efb8b99a2362117ee62104 (diff)
gpu: nvgpu: User-space managed address space support
Implement NVGPU_GPU_IOCTL_ALLOC_AS_FLAGS_USERSPACE_MANAGED, which enables creating userspace-managed GPU address spaces. When an address space is marked as userspace-managed, the following changes are in effect: - Only fixed-address mappings are allowed. - VA space allocation for fixed-address mappings is not required, except to mark space as sparse. - Maps and unmaps are always immediate. In particular, the mapping ref increments at kickoffs and decrements at job completion are skipped. Bug 1614735 Bug 1623949 Bug 1660392 Change-Id: I834fe19b3f65e9b02c268952383eddee0e465759 Signed-off-by: Sami Kiminki <skiminki@nvidia.com> Reviewed-on: http://git-master/r/738558 Reviewed-on: http://git-master/r/833253 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/nvgpu.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h
index 6a8e44c5..d2b5ceb8 100644
--- a/include/uapi/linux/nvgpu.h
+++ b/include/uapi/linux/nvgpu.h
@@ -106,6 +106,8 @@ struct nvgpu_gpu_zbc_query_table_args {
106#define NVGPU_GPU_FLAGS_SUPPORT_CYCLE_STATS (1 << 4) 106#define NVGPU_GPU_FLAGS_SUPPORT_CYCLE_STATS (1 << 4)
107/* NVGPU_IOCTL_CHANNEL_CYCLE_STATS_SNAPSHOT is available */ 107/* NVGPU_IOCTL_CHANNEL_CYCLE_STATS_SNAPSHOT is available */
108#define NVGPU_GPU_FLAGS_SUPPORT_CYCLE_STATS_SNAPSHOT (1 << 6) 108#define NVGPU_GPU_FLAGS_SUPPORT_CYCLE_STATS_SNAPSHOT (1 << 6)
109/* User-space managed address spaces support */
110#define NVGPU_GPU_FLAGS_SUPPORT_USERSPACE_MANAGED_AS (1 << 7)
109 111
110struct nvgpu_gpu_characteristics { 112struct nvgpu_gpu_characteristics {
111 __u32 arch; 113 __u32 arch;
@@ -239,7 +241,22 @@ struct nvgpu_gpu_mark_compressible_write_args {
239struct nvgpu_alloc_as_args { 241struct nvgpu_alloc_as_args {
240 __u32 big_page_size; 242 __u32 big_page_size;
241 __s32 as_fd; 243 __s32 as_fd;
242 __u64 reserved; /* must be zero */ 244
245/*
246 * The GPU address space will be managed by the userspace. This has
247 * the following changes in functionality:
248 * 1. All non-fixed-offset user mappings are rejected (i.e.,
249 * fixed-offset only)
250 * 2. Address space does not need to be allocated for fixed-offset
251 * mappings, except to mark sparse address space areas.
252 * 3. Maps and unmaps are immediate. In particular, mapping ref
253 * increments at kickoffs and decrements at job completion are
254 * bypassed.
255 */
256#define NVGPU_GPU_IOCTL_ALLOC_AS_FLAGS_USERSPACE_MANAGED (1 << 0)
257 __u32 flags;
258
259 __u32 reserved; /* must be zero */
243}; 260};
244 261
245struct nvgpu_gpu_open_tsg_args { 262struct nvgpu_gpu_open_tsg_args {