Page MenuHomeFreeBSD

Enable memory and I/O decoding in PCI devices on demand.

Authored by jhb on Jun 5 2019, 10:36 PM.



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.

Test Plan
  • booted a guest and verified hostb and isab devices now don't have either MEMEN or PORTEN enabled, but virtio devices still have both set

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhb created this revision.Jun 5 2019, 10:36 PM
rgrimes accepted this revision as: rgrimes.Jun 6 2019, 12:59 AM
rgrimes added inline comments.
589 ↗(On Diff #58285)

Order of locals

This revision is now accepted and ready to land.Jun 6 2019, 12:59 AM
jhb marked an inline comment as done.Jun 7 2019, 3:48 PM
This revision was automatically updated to reflect the committed changes.