uefi-edk2 icon indicating copy to clipboard operation
uefi-edk2 copied to clipboard

OvmfPkg: use regular PCI bus enumeration for bhyve

Open d-scott-phillips opened this issue 5 years ago • 6 comments

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.

d-scott-phillips avatar Aug 30 '19 22:08 d-scott-phillips

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.

lupinglade avatar Jan 11 '20 21:01 lupinglade

We're also hitting this on illumos using a firmware with this change.

sjorge avatar Jan 17 '20 19:01 sjorge

@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!

citrus-it avatar Mar 13 '20 09:03 citrus-it

The fix here would be to add the ability to relocate fbuf's frame buffer BAR as in: https://reviews.freebsd.org/D24066

d-scott-phillips avatar Mar 14 '20 03:03 d-scott-phillips

Fantastic, thank you for that patch. I'll pull it into OmniOS and test it there too.

citrus-it avatar Mar 14 '20 21:03 citrus-it

Since D24066 has been committed to src, we probably would like to make this changes on upstream as well.

khng300 avatar Mar 24 '21 14:03 khng300