[PATCH v2] UefiCpuPkg/CpuCacheInfoLib: Correct logical for identifying cache type


Jason Lou
 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3265

Correct the logical for identifying "Direct mapped" cache type.

Signed-off-by: Jason Lou <yun.lou@...>
Cc: Ray Ni <ray.ni@...>
Cc: Eric Dong <eric.dong@...>
Cc: Laszlo Ersek <lersek@...>
Cc: Rahul Kumar <rahul1.kumar@...>
---
UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c b/UefiCpu=
Pkg/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 =3D (UINT8)CacheP=
aramEax.Bits.CacheType;=0D
CacheData[CacheParamLeafIndex].CacheWays =3D (UINT16)Cache=
ParamEbx.Bits.Ways;=0D
CacheData[CacheParamLeafIndex].FullyAssociativeCache =3D (UINT8)CacheP=
aramEax.Bits.FullyAssociativeCache;=0D
- CacheData[CacheParamLeafIndex].DirectMappedCache =3D (UINT8)CacheP=
aramEdx.Bits.ComplexCacheIndexing;=0D
+ CacheData[CacheParamLeafIndex].DirectMappedCache =3D (UINT8)(Cache=
ParamEdx.Bits.ComplexCacheIndexing =3D=3D 0);=0D
CacheData[CacheParamLeafIndex].CacheShareBits =3D (UINT16)Cache=
ParamEax.Bits.MaximumAddressableIdsForLogicalProcessors;=0D
CacheData[CacheParamLeafIndex].CacheSizeinKB =3D (CacheParamEb=
x.Bits.Ways + 1) *=0D
(CacheParamEbx.Bits.LinePartitions + 1) * (CacheParamEbx.Bits.Line=
Size + 1) * (CacheParamEcx + 1) / SIZE_1KB;=0D
--=20
2.28.0.windows.1

Join devel@edk2.groups.io to automatically receive all group messages.