Commit message:
bhyve: pass address of OpRegion to the guest Don't allow access to the physical ASLS register. It contains a host address which is meaningless for the guest. Additionally, it allows the guest to safely rewrite this register. This is the last commit required for GVT-d. Nevertheless, it might not work due to missing firmware support.
Description:
Adds support for Intels GVT-d feature to passthrough an integrated graphics device to a bhyve-guest.
No dedicated graphic card is neccessary to use this feature. If there is no dedicated graphic card build in, the FreeBSD host runs headless after booting the guest.
This patch is split into mutliple commits (see https://github.com/Beckhoff/freebsd-src/commits/phab/corvink/gvt-d). I'm going to create multiple patches to merge it. As soon as some patches are merged, this patch will be rebased.
Depending patches:
Prerequisites:
- Intel CPU with VT-d
- BIOS option "PM Support" set to Enabled
How to enable GVT-d:
Use an updated OVMF (see below at Installation steps).
Just add your integrated graphics device to bhyve as any other PCI Passthru device.
If you add a GOP driver as ROM file to your GPU, you won't require an OS driver for display output.
bhyve -c 2 -m 4G -A -H -S -w \ -s 0,hostbridge \ -s 2,passthru,0/2/0[,rom=<path/to/gop.rom>] \ -s 4,virtio-blk,/root/win/win10.img \ -s 5,virtio-net,tap10 \ -s 31,lpc \ -l com1,stdio \ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_CODE.fd \ win10
Tested Scenarios:
OS | |
Windows | Working |
Debian | Working |
Ubuntu 20.04 | Working |
FreeBSD | Working |
Tested with Windows as a guest:
Architecture | |
Sandy Bridge | Not Working (Windows reports that the device works properly but there's no correct display output) |
Ivy Bridge | Working |
Haswell | Working |
Kabylake | Working |
Coffee Lake | Working |
Installation steps:
Update your OVMF:
For those who don't wanna rebuild OVMF:
You have to option to use GPU passthrough:
- Running a VM with GOP driver
- Add a GOP driver as ROM file to your GPU
- Enjoy GPU passthrough
- Running a VM without GOP driver
- Install your VM on the "old" way with GVT-d disabled
- Boot into your VM with GVT-d enabled and install the graphics driver
- Boot your VM with GVT-d enabled
- Enjoy GPU passthrough