From nobody Fri May 17 00:59:51 2024 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+110786+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+110786+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1699324997; cv=none; d=zohomail.com; s=zohoarc; b=Gct62i3RGJghq0c1gt64t290SLrBSAyoEffvlDEkZtVFLb1mCpEji7KLI8L6zoYYaF0AOog46CNGomFgShqQbotv2QS2xBssRzdNThn/Jj0WQcQzn7Yzd54jeJJOvAfoot6q3jGt4+aT5fdwq6sRhkF4XRbnbX0THi0+Pa7ES8g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699324997; h=Cc:Cc:Date:Date:From:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:Message-ID:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=NErZ9g6b9Id1JXDh6WZFAAQCuUzIFU2NgNUqxfz0d5I=; b=haCaOKcsSbjNcsXzWYqK/qEbgkCuhZ8l7Hq3FXS18izu5sdEEYZP6rNBoMAqEQJTw4Adyi9Lal4xA+Gl9dqeiy5emzHlIrI7F98SWqpWyY/33cfM6ofOqAINYkID7Ijx1cSuSnrXIBVgfhL6Y++bZjtP0Z+45vlYrm3LIGah/T4= 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+110786+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 1699324997956220.35636020970037; Mon, 6 Nov 2023 18:43:17 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=EgJeHPQA3PKwqay3F+FPjp56zVyUmts2of4iV2oMmZM=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe; s=20140610; t=1699324997; v=1; b=QsfhIu689RMdgS8TywgmMJtjglI7ZPLJQZQXS8Zcoo1mMAG3R6S0ymMpgGvImZJ5Y3zPqPmj CWU6VSTSs0S1EYkntMG716fOF3EOL8nfrsxOD0uw0jc/x3LO6QjPX+5NoFVa1rROooXmbgM/m7b cVj5w9feMTQSZ76NQFiohAco= X-Received: by 127.0.0.2 with SMTP id DJhWYY1788612xeyazlj5kBA; Mon, 06 Nov 2023 18:43:17 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by mx.groups.io with SMTP id smtpd.web11.2017.1699324996829216501 for ; Mon, 06 Nov 2023 18:43:17 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10886"; a="2339101" X-IronPort-AV: E=Sophos;i="6.03,282,1694761200"; d="scan'208";a="2339101" X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 18:43:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10886"; a="1009717854" X-IronPort-AV: E=Sophos;i="6.03,282,1694761200"; d="scan'208";a="1009717854" X-Received: from sh1gapp1009.ccr.corp.intel.com ([10.239.189.219]) by fmsmga006.fm.intel.com with ESMTP; 06 Nov 2023 18:43:13 -0800 From: "Wu, Jiaxin" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann , Star Zeng Subject: [edk2-devel] [PATCH v1] UefiCpuPkg/PiSmmCpuDxeSmm: Use processor extended information Date: Tue, 7 Nov 2023 10:43:11 +0800 Message-Id: <20231107024311.14424-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: FPMHEpicAP6BP808vjQtcvOPx1787277AA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1699324998967100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Processor extended information is filled when CPU_V2_EXTENDED_TOPOLOGY is set in parameter ProcessorNumber from GetProcessorInfo() (See commit: 1fadd18d). This filed value is retrieved from CPUID leaf 1FH, which is a preferred superset to leaf 0BH. Since Intel recommends first use the CPUID leaf 1FH instead of leaf 0BH, this patch change to use the processor extended information, which can reflect the value from CPUID leaf 1FH. Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Star Zeng Signed-off-by: Jiaxin Wu Reviewed-by: Laszlo Ersek --- UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c | 10 ++++++++++ UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c b/UefiCpuPkg/PiSmmCpuDx= eSmm/CpuService.c index 391b64e9f2..c0485b0519 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c @@ -169,10 +169,20 @@ SmmAddProcessor ( &gSmmCpuPrivate->ProcessorInfo[Index].Location.Package, &gSmmCpuPrivate->ProcessorInfo[Index].Location.Core, &gSmmCpuPrivate->ProcessorInfo[Index].Location.Thread ); =20 + GetProcessorLocation2ByApicId ( + (UINT32)ProcessorId, + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Location= 2.Package, + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Location= 2.Die, + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Location= 2.Tile, + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Location= 2.Module, + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Location= 2.Core, + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Location= 2.Thread + ); + *ProcessorNumber =3D Index; gSmmCpuPrivate->Operation[Index] =3D SmmCpuAdd; return EFI_SUCCESS; } } 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 (#110786): https://edk2.groups.io/g/devel/message/110786 Mute This Topic: https://groups.io/mt/102436095/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-