qemu: Fix iommu_platform for vhost user CCW

Enable iommu_platform for vhost user devices

Fixes: #178
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
This commit is contained in:
Jakob Naucke 2021-06-23 17:14:20 +02:00
parent 40843efc26
commit 18352c36ec
No known key found for this signature in database
GPG Key ID: 45FA1C7D310C0EBE

View File

@ -1435,6 +1435,9 @@ func (vhostuserDev VhostUserDevice) QemuFSParams(config *Config) []string {
deviceParams = append(deviceParams, "versiontable=/dev/shm/fuse_shared_versions") deviceParams = append(deviceParams, "versiontable=/dev/shm/fuse_shared_versions")
} }
if vhostuserDev.Transport.isVirtioCCW(config) { if vhostuserDev.Transport.isVirtioCCW(config) {
if config.Knobs.IOMMUPlatform {
deviceParams = append(deviceParams, "iommu_platform=on")
}
deviceParams = append(deviceParams, fmt.Sprintf("devno=%s", vhostuserDev.DevNo)) deviceParams = append(deviceParams, fmt.Sprintf("devno=%s", vhostuserDev.DevNo))
} }
if vhostuserDev.Transport.isVirtioPCI(config) && vhostuserDev.ROMFile != "" { if vhostuserDev.Transport.isVirtioPCI(config) && vhostuserDev.ROMFile != "" {