]> xenbits.xensource.com Git - ovmf.git/commitdiff
UefiCpuPkg/MtrrTest: Only claim CPUID max leaf as 1
authorRay Ni <ray.ni@intel.com>
Tue, 28 Feb 2023 08:18:08 +0000 (16:18 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sat, 1 Apr 2023 01:08:34 +0000 (01:08 +0000)
MtrrLib code queries the CPUID leaf 7h result if support.
Update Test code temporary to claim the CPUID only
supports max leaf as 1 so MtrrLib skips to query CPUID leaf 7h.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Ahmad Anadani <ahmad.anadani@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
UefiCpuPkg/Library/MtrrLib/UnitTest/Support.c

index 748c403281dfd1f5891f44fbbe70f74236f73416..260966e7b64de16418d444ba5ff30c958a8c282b 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Unit tests of the MtrrLib instance of the MtrrLib class\r
 \r
-  Copyright (c) 2018 - 2020, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2018 - 2023, Intel Corporation. All rights reserved.<BR>\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -122,6 +122,13 @@ UnitTestMtrrLibAsmCpuid (
   )\r
 {\r
   switch (Index) {\r
+    case CPUID_SIGNATURE:\r
+      if (Eax != NULL) {\r
+        *Eax = CPUID_VERSION_INFO;\r
+      }\r
+\r
+      return Index;\r
+      break;\r
     case CPUID_VERSION_INFO:\r
       if (Edx != NULL) {\r
         *Edx = mCpuidVersionInfoEdx.Uint32;\r