@@ -964,7 +964,8 @@ static int assign_irq(AssignedDevice *dev)
}
assigned_irq_data.flags = KVM_DEV_IRQ_GUEST_INTX;
- if (dev->cap.available & ASSIGNED_DEVICE_CAP_MSI)
+ if (dev->features & ASSIGNED_DEVICE_PREFER_MSI_MASK &&
+ dev->cap.available & ASSIGNED_DEVICE_CAP_MSI)
assigned_irq_data.flags |= KVM_DEV_IRQ_HOST_MSI;
else
assigned_irq_data.flags |= KVM_DEV_IRQ_HOST_INTX;
@@ -1541,6 +1542,8 @@ static PCIDeviceInfo assign_info = {
DEFINE_PROP_BIT("iommu", AssignedDevice, features,
ASSIGNED_DEVICE_USE_IOMMU_BIT, true),
DEFINE_PROP_STRING("configfd", AssignedDevice, configfd_name),
+ DEFINE_PROP_BIT("prefer_msi", AssignedDevice, features,
+ ASSIGNED_DEVICE_PREFER_MSI_BIT, true),
DEFINE_PROP_END_OF_LIST(),
},
};
@@ -75,8 +75,10 @@ typedef struct {
} AssignedDevRegion;
#define ASSIGNED_DEVICE_USE_IOMMU_BIT 0
+#define ASSIGNED_DEVICE_PREFER_MSI_BIT 1
#define ASSIGNED_DEVICE_USE_IOMMU_MASK (1 << ASSIGNED_DEVICE_USE_IOMMU_BIT)
+#define ASSIGNED_DEVICE_PREFER_MSI_MASK (1 << ASSIGNED_DEVICE_PREFER_MSI_BIT)
typedef struct AssignedDevice {
PCIDevice dev;