UefiCpuPkg/MtrrTest: Only claim CPUID max leaf as 1

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>
This commit is contained in:
Ray Ni 2023-02-28 16:18:08 +08:00 committed by mergify[bot]
parent 24f57f9648
commit bb5c115fa6
1 changed files with 8 additions and 1 deletions

View File

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