Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jun 2021 18:19:49 +1000
From:      Peter Grehan <grehan@freebsd.org>
To:        =?UTF-8?Q?Corvin_K=c3=b6hne?= <c.koehne@beckhoff.com>
Cc:        p.bruenn@beckhoff.com, freebsd-virtualization@freebsd.org
Subject:   Re: [PATCH 0/4] Prepare bhyve's OVMF for GPU-Passthrough
Message-ID:  <d93fe505-2818-2f00-fab4-b18fcf1f8a8d@freebsd.org>
In-Reply-To: <20210615083000.1286-1-c.koehne@beckhoff.com>
References:  <20210615083000.1286-1-c.koehne@beckhoff.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 
UEFI.

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

later,

Peter.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d93fe505-2818-2f00-fab4-b18fcf1f8a8d>