From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 03413940F36 for ; Tue, 7 Nov 2023 02:43:18 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=1iXl1qdxK8NRm1J/4d+khUYbvGJ5e1RCYhLB2gE6Zrk=; 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=RzJCyN8r1s0Vz8Bm+lov2gpQAm87tKE/92qiWsYqOYe3Qw3wmIAApvB5pwmtD8lB9IaNyr/7 Gono7FBPbGmC2w9Wn2ymhpncc512S++ifnvpwwQlK8oDDuwRDAgBALPNfctf5KyMhytNxv2v0Rh n44ZIfj8Oz4CEDPGP214gcFM= X-Received: by 127.0.0.2 with SMTP id uGACYY7687511xD6BBVm8BmT; 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: KPfos0fS2FddUnMDiKjONfWvx7686176AA= X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=RzJCyN8r; 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 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io 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 --- 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/PiSmmCpuDxeSmm/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 ); + GetProcessorLocation2ByApicId ( + (UINT32)ProcessorId, + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Location2.Package, + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Location2.Die, + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Location2.Tile, + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Location2.Module, + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Location2.Core, + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Location2.Thread + ); + *ProcessorNumber = Index; gSmmCpuPrivate->Operation[Index] = SmmCpuAdd; return EFI_SUCCESS; } } diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxeSmm/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; - PackageIndex = gSmmCpuPrivate->ProcessorInfo[CpuIndex].Location.Package; + PackageIndex = gSmmCpuPrivate->ProcessorInfo[CpuIndex].ExtendedInformation.Location2.Package; ASSERT (mPackageFirstThreadIndex != NULL); // // Set the value of mPackageFirstThreadIndex[PackageIndex]. @@ -1834,12 +1834,12 @@ InitPackageFirstThreadIndexInfo ( // // Count the number of package, set to max PackageId + 1 // for (Index = 0; Index < mNumberOfCpus; Index++) { - if (PackageId < gSmmCpuPrivate->ProcessorInfo[Index].Location.Package) { - PackageId = gSmmCpuPrivate->ProcessorInfo[Index].Location.Package; + if (PackageId < gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Location2.Package) { + PackageId = gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Location2.Package; } } PackageCount = PackageId + 1; -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- 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/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-