mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Implement pass through ioctl command VFIO_DEVICE_GET_INFO.
PiperOrigin-RevId: 617621125
This commit is contained in:
@@ -27,10 +27,49 @@ const (
|
||||
VFIO_TYPE1v2_IOMMU = 3
|
||||
)
|
||||
|
||||
// VFIO device info flags.
|
||||
const (
|
||||
// Device supports reset.
|
||||
VFIO_DEVICE_FLAGS_RESET = 1 << iota
|
||||
// VFIO-pci device.
|
||||
VFIO_DEVICE_FLAGS_PCI
|
||||
// VFIO-platform device.
|
||||
VFIO_DEVICE_FLAGS_PLATFORM
|
||||
// VFIO-amba device.
|
||||
VFIO_DEVICE_FLAGS_AMBA
|
||||
// VFIO-ccw device.
|
||||
VFIO_DEVICE_FLAGS_CCW
|
||||
// VFIO-ap device.
|
||||
VFIO_DEVICE_FLAGS_AP
|
||||
// VFIO-fsl-mc device.
|
||||
VFIO_DEVICE_FLAGS_FSL_MC
|
||||
// Info supports caps.
|
||||
VFIO_DEVICE_FLAGS_CAPS
|
||||
// VFIO-cdx device.
|
||||
VFIO_DEVICE_FLAGS_CDX
|
||||
)
|
||||
|
||||
// IOCTLs for VFIO file descriptor from include/uapi/linux/vfio.h.
|
||||
var (
|
||||
VFIO_CHECK_EXTENSION = IO(VFIO_TYPE, VFIO_BASE+1)
|
||||
VFIO_SET_IOMMU = IO(VFIO_TYPE, VFIO_BASE+2)
|
||||
VFIO_GROUP_SET_CONTAINER = IO(VFIO_TYPE, VFIO_BASE+4)
|
||||
VFIO_GROUP_GET_DEVICE_FD = IO(VFIO_TYPE, VFIO_BASE+6)
|
||||
VFIO_DEVICE_GET_INFO = IO(VFIO_TYPE, VFIO_BASE+7)
|
||||
)
|
||||
|
||||
// VFIODeviceInfo is analogous to vfio_device_info
|
||||
// from include/uapi/linux/vfio.h.
|
||||
//
|
||||
// +marshal
|
||||
type VFIODeviceInfo struct {
|
||||
Argsz uint32
|
||||
Flags uint32
|
||||
// The total amount of regions.
|
||||
NumRegions uint32
|
||||
// The maximum number of IRQ.
|
||||
NumIrqs uint32
|
||||
// Offset within info struct of first cap.
|
||||
CapOffset uint32
|
||||
pad uint32
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user