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 7F2FE74003A for ; Mon, 13 Nov 2023 15:39:03 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=bE+pj6J3kjpHbnqqwAe/IAWzCyw7NLPzDE7CFxf4Hk4=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: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=1699889942; v=1; b=KWdiXNqrWlLeprA9OyA1WAvJeUSSYpiONZ8NitLJC3omYvcvmlvaSo3j28VCHoLNshp7EoW1 gBI6wAAXLxcDb5fthpU5IelCE0+E0I0VqSRhjeVb4PKkmGigfH4PLZc1SqD7J3nOufY5T3aG6Cn VG81iHhIoTPcP3ImPYn9shiQ= X-Received: by 127.0.0.2 with SMTP id E6CSYY7687511xRpmLeNmh9i; Mon, 13 Nov 2023 07:39:02 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.39849.1699889941528934770 for ; Mon, 13 Nov 2023 07:39:01 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-349-GFyUJ1TRPi2lUBDOiOnSxw-1; Mon, 13 Nov 2023 10:38:56 -0500 X-MC-Unique: GFyUJ1TRPi2lUBDOiOnSxw-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 68FCD892240; Mon, 13 Nov 2023 15:38:56 +0000 (UTC) X-Received: from [10.39.192.220] (unknown [10.39.192.220]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 47B1A143; Mon, 13 Nov 2023 15:38:55 +0000 (UTC) Message-ID: Date: Mon, 13 Nov 2023 16:38:54 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v1] UefiCpuPkg/PiSmmCpuDxeSmm: Use processor extended information From: "Laszlo Ersek" 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> <4414f894-42c6-9c4b-df6d-ee5cbddc791a@redhat.com> In-Reply-To: <4414f894-42c6-9c4b-df6d-ee5cbddc791a@redhat.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 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: ffHu06QMPAY8fJSK8IpXnG7Zx7686176AA= 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=KWdiXNqr; 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/13/23 16:38, Laszlo Ersek wrote: > 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). >> >> 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/PiSmmCp= uDxeSmm/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.Locat= ion2.Package, >> + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Locat= ion2.Die, >> + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Locat= ion2.Tile, >> + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Locat= ion2.Module, >> + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Locat= ion2.Core, >> + &gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInformation.Locat= ion2.Thread >> + ); >> + >> *ProcessorNumber =3D Index; >> gSmmCpuPrivate->Operation[Index] =3D SmmCpuAdd; >> return EFI_SUCCESS; >> } >> } >> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpu= DxeSmm/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.Pa= ckage; >> + PackageIndex =3D gSmmCpuPrivate->ProcessorInfo[CpuIndex].ExtendedInf= ormation.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.Packa= ge) { >> - PackageId =3D gSmmCpuPrivate->ProcessorInfo[Index].Location.Packa= ge; >> + if (PackageId < gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInform= ation.Location2.Package) { >> + PackageId =3D gSmmCpuPrivate->ProcessorInfo[Index].ExtendedInform= ation.Location2.Package; >> } >> } >> =20 >> PackageCount =3D PackageId + 1; >> =20 >=20 > Regression-tested-by: Laszlo Ersek >=20 also Reviewed-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 (#111162): https://edk2.groups.io/g/devel/message/111162 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-