]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 13:01:36 +0000 (14:01 +0100)
commit01df870db957eae7d031722f2ca90642ac526cd6
treecfc8a15e12ce84f6e335a5236ddf21d03767a6e1
parentc746d3eb0ddfbeb9dd73194432a17ee0a5d0ad86
s390/pci: Fix handling of isolated VFs

commit 2844ddbd540fc84d7571cca65d6c43088e4d6952 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/pci/pci_bus.c
arch/s390/pci/pci_iov.c
arch/s390/pci/pci_iov.h