From nobody Mon Feb 9 21:20:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+111259+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+111259+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1700046975; cv=none; d=zohomail.com; s=zohoarc; b=jdcl6nGTLmjb9lsRGDgYYtOXuzdlH8giNp2cqnrRuNA6bac9GKFmhrU84n3+jYMUIs5IF5siPEamP6FP0WHXSwgmOHnuogMNYHebO4BaNvm6wL81TGtd8LfZ6o/wG5A9XZ0jrL0T4ORQkmtArWEU2iHD1CIHx2YsRCeWjEtUPdQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700046975; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=s4sRK2Hiva1xhS5ROKUy22OTpzYVIbJVPg02OoNtKkU=; b=U4YoFRh32pQskoKUnmPt80RajcNMPFHCoM2jxvgdNx0FNHK4AF4MpgDAkmVpaxSnZxZq9Xakmyz7HizdyQMmCWGcA27v8P6UbTliZE6V8xcSLTpJaTnhHkNIvjnilJIfXADE+Wr6cRXNDqrwbBIPQLn1S+Q7sGs4/ls8FE99e1k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+111259+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700046975243504.24138257149446; Wed, 15 Nov 2023 03:16:15 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=6LL9JIStzXJN/egOogy3MwuJkZ+VcaLwnTjgT3biLws=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe; s=20140610; t=1700046974; v=1; b=uRlTGBTf+mCBPRzhSP+PLGTjjP8NCTPzslTGj/0Vqa4IiQobUTeRolZrVrX4yLYq/RcyOOma QclftMbdiSi4bjB5oGsYJFI0tnSbAxgw+5VQddGb/S34gXp9Qj/cHX5k/vO9xisaa5rt/BNcjHY W1xRTull+x5qgz+kdzbpjTg0= X-Received: by 127.0.0.2 with SMTP id IFjqYY1788612xgBQihLu6Vj; Wed, 15 Nov 2023 03:16:14 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.10782.1700046959669687038 for ; Wed, 15 Nov 2023 03:16:04 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10894"; a="455148446" X-IronPort-AV: E=Sophos;i="6.03,304,1694761200"; d="scan'208";a="455148446" X-Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2023 03:16:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10894"; a="1096420858" X-IronPort-AV: E=Sophos;i="6.03,304,1694761200"; d="scan'208";a="1096420858" X-Received: from sh1gapp1009.ccr.corp.intel.com ([10.239.189.219]) by fmsmga005.fm.intel.com with ESMTP; 15 Nov 2023 03:16:02 -0800 From: "Wu, Jiaxin" To: devel@edk2.groups.io Cc: Laszlo Ersek , Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann , Star Zeng Subject: [edk2-devel] [PATCH v2 3/3] UefiCpuPkg/PiSmmCpuDxeSmm: Use processor extended information Date: Wed, 15 Nov 2023 19:15:53 +0800 Message-Id: <20231115111553.6592-4-jiaxin.wu@intel.com> In-Reply-To: <20231115111553.6592-1-jiaxin.wu@intel.com> References: <20231115111553.6592-1-jiaxin.wu@intel.com> 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 Reply-To: devel@edk2.groups.io,jiaxin.wu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: cSLem0wT4DHWF94tkvtk6QNKx1787277AA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700046977426100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch changes to use the processor extended information, which can reflect the value from CPUID leaf 1FH. The reasons are listed as below: 1. The processor package ID retrieved from CPUID 0x0Bh may be not correct/accurate if CPU has the module & die info, it depends on the CPUID implementation. See SDM statement: EAX Bits 04 - 00: Number of bits to shift right on x2APIC ID to get a unique topology ID of the next level type. ECX Bits 15 - 08: level type Level type field has the following encoding: 0: Invalid. 1: SMT. 2: Core. 3-255: Reserved So, if level type returned from ECX Bits 15 - 08 is 2 (Core), then it's not clear about the next level. It can be Module or Die or Package. SDM doesn't has explanation for the next level of Core. If so, the value will be decided by implementation. The value can be package info for compatibility consideration, but it's not standardized. 2. According SDM declaration, "CPUID leaf 1FH is a preferred superset to leaf 0BH. Intel recommends first checking for the existence of CPUID leaf 1FH before using leaf 0BH." This is perfect match the existing GetProcessorLocation2ByApicId() implementation. Cc: Laszlo Ersek Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Star Zeng Signed-off-by: Jiaxin Wu Reviewed-by: Laszlo Ersek Regression-tested-by: Laszlo Ersek --- UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxe= Smm/MpService.c index 25d058c5b9..c61562c867 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c @@ -177,11 +177,11 @@ IsPackageFirstThread ( IN UINTN CpuIndex ) { UINT32 PackageIndex; =20 - PackageIndex =3D gSmmCpuPrivate->ProcessorInfo[CpuIndex].Location.Packa= ge; + PackageIndex =3D gSmmCpuPrivate->ProcessorInfo[CpuIndex].ExtendedInform= ation.Location2.Package; =20 ASSERT (mPackageFirstThreadIndex !=3D NULL); =20 // // Set the value of mPackageFirstThreadIndex[PackageIndex]. @@ -1834,12 +1834,12 @@ InitPackageFirstThreadIndexInfo ( =20 // // Count the number of package, set to max PackageId + 1 // for (Index =3D 0; Index < mNumberOfCpus; Index++) { - if (PackageId < gSmmCpuPrivate->ProcessorInfo[Index].Location.Package)= { - PackageId =3D gSmmCpuPrivate->ProcessorInfo[Index].Location.Package; + if (PackageId < gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformati= on.Location2.Package) { + PackageId =3D gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformati= on.Location2.Package; } } =20 PackageCount =3D PackageId + 1; =20 --=20 2.16.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111259): https://edk2.groups.io/g/devel/message/111259 Mute This Topic: https://groups.io/mt/102602853/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-