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 D1C8AAC030E for ; Thu, 22 Feb 2024 00:38:47 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=Mt3cd0EoCPmFSJjA24eirpY72vW2rDIbjdszn3WllzI=; 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=1708562326; v=1; b=EK6It0G66mGyY1ny7MuvBPqNDa86dJq8b7zp7MYYxHeq84e6HeuCScilW3cRZ8KhR7QCbq84 BfUjw+kqDoO0kZwtChL90TXnDb7hqcHruFW3JujAklslcPZV5wIvrPA4D0EQoZYtom8Fi/hncvV x4d0wCTclv4h+TXHk5G6vDVQ= X-Received: by 127.0.0.2 with SMTP id s9BFYY7687511x0eTaiMFJWx; Wed, 21 Feb 2024 16:38:46 -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.2526.1708562325865142731 for ; Wed, 21 Feb 2024 16:38:46 -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-175-3O3Ww9FBOZqk8OXp5TvOAQ-1; Wed, 21 Feb 2024 19:38:42 -0500 X-MC-Unique: 3O3Ww9FBOZqk8OXp5TvOAQ-1 X-Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 D899C3869150; Thu, 22 Feb 2024 00:38:36 +0000 (UTC) X-Received: from [10.39.192.46] (unknown [10.39.192.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D1FE0492BD7; Thu, 22 Feb 2024 00:38:35 +0000 (UTC) Message-ID: <779f54b6-7efd-6e8f-5e78-ed573bc5656f@redhat.com> Date: Thu, 22 Feb 2024 01:38:34 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v2 2/5] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetBspNumber() To: devel@edk2.groups.io, kraxel@redhat.com Cc: Oliver Steffen , Rahul Kumar , Ray Ni References: <20240220174939.1288689-1-kraxel@redhat.com> <20240220174939.1288689-3-kraxel@redhat.com> From: "Laszlo Ersek" In-Reply-To: <20240220174939.1288689-3-kraxel@redhat.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 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: aKciQb6Rsm0iwHFmZjDR09mcx7686176AA= 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=EK6It0G6; 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/20/24 18:49, Gerd Hoffmann wrote: > Rename the MpHandOff parameter to FirstMpHandOff. Add a loop so the > function inspects all HOBs present in the system. >=20 > Signed-off-by: Gerd Hoffmann > --- > UefiCpuPkg/Library/MpInitLib/MpLib.c | 23 +++++++++++++++-------- > 1 file changed, 15 insertions(+), 8 deletions(-) >=20 > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/Mp= InitLib/MpLib.c > index e764bc9e4228..8f198ff6d817 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c > @@ -1894,26 +1894,33 @@ CheckAllAPs ( > /** > This function Get BspNumber. > =20 > - @param[in] MpHandOff Pointer to MpHandOff > + @param[in] FirstMpHandOff Pointer to first MpHandOff HOB. ... also, it would be more precise to say "first MpHandOff HOB body". Laszlo > @return BspNumber > **/ > UINT32 > GetBspNumber ( > - IN CONST MP_HAND_OFF *MpHandOff > + IN CONST MP_HAND_OFF *FirstMpHandOff > ) > { > - UINT32 ApicId; > - UINT32 BspNumber; > - UINT32 Index; > + UINT32 ApicId; > + UINT32 BspNumber; > + UINT32 Index; > + CONST MP_HAND_OFF *MpHandOff; > =20 > // > // Get the processor number for the BSP > // > BspNumber =3D MAX_UINT32; > ApicId =3D GetInitialApicId (); > - for (Index =3D 0; Index < MpHandOff->CpuCount; Index++) { > - if (MpHandOff->Info[Index].ApicId =3D=3D ApicId) { > - BspNumber =3D Index; > + > + for (MpHandOff =3D FirstMpHandOff; > + MpHandOff !=3D NULL; > + MpHandOff =3D GetNextMpHandOffHob (MpHandOff)) > + { > + for (Index =3D 0; Index < MpHandOff->CpuCount; Index++) { > + if (MpHandOff->Info[Index].ApicId =3D=3D ApicId) { > + BspNumber =3D MpHandOff->ProcessorIndex + Index; > + } > } > } > =20 -=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 (#115763): https://edk2.groups.io/g/devel/message/115763 Mute This Topic: https://groups.io/mt/104472310/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-