mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-21 13:08:00 +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 string
|
||||
|
||||
// DevfsDev is used to identify a VFIO Group device or IOMMMUFD VFIO device
|
||||
DevfsDev string
|
||||
|
||||
// VendorID specifies vendor id
|
||||
VendorID string
|
||||
|
||||
|
@ -233,7 +233,8 @@ func GetDeviceFromVFIODev(device config.DeviceInfo) ([]*config.VFIODev, error) {
|
||||
ID: id,
|
||||
Type: vfioDeviceType,
|
||||
BDF: deviceBDF,
|
||||
SysfsDev: device.HostPath,
|
||||
SysfsDev: deviceSysfsDev,
|
||||
DevfsDev: device.HostPath,
|
||||
IsPCIe: IsPCIeDevice(deviceBDF),
|
||||
Class: pciClass,
|
||||
VendorID: vendorID,
|
||||
|
@ -1897,6 +1897,9 @@ type VFIODevice struct {
|
||||
|
||||
// SysfsDev specifies the sysfs matrix entry for the AP device
|
||||
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
|
||||
@ -1951,7 +1954,7 @@ func (vfioDev VFIODevice) QemuParams(config *Config) []string {
|
||||
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, fmt.Sprintf("iommufd,id=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,
|
||||
Bus: vfioDev.Bus,
|
||||
SysfsDev: vfioDev.SysfsDev,
|
||||
DevfsDev: vfioDev.DevfsDev,
|
||||
},
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user