]> 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, 30 Oct 2021 14:14:21 +0000 (10:14 -0400)
commit382eec24c0284bd7dc5997b85abc9ee70ea704a1
tree4cb0adca289ec0e4c5d966e4bfdc9b5a5dae7189
parent499506ac09b489cac1a19d8842b968bcdbc24e38
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
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 7fa2335347362378322a4d27cb40f6e6cd5dd0fb)
usr.sbin/bhyve/pci_emul.h
usr.sbin/bhyve/pci_passthru.c