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 8DD289416EA for ; Mon, 19 Feb 2024 11:18:54 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=CbPQ9NHuogsZcttdn2UczvGGb1mDxhCOM8Nuiesf/MQ=; 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=1708341533; v=1; b=JFyRFZ8ifGLxIagUL6M/0GtdcY5r8fso4tIJ/5U8apx+5ZiBCcd+GiPQKO2SNjc5uxKDwBog QDoKFhwZf/iS+4IqhFhhoT4a7spbkaWGBs+RJpMVsaOl3HfpOFR3KCRp1OHVC1yZnA846z/W4Ip kiX2tFHjwtSNUIGStnk6drCI= X-Received: by 127.0.0.2 with SMTP id YVd3YY7687511xDrLnWBXzOz; Mon, 19 Feb 2024 03:18:53 -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.web11.39310.1708341532522357412 for ; Mon, 19 Feb 2024 03:18:52 -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-83-04UzKd6zPcG6q50rJN-0kQ-1; Mon, 19 Feb 2024 06:18:50 -0500 X-MC-Unique: 04UzKd6zPcG6q50rJN-0kQ-1 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 C56222806406; Mon, 19 Feb 2024 11:18:49 +0000 (UTC) X-Received: from [10.39.194.20] (unknown [10.39.194.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C43942166B34; Mon, 19 Feb 2024 11:18:48 +0000 (UTC) Message-ID: <321419b1-60e8-4cce-2fcc-30449b054256@redhat.com> Date: Mon, 19 Feb 2024 12:18:47 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH 1/5] UefiCpuPkg/MpInitLib: Add ProcessorIndex argument to GetMpHandOffHob() To: devel@edk2.groups.io, kraxel@redhat.com Cc: Oliver Steffen , Ray Ni , Rahul Kumar References: <20240215093149.251319-1-kraxel@redhat.com> <20240215093149.251319-2-kraxel@redhat.com> From: "Laszlo Ersek" In-Reply-To: <20240215093149.251319-2-kraxel@redhat.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 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: BtVxpMhUEAOMlmNHUXh6JPWSx7686176AA= 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=JFyRFZ8i; 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 2/15/24 10:31, Gerd Hoffmann wrote: > This allows to specify which HOB should be returned in case multiple > MP_HAND_OFF HOBs are present in the system. >=20 > Also add the function prototype to the MpLib.h header file. >=20 > Signed-off-by: Gerd Hoffmann > --- > UefiCpuPkg/Library/MpInitLib/MpLib.h | 12 ++++++++++++ > UefiCpuPkg/Library/MpInitLib/MpLib.c | 20 +++++++++++++------- > 2 files changed, 25 insertions(+), 7 deletions(-) >=20 > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.h b/UefiCpuPkg/Library/Mp= InitLib/MpLib.h > index a96a6389c17d..7e409cceaddf 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.h > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h > @@ -485,6 +485,18 @@ SwitchApContext ( > IN MP_HAND_OFF *MpHandOff > ); > =20 > +/** > + Get pointer to MP_HAND_OFF GUIDed HOB, starting with ProcessorIndex > + > + @param[in] ProcessorIndex. > + > + @return The pointer to MP_HAND_OFF structure. > +**/ > +MP_HAND_OFF * > +GetMpHandOffHob ( > + IN UINT32 ProcessorIndex > + ); > + > /** > Get available EfiBootServicesCode memory below 4GB by specified size. > =20 > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/Mp= InitLib/MpLib.c > index cdfb570e61a0..e0a2366073a7 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c > @@ -1961,25 +1961,31 @@ SwitchApContext ( > } > =20 > /** > - Get pointer to MP_HAND_OFF GUIDed HOB. > + Get pointer to MP_HAND_OFF GUIDed HOB, starting with ProcessorIndex > + > + @param[in] ProcessorIndex. > =20 > @return The pointer to MP_HAND_OFF structure. > **/ > MP_HAND_OFF * > GetMpHandOffHob ( > - VOID > + IN UINT32 ProcessorIndex > ) > { > EFI_HOB_GUID_TYPE *GuidHob; > MP_HAND_OFF *MpHandOff; > =20 > - MpHandOff =3D NULL; > - GuidHob =3D GetFirstGuidHob (&mMpHandOffGuid); > - if (GuidHob !=3D NULL) { > + for (GuidHob =3D GetFirstGuidHob (&mMpHandOffGuid); > + GuidHob !=3D NULL; > + GuidHob =3D GetNextGuidHob (&mMpHandOffGuid, GET_NEXT_HOB (GuidHo= b))) > + { > MpHandOff =3D (MP_HAND_OFF *)GET_GUID_HOB_DATA (GuidHob); > + if (MpHandOff->ProcessorIndex =3D=3D ProcessorIndex) { > + return MpHandOff; > + } > } > =20 > - return MpHandOff; > + return NULL; > } > =20 > /** > @@ -2020,7 +2026,7 @@ MpInitLibInitialize ( > UINTN BackupBufferAddr; > UINTN ApIdtBase; > =20 > - MpHandOff =3D GetMpHandOffHob (); > + MpHandOff =3D GetMpHandOffHob (0); > if (MpHandOff =3D=3D NULL) { > MaxLogicalProcessorNumber =3D PcdGet32 (PcdCpuMaxLogicalProcessorNum= ber); > } else { Seems to do what it says on the tin; not sure what it's going to be good for, though. 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 (#115591): https://edk2.groups.io/g/devel/message/115591 Mute This Topic: https://groups.io/mt/104369841/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-