On 8/13/25 09:01, Andrea Bolognani wrote:
On Tue, Aug 12, 2025 at 05:26:19PM -0600, Jim Fehlig wrote:
On 7/31/25 09:45, Andrea Bolognani via Devel wrote:
This test case demonstrates how firmware autoselection doesn't
currently work correctly for domains using SEV-SNP: the
descriptor for a suitable firmware exists, and yet it doesn't
get picked up.
On my test system, autoselection for SEV-SNP guests does work after making
the firmware descriptor changes suggested by Gerd
https://src.fedoraproject.org/fork/kraxel/rpms/edk2/c/5146a0c3e9bf821d045e0cc3600ad715aca14588
It fails for SEV and SEV-ES guests. As a first step, I tried "importing" the
descriptor changes to tests/qemufirmwaredata/, but as always I'm fighting
with fixing up the tests :-/.
Patch importing the changes attached.
Can you be more specific about the issue you're experiencing for
SEV(-ES) guests? Based on the patch, the behavior doesn't seem to
change at all there. Are you able to successfully start those guests
when you use unmodified libvirt and edk2?
Then again, the existing SEV tests look... Questionable. They all use
the i440fx machine type and default (BIOS) firmware, whereas
according to the documentation[1] you really want q35 and UEFI. So at
best our test coverage is lacking.
FYI, I've been working on a series that updates the existing SEV tests, includes
your descriptor import, and slightly tweaked patches from this series
https://gitlab.com/jfehlig/libvirt/-/tree/coco-firmware-autoselect-improvements?ref_type=heads
Stressing again the fact that I know very little about SEV and its
variants, my impression is that generally speaking stateless firmware
is preferred for the use case; however in Fedora the descriptors for
"regular" edk2 builds with no Secure Boot[2] advertise support for
the "amd-sev" and "amd-sev-es" firmware features, and since they sort
before the SEV-specific builds[3] libvirt will pick them up unless
you specifically ask for the firmware to be stateless.
Not sure if the best way to get out of this situation is to shuffle
the descriptors around, drop the SEV-specific features from other
descriptors, or tweak the libvirt algorithm so that it will prefer
stateless firmware for SEV unless told otherwise.
My WIP series drops the SEV features from the incompatible descriptors.
I will be off the remainder of the week, but can tidy the series and post a V1
next week if there's interest.
Regards,
Jim