All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] vfio/pci: Hide ARI capability
@ 2016-07-15 17:30 Alex Williamson
  2016-07-17 17:35 ` Marcel Apfelbaum
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Williamson @ 2016-07-15 17:30 UTC (permalink / raw)
  To: alex.williamson; +Cc: qemu-devel

QEMU supports ARI on downstream ports and assigned devices may support
ARI in their extended capabilities.  The endpoint ARI capability
specifies the next function, such that the OS doesn't need to walk
each possible function, however this next function is relative to the
host, not the guest.  This leads to device discovery issues when we
combine separate functions into virtual multi-function packages in a
guest.  For example, SR-IOV VFs are not enumerated by simply probing
the function address space, therefore the ARI next-function field is
zero.  When we combine multiple VFs together as a multi-function
device in the guest, the guest OS identifies ARI is enabled, relies on
this next-function field, and stops looking for additional function
after the first is found.

Long term we should expose the ARI capability to the guest to enable
configurations with more than 8 functions per slot, but this requires
additional QEMU PCI infrastructure to manage the next-function field
for multiple, otherwise independent devices.  In the short term,
hiding this capability allows equivalent functionality to what we
currently have on non-express chipsets.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
 hw/vfio/pci.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 44783c5..c8436a1 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -1828,6 +1828,7 @@ static int vfio_add_ext_cap(VFIOPCIDevice *vdev)
 
         switch (cap_id) {
         case PCI_EXT_CAP_ID_SRIOV: /* Read-only VF BARs confuse OVMF */
+        case PCI_EXT_CAP_ID_ARI: /* XXX Needs next function virtualization */
             trace_vfio_add_ext_cap_dropped(vdev->vbasedev.name, cap_id, next);
             break;
         default:

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] vfio/pci: Hide ARI capability
  2016-07-15 17:30 [Qemu-devel] [PATCH] vfio/pci: Hide ARI capability Alex Williamson
@ 2016-07-17 17:35 ` Marcel Apfelbaum
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Apfelbaum @ 2016-07-17 17:35 UTC (permalink / raw)
  To: Alex Williamson; +Cc: qemu-devel

On 07/15/2016 08:30 PM, Alex Williamson wrote:
> QEMU supports ARI on downstream ports and assigned devices may support
> ARI in their extended capabilities.  The endpoint ARI capability
> specifies the next function, such that the OS doesn't need to walk
> each possible function, however this next function is relative to the
> host, not the guest.  This leads to device discovery issues when we
> combine separate functions into virtual multi-function packages in a
> guest.  For example, SR-IOV VFs are not enumerated by simply probing
> the function address space, therefore the ARI next-function field is
> zero.  When we combine multiple VFs together as a multi-function
> device in the guest, the guest OS identifies ARI is enabled, relies on
> this next-function field, and stops looking for additional function
> after the first is found.
>

Hi Alex,

> Long term we should expose the ARI capability to the guest to enable
> configurations with more than 8 functions per slot, but this requires
> additional QEMU PCI infrastructure to manage the next-function field
> for multiple, otherwise independent devices.

The ARI implementation is on my "to-do" list.

   In the short term,
> hiding this capability allows equivalent functionality to what we
> currently have on non-express chipsets.
>

I agree.

Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>

Thanks,
Marcel


> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> ---
>   hw/vfio/pci.c |    1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
> index 44783c5..c8436a1 100644
> --- a/hw/vfio/pci.c
> +++ b/hw/vfio/pci.c
> @@ -1828,6 +1828,7 @@ static int vfio_add_ext_cap(VFIOPCIDevice *vdev)
>
>           switch (cap_id) {
>           case PCI_EXT_CAP_ID_SRIOV: /* Read-only VF BARs confuse OVMF */
> +        case PCI_EXT_CAP_ID_ARI: /* XXX Needs next function virtualization */
>               trace_vfio_add_ext_cap_dropped(vdev->vbasedev.name, cap_id, next);
>               break;
>           default:
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-17 17:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-15 17:30 [Qemu-devel] [PATCH] vfio/pci: Hide ARI capability Alex Williamson
2016-07-17 17:35 ` Marcel Apfelbaum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.