IsMtrrSupported() return true when either fixed mtrr supported or
variable mtrr suppored. In this case, rather than checking whether
MTRR is supported or not, we should specifically check for fixed MTRR
support.

Signed-off-by: Yuanhao Xie <yuanhao....@intel.com>
Cc: Eric Dong <eric.d...@intel.com>
Cc: Rahul Kumar <rahul1.ku...@intel.com>
Cc: Gerd Hoffmann <kra...@redhat.com>
Cc: Ray Ni <ray...@intel.com>
---
 UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c 
b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
index c9440f01ef..b63c4b1c26 100644
--- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
+++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
@@ -468,7 +468,10 @@ MtrrGetFixedMtrr (
   OUT MTRR_FIXED_SETTINGS  *FixedSettings
   )
 {
-  if (!IsMtrrSupported ()) {
+  BOOLEAN  FixedMtrrSupported;
+
+  MtrrLibIsMtrrSupported (&FixedMtrrSupported, NULL);
+  if (!FixedMtrrSupported) {
     return FixedSettings;
   }
 
-- 
2.36.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108564): https://edk2.groups.io/g/devel/message/108564
Mute This Topic: https://groups.io/mt/101331026/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to