Re: [PATCH 0/4] Prepare bhyve's OVMF for GPU-Passthrough

From: Peter Grehan <>
Date: Wed, 16 Jun 2021 08:19:49 UTC
Hi Corvin,

  Thanks for posting these here.

> GPU-Passthrough for bhyve requires a few patches to work properly.
> These patches will allow GPU-Passthrough for bhyve.
> It will work for dedicated AMD GPUs and integrated Intel GPUs.
> Nvidia GPUs are untested.

  I have no issue with patches 3/4 and 4/4. However, 1+2/4 switch over 
to having EFI do the PCI scan/address assignment rather than accepting 
bhyve's probe.

  This history here is that tychon@'s initial version of bhyve/EFI had 
the scan when it was mandatory in OVMF. That didn't work with passthru 
devices, requiring the "Duet" (EFI-over-BIOS) PCI code to be used.

  The recent upstreaming of Bhyve/EFI was done prior to the fix allowing 
dynamic relocation of pass-thru BARs. With Duet not being available, the 
flag allowing EFI to inherit PCI BAR assignment was set 
(PcdPciDisableBusEnumeration, as you've found).

  While it's now possible to allow EFI to scan/assign PCI BARs, I'd like 
to avoid it if possible for 2 reasons:
   - assignment policy can stay in bhyve, such as whether to locate 
64-bit BARs in the 32-bit region which EFI didn't (doesn't?) allow. Bugs 
or corner-cases can be fixed in bhyve without requiring a modification 
to upstream EFI.
   - there is no need for EFI to perform a slow can via PCI bus 
operations, resulting in VM-exits, where bhyve can perform all this in 
memory, which can result in faster boot.

  Your patch description states:
 >For Linux guests, AMD GPUs require that their PCI ROM is processed by 

  Is it possible to fix this in bhyve ? Can pass-thru ROMs be mapped 
just like mmio BARs are ?