Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvproxy: add missing UVM_UNMAP_EXTERNAL ioctl #10610

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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