summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Library/CpuCacheInfoLib
diff options
context:
space:
mode:
authorJason <yun.lou@intel.com>2021-08-13 10:05:28 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-08-23 07:49:17 +0000
commit8dd4fc5be6189666b37e5b00131a4173c6a2b085 (patch)
tree0ff7ceef65c99fe2b601898c84cd238a964a3834 /UefiCpuPkg/Library/CpuCacheInfoLib
parentef56f55d19e1b0b4ba6f9b28d73165c7f0a4627c (diff)
downloadedk2-8dd4fc5be6189666b37e5b00131a4173c6a2b085.tar.gz
edk2-8dd4fc5be6189666b37e5b00131a4173c6a2b085.tar.bz2
edk2-8dd4fc5be6189666b37e5b00131a4173c6a2b085.zip
UefiCpuPkg/CpuCacheInfoLib: Correct logical for identifying cache type
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3265 Correct the logical for identifying "Direct mapped" cache type. Signed-off-by: Jason Lou <yun.lou@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com>
Diffstat (limited to 'UefiCpuPkg/Library/CpuCacheInfoLib')
-rw-r--r--UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c b/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
index ae81ea9ce2..c0077d6770 100644
--- a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
+++ b/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
@@ -237,7 +237,7 @@ CpuCacheInfoCollectCoreAndCacheData (
CacheData[CacheParamLeafIndex].CacheType = (UINT8)CacheParamEax.Bits.CacheType;
CacheData[CacheParamLeafIndex].CacheWays = (UINT16)CacheParamEbx.Bits.Ways;
CacheData[CacheParamLeafIndex].FullyAssociativeCache = (UINT8)CacheParamEax.Bits.FullyAssociativeCache;
- CacheData[CacheParamLeafIndex].DirectMappedCache = (UINT8)CacheParamEdx.Bits.ComplexCacheIndexing;
+ CacheData[CacheParamLeafIndex].DirectMappedCache = (UINT8)(CacheParamEdx.Bits.ComplexCacheIndexing == 0);
CacheData[CacheParamLeafIndex].CacheShareBits = (UINT16)CacheParamEax.Bits.MaximumAddressableIdsForLogicalProcessors;
CacheData[CacheParamLeafIndex].CacheSizeinKB = (CacheParamEbx.Bits.Ways + 1) *
(CacheParamEbx.Bits.LinePartitions + 1) * (CacheParamEbx.Bits.LineSize + 1) * (CacheParamEcx + 1) / SIZE_1KB;