Page MenuHomeFreeBSD

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

Authored by jhb on Jun 5 2019, 10:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 20, 4:07 PM
Unknown Object (File)
Oct 13 2024, 7:03 PM
Unknown Object (File)
Oct 7 2024, 9:46 PM
Unknown Object (File)
Oct 7 2024, 6:37 PM
Unknown Object (File)
Oct 7 2024, 12:46 PM
Unknown Object (File)
Oct 7 2024, 10:45 AM
Unknown Object (File)
Oct 7 2024, 12:10 AM
Unknown Object (File)
Oct 6 2024, 8:55 PM
Subscribers

Details

Summary

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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rgrimes added inline comments.
usr.sbin/bhyve/pci_emul.c
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.