diff options
author | YuanhaoXie <yuanhao.xie@intel.com> | 2023-09-11 18:55:48 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-10-09 08:22:02 +0000 |
commit | ca3f8638fa4f5dd2ab52b5f29b3c5c3a2ddf536e (patch) | |
tree | b33912891de36fee53f3f7d4c3a94acf0f8605f7 /UefiCpuPkg | |
parent | bf03c4a52ae2dcf8690667aa798fa24b9c94d102 (diff) | |
download | edk2-ca3f8638fa4f5dd2ab52b5f29b3c5c3a2ddf536e.tar.gz edk2-ca3f8638fa4f5dd2ab52b5f29b3c5c3a2ddf536e.tar.bz2 edk2-ca3f8638fa4f5dd2ab52b5f29b3c5c3a2ddf536e.zip |
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>
Diffstat (limited to 'UefiCpuPkg')
-rw-r--r-- | UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c | 4 |
1 files 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.
|