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)
Fri, Apr 26, 8:53 AM
Unknown Object (File)
Feb 15 2024, 10:01 PM
Unknown Object (File)
Dec 21 2023, 10:48 PM
Unknown Object (File)
Dec 20 2023, 1:39 AM
Unknown Object (File)
Dec 19 2023, 12:21 PM
Unknown Object (File)
Dec 17 2023, 3:06 AM
Unknown Object (File)
Nov 28 2023, 5:01 AM
Unknown Object (File)
Nov 23 2023, 12:30 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.