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 45186941018 for ; Wed, 21 Feb 2024 03:36:46 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=qJrJmtRz7QTio51ZHF4lt38N8yI+flekz6lAkNe+g80=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version: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=1708486604; v=1; b=mVXRqNJHnsk4HO2efFcwag51EN7wsukWHNNLwyFDFgKNWdsYtM81Vv31hHLHi3ec4Av1lQhQ McBsr5V1o7mOipkKRxJrzmj+RJe+KM84o+e68z6xi4In+20G3kawQ4OBMv7JE5ngQDYF1HUvQh7 itvWUAifKkAcEVgYNiVWQSno= X-Received: by 127.0.0.2 with SMTP id uX1uYY7687511xL8hO5xpryH; Tue, 20 Feb 2024 19:36:44 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by mx.groups.io with SMTP id smtpd.web11.5460.1708486604209196532 for ; Tue, 20 Feb 2024 19:36:44 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10990"; a="2780026" X-IronPort-AV: E=Sophos;i="6.06,174,1705392000"; d="scan'208";a="2780026" X-Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2024 19:36:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,174,1705392000"; d="scan'208";a="4955234" X-Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmviesa009.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 20 Feb 2024 19:36:43 -0800 X-Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 20 Feb 2024 19:36:42 -0800 X-Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Tue, 20 Feb 2024 19:36:42 -0800 X-Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.41) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 20 Feb 2024 19:36:20 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PJEOUpymi45rA2DNbjPOx/9jGQH7AVMVsqAaqdmgfD+XpccBjFP11JIaL5XHwXQZqdOozduMbGKUU4YuHXJbKi7rLHvXB3/DuE1zYH2J2QFNOWkdlR4yahY+bbHNcq91YITMk14oVBJRFl7Z6W1AI85EGZ2QzZsCoJTgqGSJTJ3ky6sq5+LN6a2sqPjsiUgvRPKAL0XO3Z1QhxIoinwYJntWy3mShnm6hoBHtydrDW6bR9+eZxc7uDcqmwAovklcGwgOkZWkQ76SsmF6xYhLTJa8+7LFpX2Ph/oV0H7UIj+oce+0NWYZMyygPpPZAc92DNs7VXEWF1EGRlA0mG/Bsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gXAJa+Wp5NwNLr/gb3csAtLg/FE37kNQVJtfdZk5qfk=; b=XE1v/YVRDeNjy5s62KDHMDFRHQ1XqUsgupZALSo+wroCXCmY5S875C5hwQiZqramrTr/Hg2iiJQknRXFMb+e3PcEYFtd0AG7UR6nXN/s3rAyDzSycnKZlP2khZdy8ACcFNOlRsza/oioJAnvxaIIOshMGn18blmA9AZYoPbgkdrNzR9at4T+N9GWOFfD2P7cNtojPFYlZN/RrWhcCj6Bu7ncUFmuseH4eSGAgDA3HRV2qacYDbZhLWjkfdjtwqnK2QodQJ1+nuntYav2itaOjcESxmw2d2zQgndxSBNqNQDfMPZRUim+eXCj6lohnc4zhqQfeFtMjso6oSoOY54Ebg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by CY8PR11MB6937.namprd11.prod.outlook.com (2603:10b6:930:5b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.38; Wed, 21 Feb 2024 03:36:18 +0000 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::8985:d1bc:9df6:61cf]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::8985:d1bc:9df6:61cf%7]) with mapi id 15.20.7292.036; Wed, 21 Feb 2024 03:36:18 +0000 From: "Ni, Ray" To: Gerd Hoffmann , "devel@edk2.groups.io" CC: Oliver Steffen , Laszlo Ersek , "Kumar, Rahul R" Subject: Re: [edk2-devel] [PATCH v2 2/5] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetBspNumber() Thread-Topic: [PATCH v2 2/5] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetBspNumber() Thread-Index: AQHaZCU7bvxQaCjKPk2VGrOmZ9nnSbEUJa/g Date: Wed, 21 Feb 2024 03:36:18 +0000 Message-ID: References: <20240220174939.1288689-1-kraxel@redhat.com> <20240220174939.1288689-3-kraxel@redhat.com> In-Reply-To: <20240220174939.1288689-3-kraxel@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|CY8PR11MB6937:EE_ x-ms-office365-filtering-correlation-id: 154e0932-51dc-4c3f-b91b-08dc328e43ac x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: REnMfYAxn/QI3o2sviacJSCJT0Qpog+SX+bLp2FWcYnqXXeGhWU1ZGAQcx6sbGH8cGxYi/KQ5/RsLWyLTEVj3A8+NamqV9BQFFqVoGYgkz5ZwfFTt3mqW19TA3TyKLaFskyZ6NQ+lWAVyF4fUdVyCRlZYi/paVIP3bPkXZN6wiikcOqGqXtA0/BJEotRcldYP8F7r9mIi9AJMgUBZ9munS4iY7r8TA9cDgD0hQyCEo9Bol4leyQITUyVrbwyvfcxJou7N40jCg3I+6I1TBaH5Kjo3CGA3r9g4bvCJhPuhPBu9HVFWlR9Gv4CzR+HUDsaNn9iJTkEdM+DY2HwpuRsw9835/DR3hSZqU5WQl0maH5K7ZRiwP7ZxI6q3Y8ILCtfUw7rGtMpqhCvXFuHBBjJXXDjh9UsdZ/xAXGWpXyg7igXNNGnN9tDYy2OKV8DaQ6b9FOO5gEzA547NklqOiks0+yWnbL4DN07ybSECPbRFaSbqHn/XHwDize7QNCgQ9Sxzmmhzba54G+9y2jd0dvd3Ez3gQ1c9R5LXxN4zUVSQIEJ5Nopcp7Yh6BxP8EprkaU0PaaQF59nE2pN1VxHgRe9NAhZyQ2O0z5/RRR1denSF5wTOPtakdYRCHt2LvifRqB x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Lus71285Idvz+paB0im+mdreYDEU9dSRbIh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SnTIlDRY9fQI2fVgu5wG/VL1U78aGQJY+rKOTig1M83DjSSW7JL?= =?us-ascii?Q?y0urBrALyOXiJMDe+TgbFl5iCZR92uXRoNmm7AiJcT/JMnnBzZdS61QImWVB?= =?us-ascii?Q?RXpLWr+rEOYwd8VtrUJU/j47D6MU+65GxQn34EPCXS50Wq9CUwvebmf1QBRa?= =?us-ascii?Q?ZIl4aQYdTK4CbWM/OlFB9U+UoZTaDAtRxqfP1nqVhQLAhrvLui4SxpvPOekW?= =?us-ascii?Q?oZLgIch4oVMB6HatizjplcYjH5aPzOK445AEUO2b0WF8C3qsVKJ2Wq2Uo8u0?= =?us-ascii?Q?ElBrliTtOG9FI9fvhXIR9bl3jtG9QTBDO6ARTgJT46z22kwa/w6xG3wttbM/?= =?us-ascii?Q?CC+J+kvCWSkX+yyGkeVCE4OJKfRWM9BX/ld2qA2DPMVFRmoXJu5wC83t5YiQ?= =?us-ascii?Q?ykHCqvSc00dZ+jns1QrB/fAbeUflX141TUXU2Epy/BWUKp2hpkJG5VUZJqm4?= =?us-ascii?Q?lU6TVTCP9njHugvQFgDUS/q9kaJtcY2SMAjoLOm0CS2D1uprxGeY51iQRrGQ?= =?us-ascii?Q?PKXDitpXelxgjfUwdbSJb93YNtlrF3KuYZ0hBMW+g+MTItyNmtDzhMpXeOzI?= =?us-ascii?Q?/uuY2x+p5oqbvDkpA3HA+rnhnnC4XhF0r9epqpiVPgXGVBYyI6QTDINGy/eY?= =?us-ascii?Q?cEMu5tNqePTVdjXdMkE=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 154e0932-51dc-4c3f-b91b-08dc328e43ac X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Feb 2024 03:36:18.1291 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: UBONdqdFO6yrbXsn0SXsCciqn/j5F7Jxg9y+MjAgStVFwMHh6zmrM/Kae/aqSMyE4VBMGH1/OM9wl0cOCA9RKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB6937 X-OriginatorOrg: 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,ray.ni@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: nj9XMqx1TueIZA0t6Wp1xC1Ix7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" 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=mVXRqNJH; 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 Reviewed-by: Ray Ni Thanks, Ray > -----Original Message----- > From: Gerd Hoffmann > Sent: Wednesday, February 21, 2024 1:50 AM > To: devel@edk2.groups.io > Cc: Oliver Steffen ; Laszlo Ersek > ; Kumar, Rahul R ; Ni, Ray > ; Gerd Hoffmann > Subject: [PATCH v2 2/5] UefiCpuPkg/MpInitLib: Add support for multiple > HOBs to GetBspNumber() >=20 > 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/MpInitLib/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. > @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 > -- > 2.43.2 -=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 (#115705): https://edk2.groups.io/g/devel/message/115705 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-