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 1DE827803CC for ; Mon, 13 Nov 2023 15:38:15 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=/Xw+aq8M1CdsQ+s2b0SQKousFm5yzJYZPy/+Nxo7GVY=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1699889894; v=1; b=kG/3S3Ug26bWdVtV+R0RtzXr5Ky4IBqe21C+h3/Y3H22gW+ch5TU99ADThsb4uVz0N3xTg2s 0ZDdYFSBMQo9JmlgNOMb+LmRXcLOWRpvVhbfE2Kylcd+8KkGW4N73MwOO8To3vejx9weuHXh8bk hsvqcX/SygA/fdG5Ok/AdVUc= X-Received: by 127.0.0.2 with SMTP id TJp5YY7687511xw75BPQqqHn; Mon, 13 Nov 2023 07:38:14 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.39961.1699889892075406134 for ; Mon, 13 Nov 2023 07:38:12 -0800 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-592-Ij1YwDN7NKu6QNkwBmsCxQ-1; Mon, 13 Nov 2023 10:38:08 -0500 X-MC-Unique: Ij1YwDN7NKu6QNkwBmsCxQ-1 X-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 771EC3C0BE25; Mon, 13 Nov 2023 15:38:07 +0000 (UTC) X-Received: from [10.39.192.220] (unknown [10.39.192.220]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 253831C060AE; Mon, 13 Nov 2023 15:38:05 +0000 (UTC) Message-ID: <4414f894-42c6-9c4b-df6d-ee5cbddc791a@redhat.com> Date: Mon, 13 Nov 2023 16:38:04 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v1] UefiCpuPkg/PiSmmCpuDxeSmm: Use processor extended information To: devel@edk2.groups.io, jiaxin.wu@intel.com Cc: Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann , Star Zeng References: <20231107024311.14424-1-jiaxin.wu@intel.com> From: "Laszlo Ersek" In-Reply-To: <20231107024311.14424-1-jiaxin.wu@intel.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.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,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: phqtuZHYmHiD5KbBpkMUAiznx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="kG/3S3Ug"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.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 On 11/7/23 03:43, Wu, Jiaxin wrote: > Processor extended information is filled when > CPU_V2_EXTENDED_TOPOLOGY is set in parameter ProcessorNumber > from GetProcessorInfo() (See commit: 1fadd18d). >=20 > This filed value is retrieved from CPUID leaf 1FH, which is > a preferred superset to leaf 0BH. >=20 > 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. >=20 > 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(-) >=20 > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c b/UefiCpuPkg/PiSmmCpu= DxeSmm/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.Locati= on2.Package, > + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Locati= on2.Die, > + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Locati= on2.Tile, > + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Locati= on2.Module, > + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Locati= on2.Core, > + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Locati= on2.Thread > + ); > + > *ProcessorNumber =3D Index; > gSmmCpuPrivate->Operation[Index] =3D SmmCpuAdd; > return EFI_SUCCESS; > } > } > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuD= xeSmm/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.Pac= kage; > + PackageIndex =3D gSmmCpuPrivate->ProcessorInfo[CpuIndex].ExtendedInfo= rmation.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.Packag= e) { > - PackageId =3D gSmmCpuPrivate->ProcessorInfo[Index].Location.Packag= e; > + if (PackageId < gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInforma= tion.Location2.Package) { > + PackageId =3D gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInforma= tion.Location2.Package; > } > } > =20 > PackageCount =3D PackageId + 1; > =20 Regression-tested-by: Laszlo Ersek -=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 (#111161): https://edk2.groups.io/g/devel/message/111161 Mute This Topic: https://groups.io/mt/102436095/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-