mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-21 21:18:54 +00:00
gpu: Use a dedicated VFIO group vs iommufd entry
We do not want to abuse the sysfsentry lets use a dedicated devfsentry. Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
This commit is contained in:
parent
9add633258
commit
7cca2c4925
@ -396,6 +396,9 @@ type VFIODev struct {
|
|||||||
// sysfsdev of VFIO mediated device
|
// sysfsdev of VFIO mediated device
|
||||||
SysfsDev string
|
SysfsDev string
|
||||||
|
|
||||||
|
// DevfsDev is used to identify a VFIO Group device or IOMMMUFD VFIO device
|
||||||
|
DevfsDev string
|
||||||
|
|
||||||
// VendorID specifies vendor id
|
// VendorID specifies vendor id
|
||||||
VendorID string
|
VendorID string
|
||||||
|
|
||||||
|
@ -233,7 +233,8 @@ func GetDeviceFromVFIODev(device config.DeviceInfo) ([]*config.VFIODev, error) {
|
|||||||
ID: id,
|
ID: id,
|
||||||
Type: vfioDeviceType,
|
Type: vfioDeviceType,
|
||||||
BDF: deviceBDF,
|
BDF: deviceBDF,
|
||||||
SysfsDev: device.HostPath,
|
SysfsDev: deviceSysfsDev,
|
||||||
|
DevfsDev: device.HostPath,
|
||||||
IsPCIe: IsPCIeDevice(deviceBDF),
|
IsPCIe: IsPCIeDevice(deviceBDF),
|
||||||
Class: pciClass,
|
Class: pciClass,
|
||||||
VendorID: vendorID,
|
VendorID: vendorID,
|
||||||
|
@ -1897,6 +1897,9 @@ type VFIODevice struct {
|
|||||||
|
|
||||||
// SysfsDev specifies the sysfs matrix entry for the AP device
|
// SysfsDev specifies the sysfs matrix entry for the AP device
|
||||||
SysfsDev string
|
SysfsDev string
|
||||||
|
|
||||||
|
// DevfsDev is used to identify a VFIO Group device or IOMMMUFD VFIO device
|
||||||
|
DevfsDev string
|
||||||
}
|
}
|
||||||
|
|
||||||
// VFIODeviceTransport is a map of the vfio device name that corresponds to
|
// VFIODeviceTransport is a map of the vfio device name that corresponds to
|
||||||
@ -1951,7 +1954,7 @@ func (vfioDev VFIODevice) QemuParams(config *Config) []string {
|
|||||||
deviceParams = append(deviceParams, fmt.Sprintf("devno=%s", vfioDev.DevNo))
|
deviceParams = append(deviceParams, fmt.Sprintf("devno=%s", vfioDev.DevNo))
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.HasPrefix(vfioDev.SysfsDev, drivers.IommufdDevPath) {
|
if strings.HasPrefix(vfioDev.DevfsDev, drivers.IommufdDevPath) {
|
||||||
qemuParams = append(qemuParams, "-object")
|
qemuParams = append(qemuParams, "-object")
|
||||||
qemuParams = append(qemuParams, fmt.Sprintf("iommufd,id=iommufd%s", vfioDev.ID))
|
qemuParams = append(qemuParams, fmt.Sprintf("iommufd,id=iommufd%s", vfioDev.ID))
|
||||||
deviceParams = append(deviceParams, fmt.Sprintf("iommufd=iommufd%s", vfioDev.ID))
|
deviceParams = append(deviceParams, fmt.Sprintf("iommufd=iommufd%s", vfioDev.ID))
|
||||||
|
@ -714,6 +714,7 @@ func (q *qemuArchBase) appendVFIODevice(devices []govmmQemu.Device, vfioDev conf
|
|||||||
DeviceID: vfioDev.DeviceID,
|
DeviceID: vfioDev.DeviceID,
|
||||||
Bus: vfioDev.Bus,
|
Bus: vfioDev.Bus,
|
||||||
SysfsDev: vfioDev.SysfsDev,
|
SysfsDev: vfioDev.SysfsDev,
|
||||||
|
DevfsDev: vfioDev.DevfsDev,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user