diff options
author | CoprDistGit <infra@openeuler.org> | 2024-08-01 14:44:22 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-08-01 14:44:22 +0000 |
commit | 641da27ad73e8f09c40e8b093dcf824c0ee4d02a (patch) | |
tree | 5c8e4f5928100c6dd587e063b7b1de59d2236845 /0040-MdePkg-X86UnitTestHost-set-rdrand-cpuid-bit.patch | |
parent | bac9f1a06357b69667a40f0cb2ab674767947337 (diff) |
automatic import of edk2openeuler24.03_LTSopeneuler23.09
Diffstat (limited to '0040-MdePkg-X86UnitTestHost-set-rdrand-cpuid-bit.patch')
-rw-r--r-- | 0040-MdePkg-X86UnitTestHost-set-rdrand-cpuid-bit.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/0040-MdePkg-X86UnitTestHost-set-rdrand-cpuid-bit.patch b/0040-MdePkg-X86UnitTestHost-set-rdrand-cpuid-bit.patch new file mode 100644 index 0000000..d32e748 --- /dev/null +++ b/0040-MdePkg-X86UnitTestHost-set-rdrand-cpuid-bit.patch @@ -0,0 +1,43 @@ +From 320207a3df995771af36639c7bdf89c4203cf1c2 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann <kraxel@redhat.com> +Date: Fri, 14 Jun 2024 11:45:53 +0200 +Subject: [PATCH] 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> +(cherry picked from commit 5e776299a2604b336a947e68593012ab2cc16eb4) +--- + MdePkg/Library/BaseLib/X86UnitTestHost.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/MdePkg/Library/BaseLib/X86UnitTestHost.c b/MdePkg/Library/BaseLib/X86UnitTestHost.c +index 8ba4f54a38..7f7276f7f4 100644 +--- a/MdePkg/Library/BaseLib/X86UnitTestHost.c ++++ b/MdePkg/Library/BaseLib/X86UnitTestHost.c +@@ -66,6 +66,15 @@ UnitTestHostBaseLibAsmCpuid ( + OUT UINT32 *Edx OPTIONAL
+ )
+ {
++ UINT32 RetEcx;
++
++ RetEcx = 0;
++ switch (Index) {
++ case 1:
++ RetEcx |= BIT30; /* RdRand */
++ break;
++ }
++
+ if (Eax != NULL) {
+ *Eax = 0;
+ }
+@@ -75,7 +84,7 @@ UnitTestHostBaseLibAsmCpuid ( + }
+
+ if (Ecx != NULL) {
+- *Ecx = 0;
++ *Ecx = RetEcx;
+ }
+
+ if (Edx != NULL) {
|