uefi-edk2
uefi-edk2 copied to clipboard
OvmfPkg: use regular PCI bus enumeration for bhyve
With the initial import of bhyve functionality, I set PcdPciDisableBusEnumeration = TRUE to follow the UDK2014.SP1 bhyve firmware's behavior of using the no-enumeration PCI Dxes from DuetPkg.
The enumeration disabled path is for Xen, which assumes that PCI devices are configured in the way that Xen configures them, and has various asserts to ensure this. Bhyve doesn't meet all the expectations of this code path, specifically that all 64-bit capable memory spaces are programmed at an address at or above 4G.
This prevents successfully booting with bhyve's nvme emulation, so here we switch to using the PCI enumeration path like QEMU.
This seems to break pci_fbuf because UEFI is changing the frame buffer memory address behind pci_fbuf's back. It will crash at the assert(bardix == 0) in pci_fbuf because writing to the frame buffer is no longer accessing the video memory address.
We're also hitting this on illumos using a firmware with this change.
@d-scott-phillips do you have any thoughts on this? In illumos we currently prefer fbuf over nvme but would obviously like both! How hard is adjusting things so that we can enable the bus enumeration without breaking fbuf? Thanks!
The fix here would be to add the ability to relocate fbuf's frame buffer BAR as in: https://reviews.freebsd.org/D24066
Fantastic, thank you for that patch. I'll pull it into OmniOS and test it there too.
Since D24066 has been committed to src, we probably would like to make this changes on upstream as well.