From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.31700.1628821757585872380 for ; Thu, 12 Aug 2021 19:29:17 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: yun.lou@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10074"; a="212375595" X-IronPort-AV: E=Sophos;i="5.84,317,1620716400"; d="scan'208";a="212375595" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2021 19:29:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,317,1620716400"; d="scan'208";a="517806410" Received: from shwdeopenlab102.ccr.corp.intel.com ([10.239.183.74]) by FMSMGA003.fm.intel.com with ESMTP; 12 Aug 2021 19:29:14 -0700 From: "Jason Lou" To: devel@edk2.groups.io Cc: Jason , Ray Ni , Eric Dong , Laszlo Ersek , Rahul Kumar Subject: [PATCH v1] UefiCpuPkg/CpuCacheInfoLib: Correct logical for identifying cache type Date: Fri, 13 Aug 2021 10:29:09 +0800 Message-Id: <20210813022909.6092-1-yun.lou@intel.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3265 Correct the logical for identifying "Direct mapped" cache type. Signed-off-by: Jason Lou Cc: Ray Ni Cc: Eric Dong Cc: Laszlo Ersek Cc: Rahul 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..d66f0300ce 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)(!Cach= eParamEdx.Bits.ComplexCacheIndexing);=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