From: "Yuanhao Xie" <yuanhao.xie@intel.com>
To: devel@edk2.groups.io
Subject: [edk2-devel] [PATCH 1/1] UefiCpuPkg: Correct the count of different type of Cache.
Date: Tue, 18 Jun 2024 21:34:57 +0800 [thread overview]
Message-ID: <20240618133457.1018-2-yuanhao.xie@intel.com> (raw)
In-Reply-To: <20240618133457.1018-1-yuanhao.xie@intel.com>
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 kraxel@redhat.com
Cc: Eric Dong eric.dong@intel.com
Cc: Ray Ni ray.ni@intel.com
Cc: Rahul Kumar rahul1.kumar@intel.com
Cc: Tom Lendacky thomas.lendacky@amd.com
Signed-off-by: xieyuanh <yuanhao.xie@intel.com>
---
UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c b/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
index c7973735e1..df07a10a2a 100644
--- a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
+++ b/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
@@ -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;
--
2.39.1.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119609): https://edk2.groups.io/g/devel/message/119609
Mute This Topic: https://groups.io/mt/106740629/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2024-06-18 13:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-18 13:34 [edk2-devel] [PATCH 0/1] UefiCpuPkg: Correct the count of different type of Cache Yuanhao Xie
2024-06-18 13:34 ` Yuanhao Xie [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-06-19 3:44 Yuanhao Xie
2024-06-19 3:44 ` [edk2-devel] [PATCH 1/1] " Yuanhao Xie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240618133457.1018-2-yuanhao.xie@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox