]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bhyve: Map the MSI-X table unconditionally for passthrough
authorMark Johnston <markj@FreeBSD.org>
Sat, 9 Oct 2021 15:36:19 +0000 (11:36 -0400)
committerMark Johnston <markj@FreeBSD.org>
Sat, 9 Oct 2021 15:36:19 +0000 (11:36 -0400)
commit7fa2335347362378322a4d27cb40f6e6cd5dd0fb
treea9444be199c22db699288a8265d13d046ad75d8d
parentc8a45820e0d94892c1a632d49ccfddd8f559801e
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.

Reviewed by: bz, grehan, jhb
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32359
usr.sbin/bhyve/pci_emul.h
usr.sbin/bhyve/pci_passthru.c