]> www.infradead.org Git - users/jedix/linux-maple.git/commit
s390/pci: Fix handling of isolated VFs
authorNiklas Schnelle <schnelle@linux.ibm.com>
Fri, 7 Feb 2025 12:30:17 +0000 (13:30 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 11 Feb 2025 18:35:08 +0000 (19:35 +0100)
commit2844ddbd540fc84d7571cca65d6c43088e4d6952
treedbabd33d9d920fd246310f118893bdbdbab7a682
parent05793884a1f30509e477de9da233ab73584b1c8c
s390/pci: Fix handling of isolated VFs

In contrast to the commit message of the fixed commit VFs whose parent
PF is not configured are not always isolated, that is put on their own
PCI domain. This is because for VFs to be added to an existing PCI
domain it is enough for that PCI domain to share the same topology ID or
PCHID. Such a matching PCI domain without a parent PF may exist when
a PF from the same PCI card created the domain with the VF being a child
of a different, non accessible, PF. While not causing technical issues
it makes the rules which VFs are isolated inconsistent.

Fix this by explicitly checking that the parent PF exists on the PCI
domain determined by the topology ID or PCHID before registering the VF.
This works because a parent PF which is under control of this Linux
instance must be enabled and configured at the point where its child VFs
appear because otherwise SR-IOV could not have been enabled on the
parent.

Fixes: 25f39d3dcb48 ("s390/pci: Ignore RID for isolated VFs")
Cc: stable@vger.kernel.org
Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/pci/pci_bus.c
arch/s390/pci/pci_iov.c
arch/s390/pci/pci_iov.h