* [PATCH v1] UefiCpuPkg/CpuCacheInfoLib: Correct logical for identifying cache type
@ 2021-08-13 2:29 Jason Lou
2021-08-13 8:51 ` Ni, Ray
0 siblings, 1 reply; 3+ messages in thread
From: Jason Lou @ 2021-08-13 2:29 UTC (permalink / raw)
To: devel; +Cc: Jason, Ray Ni, Eric Dong, Laszlo Ersek, Rahul Kumar
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>
Cc: 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>
---
UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c b/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
index ae81ea9ce2..d66f0300ce 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);
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;
--
2.28.0.windows.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1] UefiCpuPkg/CpuCacheInfoLib: Correct logical for identifying cache type
2021-08-13 2:29 [PATCH v1] UefiCpuPkg/CpuCacheInfoLib: Correct logical for identifying cache type Jason Lou
@ 2021-08-13 8:51 ` Ni, Ray
2021-08-13 13:16 ` [edk2-devel] " Jason Lou
0 siblings, 1 reply; 3+ messages in thread
From: Ni, Ray @ 2021-08-13 8:51 UTC (permalink / raw)
To: Lou, Yun, devel@edk2.groups.io; +Cc: Dong, Eric, Laszlo Ersek, Kumar, Rahul1
> + CacheData[CacheParamLeafIndex].DirectMappedCache = (UINT8)(!CacheParamEdx.Bits.ComplexCacheIndexing);
Instead of using "!", can you please use "CacheParamEdx.Bits.ComplexCacheIndexing == 0"? This is more readable.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [edk2-devel] [PATCH v1] UefiCpuPkg/CpuCacheInfoLib: Correct logical for identifying cache type
2021-08-13 8:51 ` Ni, Ray
@ 2021-08-13 13:16 ` Jason Lou
0 siblings, 0 replies; 3+ messages in thread
From: Jason Lou @ 2021-08-13 13:16 UTC (permalink / raw)
To: Ni, Ray, devel
[-- Attachment #1: Type: text/plain, Size: 47 bytes --]
Sure, I will change it in next version patch.
[-- Attachment #2: Type: text/html, Size: 47 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-08-13 13:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-13 2:29 [PATCH v1] UefiCpuPkg/CpuCacheInfoLib: Correct logical for identifying cache type Jason Lou
2021-08-13 8:51 ` Ni, Ray
2021-08-13 13:16 ` [edk2-devel] " Jason Lou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox