mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
nvproxy: Add support for 570.86.15 driver.
Co-authored-by: Zach Koopmans <zkoopmans@google.com> PiperOrigin-RevId: 721910920
This commit is contained in:
committed by
gVisor bot
co-authored by
Zach Koopmans
parent
0f8896589f
commit
1a9abee80b
@@ -361,6 +361,16 @@ type NV_CHANNEL_ALLOC_PARAMS struct {
|
||||
HmacNonce [CC_CHAN_ALLOC_NONCE_SIZE_DWORD]uint32
|
||||
}
|
||||
|
||||
// NV_CHANNEL_ALLOC_PARAMS_V570 is the updated version of
|
||||
// NV_CHANNEL_ALLOC_PARAMS since 570.86.15.
|
||||
//
|
||||
// +marshal
|
||||
type NV_CHANNEL_ALLOC_PARAMS_V570 struct {
|
||||
NV_CHANNEL_ALLOC_PARAMS
|
||||
TPCConfigID uint32
|
||||
_ uint32
|
||||
}
|
||||
|
||||
// NVB0B5_ALLOCATION_PARAMETERS is the alloc param type for TURING_DMA_COPY_A,
|
||||
// AMPERE_DMA_COPY_A, and AMPERE_DMA_COPY_B from
|
||||
// src/common/sdk/nvidia/inc/class/clb0b5sw.h.
|
||||
|
||||
@@ -1221,6 +1221,13 @@ func rmAllocChannel(fi *frontendIoctlState, ioctlParams *nvgpu.NVOS64_PARAMETERS
|
||||
})
|
||||
}
|
||||
|
||||
// rmAllocChannelV570 is the same as rmAllocChannel, but for 570.86.15.
|
||||
func rmAllocChannelV570(fi *frontendIoctlState, ioctlParams *nvgpu.NVOS64_PARAMETERS, isNVOS64 bool) (uintptr, error) {
|
||||
return rmAllocSimpleParams(fi, ioctlParams, isNVOS64, func(fi *frontendIoctlState, ioctlParams *nvgpu.NVOS64_PARAMETERS, rightsRequested nvgpu.RS_ACCESS_MASK, allocParams *nvgpu.NV_CHANNEL_ALLOC_PARAMS_V570) {
|
||||
fi.fd.dev.nvp.objAdd(fi.ctx, ioctlParams.HRoot, ioctlParams.HObjectNew, ioctlParams.HClass, newRmAllocObject(fi.fd, ioctlParams, rightsRequested, allocParams), ioctlParams.HObjectParent, allocParams.HVASpace, allocParams.HContextShare)
|
||||
})
|
||||
}
|
||||
|
||||
func rmAllocContextShare(fi *frontendIoctlState, ioctlParams *nvgpu.NVOS64_PARAMETERS, isNVOS64 bool) (uintptr, error) {
|
||||
return rmAllocSimpleParams(fi, ioctlParams, isNVOS64, func(fi *frontendIoctlState, ioctlParams *nvgpu.NVOS64_PARAMETERS, rightsRequested nvgpu.RS_ACCESS_MASK, allocParams *nvgpu.NV_CTXSHARE_ALLOCATION_PARAMETERS) {
|
||||
// See
|
||||
|
||||
@@ -839,7 +839,24 @@ func Init() {
|
||||
}
|
||||
|
||||
v560_35_03 := addDriverABI(560, 35, 03, "f2932c92fadd43c5b2341be453fc4f73f0ad7185c26bb7a43fbde81ae29f1fe3", v560_28_03)
|
||||
_ = addDriverABI(565, 57, 01, "6eebe94e585e385e8804f5a74152df414887bf819cc21bd95b72acd0fb182c7a", v560_35_03)
|
||||
v565_57_01 := addDriverABI(565, 57, 01, "6eebe94e585e385e8804f5a74152df414887bf819cc21bd95b72acd0fb182c7a", v560_35_03)
|
||||
|
||||
_ = addDriverABI(570, 86, 15, "87709c19c7401243136bc0ec9e7f147c6803070a11449ae8f0819dee7963f76b", func() *driverABI {
|
||||
abi := v565_57_01()
|
||||
abi.allocationClass[nvgpu.TURING_CHANNEL_GPFIFO_A] = allocHandler(rmAllocChannelV570, compUtil)
|
||||
abi.allocationClass[nvgpu.AMPERE_CHANNEL_GPFIFO_A] = allocHandler(rmAllocChannelV570, compUtil)
|
||||
abi.allocationClass[nvgpu.HOPPER_CHANNEL_GPFIFO_A] = allocHandler(rmAllocChannelV570, compUtil)
|
||||
|
||||
prevStructs := abi.getStructs
|
||||
abi.getStructs = func() *driverABIStructs {
|
||||
structs := prevStructs()
|
||||
structs.allocationStructs[nvgpu.TURING_CHANNEL_GPFIFO_A] = driverStructWithName(nvgpu.NV_CHANNEL_ALLOC_PARAMS_V570{}, "NV_CHANNEL_ALLOC_PARAMS")
|
||||
structs.allocationStructs[nvgpu.AMPERE_CHANNEL_GPFIFO_A] = driverStructWithName(nvgpu.NV_CHANNEL_ALLOC_PARAMS_V570{}, "NV_CHANNEL_ALLOC_PARAMS")
|
||||
structs.allocationStructs[nvgpu.HOPPER_CHANNEL_GPFIFO_A] = driverStructWithName(nvgpu.NV_CHANNEL_ALLOC_PARAMS_V570{}, "NV_CHANNEL_ALLOC_PARAMS")
|
||||
return structs
|
||||
}
|
||||
return abi
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user