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:
@@ -399,7 +399,7 @@ UnitTestIsMtrrSupported (
|
|||||||
SystemParameter.VariableMtrrCount = 0;
|
SystemParameter.VariableMtrrCount = 0;
|
||||||
SystemParameter.FixedMtrrSupported = TRUE;
|
SystemParameter.FixedMtrrSupported = TRUE;
|
||||||
InitializeMtrrRegs (&SystemParameter);
|
InitializeMtrrRegs (&SystemParameter);
|
||||||
UT_ASSERT_FALSE (IsMtrrSupported ());
|
UT_ASSERT_TRUE (IsMtrrSupported ());
|
||||||
|
|
||||||
//
|
//
|
||||||
// MTRR capability on in CPUID leaf, but no fixed MTRRs.
|
// MTRR capability on in CPUID leaf, but no fixed MTRRs.
|
||||||
@@ -408,7 +408,7 @@ UnitTestIsMtrrSupported (
|
|||||||
SystemParameter.VariableMtrrCount = 7;
|
SystemParameter.VariableMtrrCount = 7;
|
||||||
SystemParameter.FixedMtrrSupported = FALSE;
|
SystemParameter.FixedMtrrSupported = FALSE;
|
||||||
InitializeMtrrRegs (&SystemParameter);
|
InitializeMtrrRegs (&SystemParameter);
|
||||||
UT_ASSERT_FALSE (IsMtrrSupported ());
|
UT_ASSERT_TRUE (IsMtrrSupported ());
|
||||||
|
|
||||||
//
|
//
|
||||||
// MTRR capability on in CPUID leaf with both variable and fixed MTRRs.
|
// MTRR capability on in CPUID leaf with both variable and fixed MTRRs.
|
||||||
|
Reference in New Issue
Block a user