Add NV_MEMORY_FABRIC to nvproxy.

Fixes #9372

PiperOrigin-RevId: 567816690
This commit is contained in:
Jing Chen
2023-09-23 00:47:37 -07:00
committed by gVisor bot
parent b5dea0ea09
commit e81e0c72a7
2 changed files with 22 additions and 0 deletions
+20
View File
@@ -23,6 +23,7 @@ const (
NV01_MEMORY_SYSTEM_OS_DESCRIPTOR = 0x00000071
NV01_EVENT_OS_EVENT = 0x00000079
NV01_DEVICE_0 = 0x00000080
NV_MEMORY_FABRIC = 0x000000f8
NV20_SUBDEVICE_0 = 0x00002080
NV50_THIRD_PARTY_P2P = 0x0000503c
GT200_DEBUGGER = 0x000083de
@@ -220,3 +221,22 @@ type NV_HOPPER_USERMODE_A_PARAMS struct {
Bar1Mapping uint8
Priv uint8
}
// +marshal
type nv00f8Map struct {
offset uint64
hVidMem Handle
flags uint32
}
// NV00F8_ALLOCATION_PARAMETERS is the alloc param type for NV_MEMORY_FABRIC,
// from src/common/sdk/nvidia/inc/class/cl00f8.h
//
// +marshal
type NV00F8_ALLOCATION_PARAMETERS struct {
Alignment uint64
AllocSize uint64
PageSize uint32
AllocFlags uint32
Map nv00f8Map
}
+2
View File
@@ -782,6 +782,8 @@ func rmAlloc(fi *frontendIoctlState) (uintptr, error) {
return rmAllocSimple[nvgpu.NV_HOPPER_USERMODE_A_PARAMS](fi, &ioctlParams, isNVOS64)
case nvgpu.GF100_SUBDEVICE_MASTER, nvgpu.VOLTA_USERMODE_A, nvgpu.TURING_USERMODE_A:
return rmAllocNoParams(fi, &ioctlParams, isNVOS64)
case nvgpu.NV_MEMORY_FABRIC:
return rmAllocSimple[nvgpu.NV00F8_ALLOCATION_PARAMETERS](fi, &ioctlParams, isNVOS64)
default:
fi.ctx.Warningf("nvproxy: unknown allocation class %#08x", ioctlParams.HClass)
return 0, linuxerr.EINVAL