Re: [PATCH 2/4] pci-assign: Allow to disable MSI perference for host IRQ

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jan Kiszka <jan.kiszka@xxxxxxxxxxx> writes:

> Some devices (e.g. the ath9k) claim to support MSI but actually do not
> work when this is enabled. We must not blindly switch such devices to
> MSI but rather provide the user a way to pass control back to the
> guest driver. This can be done by turning the new property "prefer_msi"
> off (default remains on).
>
> Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
> ---
>  hw/device-assignment.c |    5 ++++-
>  hw/device-assignment.h |    2 ++
>  2 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/hw/device-assignment.c b/hw/device-assignment.c
> index 349e864..73d8afd 100644
> --- a/hw/device-assignment.c
> +++ b/hw/device-assignment.c
> @@ -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),

Suggest to define the feature bit properties next to each other.

>          DEFINE_PROP_END_OF_LIST(),
>      },
>  };
[...]
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux