On Tue, Nov 22, 2022 at 1:10 PM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
Yes. If what you say is true, this should be fixed asap. Do you intend
to send a patch?

I have sent out a patch (https://edk2.groups.io/g/devel/message/96552) fixing the CPUID checks with a naive attempt to sniff out RDRAND issues.
Your Linux snippet is probably better but I couldn't look at it due to licensing concerns.

To point out again, this is already hooked up to baremetal firmware.
So if you see issues that are worth fixing, fix them, but it shouldn't
hold up Ard's patchset.
 
"Real firmware" is frequently not a shining example of quality :) They can also more or less know what CPUs the fw will run on, but OVMF runs mostly everywhere.

In any case, I've sent out a patch (hopefully) fixing these issues. It should be trivial enough to review and apply so that Ard's patch doesn't get held up.
I think it's best to apply this only after my patch gets merged (in order to avoid weird breakage between commits) but that's up to the OVMF maintainers to decide.

Pedro