Skip to content

Commit

Permalink
s390/pci: Mark all VFs as not implementing PCI_COMMAND_MEMORY
Browse files Browse the repository at this point in the history
[ Upstream commit 08b6e22 ]

For s390 we can have VFs that are passed-through without the associated
PF. Firmware provides an emulation layer to allow these devices to
operate independently, but is missing emulation of the Memory Space
Enable bit.  For these as well as linked VFs, set no_command_memory
which specifies these devices do not implement PCI_COMMAND_MEMORY.

Fixes: abafbc5 ("vfio-pci: Invalidate mmaps and block MMIO access on disabled memory")
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.ibm.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
rosatomj authored and gregkh committed Oct 29, 2020
1 parent b40bd0d commit 0cdb91a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/s390/pci/pci_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,10 @@ void pcibios_bus_add_device(struct pci_dev *pdev)
* With pdev->no_vf_scan the common PCI probing code does not
* perform PF/VF linking.
*/
if (zdev->vfn)
if (zdev->vfn) {
zpci_bus_setup_virtfn(zdev->zbus, pdev, zdev->vfn);

pdev->no_command_memory = 1;
}
}

static int zpci_bus_add_device(struct zpci_bus *zbus, struct zpci_dev *zdev)
Expand Down

0 comments on commit 0cdb91a

Please sign in to comment.