Introducing UEFI Support for Alioth with AVMF

Technology , , ,

Following up on my recent work adding Intel TDX support to Alioth, I am thrilled to announce another major milestone for the project: full UEFI support. This enables Alioth to boot standard Linux distributions seamlessly, taking us one step closer to running fully featured confidential virtual machines.

AVMF: Alioth Virtual Machine Firmware

To achieve this, I forked EDK2/OVMF (which is traditionally used for QEMU) to create a new, UEFI-compatible firmware specifically tailored for Alioth. I’m calling it AVMF (Alioth Virtual Machine Firmware).

The code for AVMF is available on GitHub at https://github.com/Lencerf/edk2 on the feat/alioth/avmf branch. Here is a summary of the core changes made to EDK2 to support Alioth:

Upgrading Alioth for UEFI

On the hypervisor side, supporting a complex firmware environment like UEFI required adding a few more emulated devices and ironing out several bugs. I’ve made significant improvements to the device model, including:

AI-Assisted Firmware Development

One of the most exciting aspects of developing AVMF was the workflow. I used Gemini AI to assist with the firmware development, guiding it with a comprehensive prompt file called project.md. This prompt contained the project goals, repository paths, build instructions, and tips on the architectural differences between QEMU and Alioth’s hardware models.

I have to say, it was amazingly effective. Once I spent the time to properly set up the development environment and clearly define the context and goals in project.md, Gemini was able to navigate the complex EDK2 codebase, strip out QEMU-specific dependencies, and help construct the new AliothPkg almost seamlessly.

The Result: Booting Confidential Linux

The combination of AVMF and the updated Alioth VMM is a massive leap forward. With AVMF, we can now successfully boot confidential VMs using both AMD-SNP and Intel-TDX.

I have successfully tested booting Fedora Linux 43 as a confidential guest, proving that the firmware and device model are capable of handling a modern, unmodified OS boot process.

However, I observed some random crashes of the firmware when rebooting the VM, so more efforts are needed to polish the firmware to a truly robust state.

This is an exciting step for the Alioth project. Stay tuned for more updates as I continue to refine the hypervisor and explore more advanced confidential computing features!