MdePkg/X86UnitTestHost: set rdrand cpuid bit

Set the rdrand feature bit when faking cpuid for host test cases.
Needed to make the CryptoPkg test cases work.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann 2024-06-14 11:45:53 +02:00 committed by mergify[bot]
parent 94961b8817
commit 5e776299a2

View File

@ -66,6 +66,15 @@ UnitTestHostBaseLibAsmCpuid (
OUT UINT32 *Edx OPTIONAL OUT UINT32 *Edx OPTIONAL
) )
{ {
UINT32 RetEcx;
RetEcx = 0;
switch (Index) {
case 1:
RetEcx |= BIT30; /* RdRand */
break;
}
if (Eax != NULL) { if (Eax != NULL) {
*Eax = 0; *Eax = 0;
} }
@ -75,7 +84,7 @@ UnitTestHostBaseLibAsmCpuid (
} }
if (Ecx != NULL) { if (Ecx != NULL) {
*Ecx = 0; *Ecx = RetEcx;
} }
if (Edx != NULL) { if (Edx != NULL) {