diff --git a/pkg/abi/linux/vfio.go b/pkg/abi/linux/vfio.go index b8c2b7a66..44f458899 100644 --- a/pkg/abi/linux/vfio.go +++ b/pkg/abi/linux/vfio.go @@ -106,6 +106,7 @@ var ( VFIO_DEVICE_GET_REGION_INFO = IO(VFIO_TYPE, VFIO_BASE+8) VFIO_DEVICE_GET_IRQ_INFO = IO(VFIO_TYPE, VFIO_BASE+9) VFIO_DEVICE_SET_IRQS = IO(VFIO_TYPE, VFIO_BASE+10) + VFIO_DEVICE_RESET = IO(VFIO_TYPE, VFIO_BASE+11) ) // VFIODeviceInfo is analogous to vfio_device_info diff --git a/pkg/sentry/devices/tpuproxy/tpu.go b/pkg/sentry/devices/tpuproxy/tpu.go index 477906ccd..8cd612ab8 100644 --- a/pkg/sentry/devices/tpuproxy/tpu.go +++ b/pkg/sentry/devices/tpuproxy/tpu.go @@ -242,6 +242,9 @@ func (fd *pciDeviceFD) Ioctl(ctx context.Context, uio usermem.IO, sysno uintptr, return fd.vfioIrqInfo(ctx, t, args[2].Pointer()) case linux.VFIO_DEVICE_SET_IRQS: return fd.vfioSetIrqs(ctx, t, args[2].Pointer()) + case linux.VFIO_DEVICE_RESET: + // VFIO_DEVICE_RESET is just a simple IOCTL command that carries no data. + return IOCTLInvoke[uint32, uintptr](fd.hostFD, linux.VFIO_DEVICE_RESET, 0) } return 0, linuxerr.ENOSYS }