From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id D3541740032 for ; Wed, 19 Jun 2024 03:45:08 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=cq8OrCVrarNsne/6g4jVJKF6LmLy9sRmqJc+GXG9vuA=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1718768708; v=1; b=DKqHmfnrxDaLUvTucQrndJqjyJvabRi07Mu4MXbDwEC819Z/eN8OVYS8DJIDodDldmIarvsV pmXN4rqFUDfjaN2IJO5muCbU4zKD/cn1774ZFzFEBuSMb5ayxcxM3sRJlLTpRaQugqqy+zRefP7 lmnPIWmY2GvfkNcoHSDgfXgMU0vgoF1vAXKhFEyKVGW5bephVclGhj3UhgkUo3ohczZ9F/Sq54p ODExidRckYHHG/zcJLz1SnSJBOh1Ci5kpTpXrc/s4n5I33dmemlSTLdyb0XSD/ncpu2P5mP1l0i TzsWZ1010WBJhOfbYu2x4FD9BiI5eiEQIKyASStf24Hiw== X-Received: by 127.0.0.2 with SMTP id l1Z9YY7687511xAweGtS46Fa; Tue, 18 Jun 2024 20:45:07 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by mx.groups.io with SMTP id smtpd.web10.12563.1718768698977412442 for ; Tue, 18 Jun 2024 20:45:01 -0700 X-CSE-ConnectionGUID: njlTFxfhSyWHOpeE+8x59w== X-CSE-MsgGUID: LS8WYzIvQmeEDGVs+yiDpA== X-IronPort-AV: E=McAfee;i="6700,10204,11107"; a="15917929" X-IronPort-AV: E=Sophos;i="6.08,249,1712646000"; d="scan'208";a="15917929" X-Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2024 20:45:02 -0700 X-CSE-ConnectionGUID: ciCez7k+SUuhDI/oNafiSw== X-CSE-MsgGUID: C7LZCi7DQcSt0k1sUQQiJA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,249,1712646000"; d="scan'208";a="46690491" X-Received: from xieyuanh-mobl.ccr.corp.intel.com ([10.238.2.133]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2024 20:45:00 -0700 From: "Yuanhao Xie" To: devel@edk2.groups.io Cc: Gerd Hoffmann , Eric Dong , Ray Ni , Rahul Kumar , Tom Lendacky Subject: [edk2-devel] [PATCH 1/1] UefiCpuPkg: Correct the count of different type of Cache. Date: Wed, 19 Jun 2024 11:44:43 +0800 Message-ID: <20240619034443.1763-2-yuanhao.xie@intel.com> In-Reply-To: <20240619034443.1763-1-yuanhao.xie@intel.com> References: <20240619034443.1763-1-yuanhao.xie@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Tue, 18 Jun 2024 20:45:01 -0700 Resent-From: yuanhao.xie@intel.com Reply-To: devel@edk2.groups.io,yuanhao.xie@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: AdGvb8JruLRNYJzqq56Lx7Bbx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=DKqHmfnr; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io 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 Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Tom Lendacky Signed-off-by: xieyuanh --- 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 (#119624): https://edk2.groups.io/g/devel/message/119624 Mute This Topic: https://groups.io/mt/106754527/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-