Implmenet ioctl command VFIO_DEVICE_RESET.

PiperOrigin-RevId: 618077589
This commit is contained in:
Jing Chen
2024-03-21 23:44:42 -07:00
committed by gVisor bot
parent ce673f29ce
commit 81e6512014
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -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
+3
View File
@@ -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
}