UefiCpuPkg/MtrrUnitTest: Update the Unit Test for IsMtrrSupported().

The previous implementation returns FALSE if either fixed MTRR is
unsupported or the number of variable MTRRs is 0. The correct behavior
is to return FALSE only when both fixed MTRR is unsupported and the
number of variable MTRRs is 0.

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>

Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
YuanhaoXie 2023-09-11 18:55:48 +08:00 committed by mergify[bot]
parent bf03c4a52a
commit ca3f8638fa
1 changed files with 2 additions and 2 deletions

View File

@ -399,7 +399,7 @@ UnitTestIsMtrrSupported (
SystemParameter.VariableMtrrCount = 0;
SystemParameter.FixedMtrrSupported = TRUE;
InitializeMtrrRegs (&SystemParameter);
UT_ASSERT_FALSE (IsMtrrSupported ());
UT_ASSERT_TRUE (IsMtrrSupported ());
//
// MTRR capability on in CPUID leaf, but no fixed MTRRs.
@ -408,7 +408,7 @@ UnitTestIsMtrrSupported (
SystemParameter.VariableMtrrCount = 7;
SystemParameter.FixedMtrrSupported = FALSE;
InitializeMtrrRegs (&SystemParameter);
UT_ASSERT_FALSE (IsMtrrSupported ());
UT_ASSERT_TRUE (IsMtrrSupported ());
//
// MTRR capability on in CPUID leaf with both variable and fixed MTRRs.