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>
---
UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c b/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c
index 1409ae27bb..ac18d9d25d 100644
--- a/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c
+++ b/UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c
@@ -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.
--
2.36.1.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108558): https://edk2.groups.io/g/devel/message/108558
Mute This Topic: https://groups.io/mt/101331018/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-