Skip to content

Commit

Permalink
UefiCpuPkg: Correct the count of different type of Cache.
Browse files Browse the repository at this point in the history
This patch fixes an error in calculating cache sizes for cores from
different Dies. The original code incorrectly cleared cache sizes for
different core types during intermediate calculation steps, leading to
mistakes in counting duplicate entries. This patch adds a check for
cache size to distinguish between different cache types.

Cc: Gerd Hoffmann <[email protected]>
Cc: Eric Dong <[email protected]>
Cc: Ray Ni <[email protected]>
Cc: Rahul Kumar <[email protected]>
Cc: Tom Lendacky <[email protected]>
Signed-off-by: xieyuanh <[email protected]>
  • Loading branch information
xieyuanh authored and mergify[bot] committed Jun 21, 2024
1 parent 57a890f commit d512bd3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ CpuCacheInfoCollectCpuCacheInfoData (
if ((LocalCacheInfo[CacheInfoIndex].Package == ProcessorInfo[Index / MAX_NUM_OF_CACHE_PARAMS_LEAF].Package) &&
(LocalCacheInfo[CacheInfoIndex].CoreType == ProcessorInfo[Index / MAX_NUM_OF_CACHE_PARAMS_LEAF].CoreType) &&
(LocalCacheInfo[CacheInfoIndex].CacheLevel == CacheData[Index].CacheLevel) &&
(LocalCacheInfo[CacheInfoIndex].CacheType == CacheData[Index].CacheType))
(LocalCacheInfo[CacheInfoIndex].CacheType == CacheData[Index].CacheType) &&
(LocalCacheInfo[CacheInfoIndex].CacheSizeinKB == CacheData[Index].CacheSizeinKB))
{
LocalCacheInfo[CacheInfoIndex].CacheCount++;
break;
Expand Down

0 comments on commit d512bd3

Please sign in to comment.