Add support for NV_ESC_ATTACH_GPUS_TO_FD frontend ioctl.

Fixes #10272.

PiperOrigin-RevId: 624257500
This commit is contained in:
Ayush Ranjan
2024-04-12 12:22:57 -07:00
committed by gVisor bot
parent 5e9207a966
commit 0699532f69
3 changed files with 7 additions and 1 deletions
+1
View File
@@ -32,6 +32,7 @@ const (
NV_ESC_ALLOC_OS_EVENT = NV_IOCTL_BASE + 6
NV_ESC_FREE_OS_EVENT = NV_IOCTL_BASE + 7
NV_ESC_CHECK_VERSION_STR = NV_IOCTL_BASE + 10
NV_ESC_ATTACH_GPUS_TO_FD = NV_IOCTL_BASE + 12
NV_ESC_SYS_PARAMS = NV_IOCTL_BASE + 14
NV_ESC_WAIT_OPEN_COMPLETE = NV_IOCTL_BASE + 18
@@ -34,6 +34,10 @@ func Filters() seccomp.SyscallRules {
seccomp.NonNegativeFD{},
seccomp.EqualTo(frontendIoctlCmd(nvgpu.NV_ESC_CHECK_VERSION_STR, nvgpu.SizeofRMAPIVersion)),
},
seccomp.PerArg{
seccomp.NonNegativeFD{},
seccomp.MaskedEqual(notIocSizeMask, frontendIoctlCmd(nvgpu.NV_ESC_ATTACH_GPUS_TO_FD, 0)),
},
seccomp.PerArg{
seccomp.NonNegativeFD{},
seccomp.EqualTo(frontendIoctlCmd(nvgpu.NV_ESC_REGISTER_FD, nvgpu.SizeofIoctlRegisterFD)),
+2 -1
View File
@@ -155,8 +155,9 @@ func Init() {
// with the entirety of the nvproxy functionality at this version.
return &driverABI{
frontendIoctl: map[uint32]frontendIoctlHandler{
nvgpu.NV_ESC_CARD_INFO: frontendIoctlSimple, // nv_ioctl_card_info_t
nvgpu.NV_ESC_CARD_INFO: frontendIoctlSimple, // nv_ioctl_card_info_t array
nvgpu.NV_ESC_CHECK_VERSION_STR: frontendIoctlSimple, // nv_rm_api_version_t
nvgpu.NV_ESC_ATTACH_GPUS_TO_FD: frontendIoctlSimple, // NvU32 array containing GPU IDs
nvgpu.NV_ESC_SYS_PARAMS: frontendIoctlSimple, // nv_ioctl_sys_params_t
nvgpu.NV_ESC_RM_DUP_OBJECT: frontendIoctlSimple, // NVOS55_PARAMETERS
nvgpu.NV_ESC_RM_SHARE: frontendIoctlSimple, // NVOS57_PARAMETERS