HomeFreeBSD

bhyve: Map the MSI-X table unconditionally for passthrough

Description

bhyve: Map the MSI-X table unconditionally for passthrough

It is possible for the PBA to reside in the same page as the MSI-X
table. And, while devices are not supposed to do this, at least some
Intel wifi devices place registers in a page shared with the MSI-X
table. To handle the first case we currently map the PBA page using
/dev/mem, and the second case is not handled.

Kill two birds with one stone: map the MSI-X table BAR using the
PCIOCBARMMAP ioctl instead of /dev/mem, and map the entire table so that
accesses beyond the bounds of the table can be emulated. Regions of the
BAR not containing the table are left unmapped.

PR: 251046
Reviewed by: bz, grehan, jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 7fa2335347362378322a4d27cb40f6e6cd5dd0fb)

Details

Provenance
markjAuthored on Oct 9 2021, 3:36 PM
Parents
rGab9866cc793d: pci: Implement pci_bar_enabled() for SR-IOV VFs
Branches
Unknown
Tags
Unknown