OSDN Git Service

hw/pci: warn when PCIe device is plugged into non-zero slot of downstream port
authorAni Sinha <anisinha@redhat.com>
Wed, 5 Jul 2023 11:59:23 +0000 (17:29 +0530)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 10 Jul 2023 22:59:32 +0000 (18:59 -0400)
commitca92eb5defcf9d1c2106341744a73a03cf26e824
tree8cdffd51b32cf83407d26571121556d41440dd68
parent579edbd459a53beb7929ee1169dc9675cc329865
hw/pci: warn when PCIe device is plugged into non-zero slot of downstream port

PCIe downstream ports only have a single device 0, so PCI Express devices can
only be plugged into slot 0 on a PCIe port. Add a warning to let users know
when the invalid configuration is used. We may enforce this more strongly later
once we get more clarity on whether we are introducing a bad regression for
users currently using the wrong configuration.

The change has been tested to not break or alter behaviors of ARI capable
devices by instantiating seven vfs on an emulated igb device (the maximum
number of vfs the igb device supports). The vfs are instantiated correctly
and are seen to have non-zero device/slot numbers in the conventional PCI BDF
representation.

CC: jusual@redhat.com
CC: imammedo@redhat.com
CC: mst@redhat.com
CC: akihiko.odaki@daynix.com
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2128929
Signed-off-by: Ani Sinha <anisinha@redhat.com>
Reviewed-by: Julia Suvorova <jusual@redhat.com>
Message-Id: <20230705115925.5339-6-anisinha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
hw/pci/pci.c