opnsense-src/sys/dev/pci
Mark Johnston ab9866cc79 pci: Implement pci_bar_enabled() for SR-IOV VFs
In a VF's configuration space, "memory space enable" is hard-wired to 0,
so the existing implementation always returns false.  We need to read
the SR-IOV control register from the PF device to get the value of the
MSE bit.

Fix pci_bar_enabled() to read this register instead for VFs.  I don't
see any way to access the PF's config space without a backpointer in the
pci device ivars, so I added one.

This fixes a regression where bhyve(8) fails to map the MSI-X table
after commit 7fa2335347 ("bhyve: Map the MSI-X table unconditionally
for passthrough") when a VF is passed through, since with that commit we
use PCIOCBARMMAP to map the table and that ioctl always fails for VFs
without this change.  As a bonus, pciconf(8) now correctly reports the
enablement of BARs for VFs.

Reported and tested by:	Raúl Muñoz <raul.munoz@custos.es>
Reviewed by:	rstone, jhb
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 1f960e646b)
2021-11-15 13:11:52 -05:00
..
controller Add PCI Express driver for the ARM Neoverse N1 System Development 2020-02-11 15:12:09 +00:00
fixup_pci.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
hostb_pci.c pci: clean up empty lines in .c and .h files 2020-09-01 22:00:07 +00:00
ignore_pci.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
isa_pci.c pci: clean up empty lines in .c and .h files 2020-09-01 22:00:07 +00:00
pci.c pci: Implement pci_bar_enabled() for SR-IOV VFs 2021-11-15 13:11:52 -05:00
pci_dw.c pci_dw: Drop unconditional explicit DEBUG define 2021-09-07 13:08:15 +01:00
pci_dw.h pci_dw: Detect number of outbound regions automatically 2021-09-07 13:06:48 +01:00
pci_dw_if.m Add driver for DesignWare PCIE core, and its Armada 8K specific attachement. 2019-10-20 11:11:32 +00:00
pci_dw_mv.c pci: clean up empty lines in .c and .h files 2020-09-01 22:00:07 +00:00
pci_host_generic.c pci: clean up empty lines in .c and .h files 2020-09-01 22:00:07 +00:00
pci_host_generic.h Clean up the pci host generic driver 2020-06-17 19:56:17 +00:00
pci_host_generic_acpi.c Only set the PCI bus end when we are reducing it 2020-11-29 16:22:33 +00:00
pci_host_generic_acpi.h Add PCI Express driver for the ARM Neoverse N1 System Development 2020-02-11 15:12:09 +00:00
pci_host_generic_fdt.c pci: clean up empty lines in .c and .h files 2020-09-01 22:00:07 +00:00
pci_host_generic_fdt.h Add a driver for bcm2838 PCI express controller 2020-07-06 08:51:55 +00:00
pci_if.m Add PCI methods to iterate over the PCI capabilities 2018-02-19 18:41:56 +00:00
pci_iov.c pci: Implement pci_bar_enabled() for SR-IOV VFs 2021-11-15 13:11:52 -05:00
pci_iov.h
pci_iov_if.m
pci_iov_private.h pci: Implement pci_bar_enabled() for SR-IOV VFs 2021-11-15 13:11:52 -05:00
pci_iov_schema.c
pci_pci.c pci_pci: Support growing bus ranges in bus_adjust_resource for NEW_PCIB 2021-10-10 14:36:54 +01:00
pci_private.h LinuxKPI: Support lazy BAR allocation 2021-10-24 19:51:15 +01:00
pci_subr.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
pci_user.c pci: Add an ioctl to perform I/O to BARs 2021-08-29 12:39:42 -04:00
pcib_if.m Create pcib_request_feature. 2017-02-25 06:11:36 +00:00
pcib_private.h pcib(4): Switch from callout to timeout_task. 2021-10-03 21:13:24 -04:00
pcib_support.c pci: clean up empty lines in .c and .h files 2020-09-01 22:00:07 +00:00
pcireg.h Add more values for PCI capabilities, PCIe extended capabilities, and subclasses. 2020-02-20 17:08:52 +00:00
pcivar.h MFC 1acf24a044: 2021-03-24 08:54:52 +01:00
schema_private.h
vga_pci.c pci: clean up empty lines in .c and .h files 2020-09-01 22:00:07 +00:00