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 A4B2394169B for ; Tue, 18 Jun 2024 13:35:21 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=xHlYYJ+e74iZVgtsn8W+qW1Sx+HfuRye8H6p6aJhTD4=; c=relaxed/simple; d=groups.io; h=From:To: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=1718717721; v=1; b=Zf3aSxm6V5vq6HTIVh5rIurnysciqw7dZsgFSFHN16pE9oUzTr7NF2Cd9r5u037wTboRx65x sS+9z3UsuZ+tnpiB6vugWgHvfuWqI/UmETYZzdLwlMCk9ACbJSOVjdy/hDPqV6100JfT9A13tyJ 0kLCDNP+ATz6mEjzrsOzIg4JTHuajECfBUDEQGOxyw9ITYqkh71aehaQpaycXweVMcUlBDrCTSy pN6Fzne9sTFgg6Buy+L4a8dhFwHtnXmlQVuRRhFqix0nFsLuIIa2W3ovuTMGz7zLUjCgTKO3zuh 1tBagh1vB9OKy4R/geDeS/7/QJrcsHpvm2kZJZOWJSrTg== X-Received: by 127.0.0.2 with SMTP id 6K0FYY7687511xlfgGRwtpnt; Tue, 18 Jun 2024 06:35:20 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by mx.groups.io with SMTP id smtpd.web10.86749.1718717717358360526 for ; Tue, 18 Jun 2024 06:35:19 -0700 X-CSE-ConnectionGUID: wRT3uTYxSLqe9jj3zQ5L6Q== X-CSE-MsgGUID: W+j1KIyWSBqQdf7XdzNssg== X-IronPort-AV: E=McAfee;i="6700,10204,11107"; a="15715033" X-IronPort-AV: E=Sophos;i="6.08,247,1712646000"; d="scan'208";a="15715033" X-Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2024 06:35:19 -0700 X-CSE-ConnectionGUID: 1u09/IAgTBGLmcUZq8pQOA== X-CSE-MsgGUID: 4kbzqjfPQKa1nUmU51lpHQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,247,1712646000"; d="scan'208";a="42238298" X-Received: from xieyuanh-mobl.ccr.corp.intel.com ([10.238.2.133]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2024 06:35:19 -0700 From: "Yuanhao Xie" 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 Message-ID: <20240618133457.1018-2-yuanhao.xie@intel.com> In-Reply-To: <20240618133457.1018-1-yuanhao.xie@intel.com> References: <20240618133457.1018-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 06:35:19 -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: 7LHk878IaCIHTlkHLCvHX3BUx7686176AA= 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=Zf3aSxm6; 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 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 --- 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] -=-=-=-=-=-=-=-=-=-=-=-