]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Enable memory and I/O decoding in PCI devices on demand.
authorjhb <jhb@FreeBSD.org>
Fri, 7 Jun 2019 15:48:12 +0000 (15:48 +0000)
committerjhb <jhb@FreeBSD.org>
Fri, 7 Jun 2019 15:48:12 +0000 (15:48 +0000)
commit44305ec379872d8a7577e17fed00b1b9ac0463bd
treefd5f3da50bd3c889a3e57f986675eaf0f6db9c99
parent28cb859563f43ccf755177235164e9ceb1e518b9
Enable memory and I/O decoding in PCI devices on demand.

Rather than uncoditionally setting the MEMEN and PORTEN bits in
PCIR_COMMAND for PCI devices, set the respective bit when the first
BAR of a given type is added to the device.  This more closely matches
what firmware does on bare metal.

BUSMASTEREN is still set unconditionally.  Eventually this bit should
move into the device models as not all device models need this set.

Reviewed by: rgrimes
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20530
usr.sbin/bhyve/pci_emul.c