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

Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 24709
Build 23474: arc lint + arc unit

Event Timeline

rgrimes added inline comments.
usr.sbin/bhyve/pci_emul.c
589

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.