From ca3f8638fa4f5dd2ab52b5f29b3c5c3a2ddf536e Mon Sep 17 00:00:00 2001 From: YuanhaoXie Date: Mon, 11 Sep 2023 18:55:48 +0800 Subject: [PATCH] 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 Cc: Eric Dong Cc: Rahul Kumar Cc: Gerd Hoffmann Reviewed-by: Eric Dong Reviewed-by: Ray Ni --- 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.