Skip to content

Commit

Permalink
Implements UVM_UNMAP_EXTERNAL ioctl for nvproxy
Browse files Browse the repository at this point in the history
  • Loading branch information
luiscape committed Jul 3, 2024
1 parent 6dd4ef4 commit ee88734
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/abi/nvgpu/uvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const (
UVM_TOOLS_READ_PROCESS_MEMORY = 62
UVM_TOOLS_WRITE_PROCESS_MEMORY = 63
UVM_MAP_DYNAMIC_PARALLELISM_REGION = 65
UVM_UNMAP_EXTERNAL = 66
UVM_ALLOC_SEMAPHORE_POOL = 68
UVM_VALIDATE_VA_RANGE = 72
UVM_CREATE_EXTERNAL_RANGE = 73
Expand Down Expand Up @@ -288,6 +289,15 @@ type UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS struct {
Pad0 [4]byte
}

// +marshal
type UVM_UNMAP_EXTERNAL_PARAMS struct {
Base uint64
Length uint64
GPUUUID NvUUID
RMStatus uint32
Pad0 [4]byte
}

// +marshal
type UVM_ALLOC_SEMAPHORE_POOL_PARAMS struct {
Base uint64
Expand Down
4 changes: 4 additions & 0 deletions pkg/sentry/devices/nvproxy/seccomp_filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ func Filters() seccomp.SyscallRules {
seccomp.NonNegativeFD{},
seccomp.EqualTo(nvgpu.UVM_MAP_DYNAMIC_PARALLELISM_REGION),
},
seccomp.PerArg{
seccomp.NonNegativeFD{},
seccomp.EqualTo(nvgpu.UVM_UNMAP_EXTERNAL),
},
seccomp.PerArg{
seccomp.NonNegativeFD{},
seccomp.EqualTo(nvgpu.UVM_ALLOC_SEMAPHORE_POOL),
Expand Down
1 change: 1 addition & 0 deletions pkg/sentry/devices/nvproxy/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ func Init() {
nvgpu.UVM_DISABLE_READ_DUPLICATION: uvmIoctlSimple[nvgpu.UVM_DISABLE_READ_DUPLICATION_PARAMS],
nvgpu.UVM_MIGRATE_RANGE_GROUP: uvmIoctlSimple[nvgpu.UVM_MIGRATE_RANGE_GROUP_PARAMS],
nvgpu.UVM_MAP_DYNAMIC_PARALLELISM_REGION: uvmIoctlSimple[nvgpu.UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS],
nvgpu.UVM_UNMAP_EXTERNAL: uvmIoctlSimple[nvgpu.UVM_UNMAP_EXTERNAL_PARAMS],
nvgpu.UVM_ALLOC_SEMAPHORE_POOL: uvmIoctlSimple[nvgpu.UVM_ALLOC_SEMAPHORE_POOL_PARAMS],
nvgpu.UVM_VALIDATE_VA_RANGE: uvmIoctlSimple[nvgpu.UVM_VALIDATE_VA_RANGE_PARAMS],
nvgpu.UVM_CREATE_EXTERNAL_RANGE: uvmIoctlSimple[nvgpu.UVM_CREATE_EXTERNAL_RANGE_PARAMS],
Expand Down

0 comments on commit ee88734

Please sign in to comment.