refutationalist / saur

Sam's AUR -- personal Arch packages
4 stars 5 forks source link

Build a Xen specific OVMF #11

Closed RA-Kooi closed 4 months ago

RA-Kooi commented 4 months ago

During my testing I ran into the issue that HVM VMs did not get more than 1 CPU when booting with UEFI. I did not run into this issue when using PV or PVH VMs which suggested to me that the issue was HVM specific. Having ruled out qemu, I decided to run a HVM with direct kernel boot, and lo and behold it was able to detect more than 1 vCPU. This is when my attention shifted to OVMF. Considering we need Xen specific grub versions, I went ahead and checked if we needed a Xen specific build. According to the wiki we need to use the --with-ovmf switch. So I dug in the source and checked if Xen was doing anything specific. Turns out Xen builds OvmfXen.dsc whereas the edk2-ovmf package builds the OvmfPkg*.dsc and Microvm*.dsc targets.

Long story short, building OVMF ourselves will allow us to use HVM VMs, which are pretty much a requirement when doing PCI-E passthrough as that doesn't work with PVH VMs, with UEFI support.

The downside here is that OVMF significantly increases the build time. It probably is a good idea to contact the edk2-ovmf maintainer(s) to get them to build a Xen enabled OVMF so we don't have to. But for now this will do.