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 25B14740032 for ; Wed, 21 Feb 2024 03:36:37 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=nqS4w3j1tWqDGlJXAQZ72vl4qNSVodhAiVjHMDBZcMw=; 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=1708486596; v=1; b=O5i896Bk60ffhlr5kS2K/PHEjk3x4YtD6LLWB7YBFIGi4y1/C8ti8MiR+DYT/hsRDJ3nSzzZ w3bofWdie96LSaZpfNZmtk+u2J7ErRz6wQdwcnLoS/eTvDjL3qWlp/4GmfrSlosRT6qAMO6F60u fJIvC8awxxZ5qqTwS1WgDa6k= X-Received: by 127.0.0.2 with SMTP id rCcAYY7687511xxBGcizJcpk; Tue, 20 Feb 2024 19:36:36 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by mx.groups.io with SMTP id smtpd.web11.5458.1708486596011932784 for ; Tue, 20 Feb 2024 19:36:36 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10990"; a="2491138" X-IronPort-AV: E=Sophos;i="6.06,174,1705392000"; d="scan'208";a="2491138" X-Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2024 19:36:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,174,1705392000"; d="scan'208";a="28152974" X-Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmviesa002.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 20 Feb 2024 19:36:36 -0800 X-Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx602.amr.corp.intel.com (10.18.126.82) 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:35 -0800 X-Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) 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:34 -0800 X-Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) 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:34 -0800 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) by edgegateway.intel.com (192.55.55.68) 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:34 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZJXJxC2oh8MyiU+r6bgv1OM+EvzgjF9RqMIzaAsocgyB309Co6HcWH+JRq2sIbTh8tv9LVWeewTX6xO/mHibA4ZFY1kHUMtw1/kDyOOiQNPGRHlzeQJeW69alMllDXHktC5ExHDpYJ+EFW3arykvqG8HqmnPwTlIBAKCXmPwdIj7wb4Sd8ekg/4LQI46IixrxEcWfKZ26ruu6qLFVjr1syKxLxEt0xVdt6ivTFhhP3AWDelbzClZVrUKGyO/DhiNFEC9/oHb3bGxjFlmk4dK1tqybDRIC6MKY57K6ntLstjEDaJ4W6c2Wn0vG8tkDyRrxVwpbYs+Z0Y+RFirViygeQ== 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=nrkntpm5lU2hKTH6jjsrcvPjNUakhCmqbXF/kNVZquAN+IqzsbSNMD/zuSv1uoA8JS15PZmGYoOLRga3huaHgo/wcYTSXYaEg0beCYM6hZGPtTd3ummOnM0CbDuRkeT9gMemkvtuSRAVxVrLcnp1pL7xTcie+i7VODh7Rhqob7wlUNLQY8inPjcDlPaZjqPlgU+PsqJxG/PDnLgL7gCOP+QgQ32IP0+25A67WzRg5AUIbSi5OgfCv3EAnhpiJcOXEylZQdvbLZF0GfAXN+peloV/6g4NF8DJMwzAsrQikyBN9pob6aOEKLwHxSC73USwcb6ty218WSb+ouXqrnKk1A== 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 CY8PR11MB6867.namprd11.prod.outlook.com (2603:10b6:930:5d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.21; Wed, 21 Feb 2024 03:36:26 +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:25 +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: AQHaZCU7bvxQaCjKPk2VGrOmZ9nnSbEUJcMg Date: Wed, 21 Feb 2024 03:36:25 +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_|CY8PR11MB6867:EE_ x-ms-office365-filtering-correlation-id: 2a25b383-3248-46a6-c8d5-08dc328e482e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: vKs4ZNvSiZXQHirwz5vT/641Z9X67XoR49+GlrwXMpI9HQXHP/vHS91jQZtcnBjFXXqXFFup7MpWfh34xmHmCcz02Sq2kQR7ENr5fQGQYZu/6JOI+cQHWFEi2mgJSDMoF/4o653eROcxcCjkAIPbVD07sHSwssczS7ORLuvhyVhJ6/yrFBkXRiUwl4oKDzijC++R1jKYtauRIQQgN+12miaR0gA/s5gIgrwqeUtmXdPbAsz5QhdigZBHHculzXhKsdrcXbjaqPtoQ5P7lVpBdyd+3g34I7oJJX5iwKN2bPBZO1ahAeOQThaMVHJBma+clwgmQbzv7rDSF87WwPK2oH4lNPuI2Ec8AIZyybmeQmAk5L5PdTK7QwW8He9LBVnJH2Iem7UgMtMDlEe2tr2UB1siF/6gHj4xza4AAF3Xtyx3YANw/75fpwyiKiHNdJfnEjH070reY5uY7wfIrRpIQX3gb3PQzqEk/1fn0M/l96KVW8A67fhO/sgE2deHZtGpU7F7EE8eThN2GH9m4/ECeP1tRg2P+LSp9dL8IX1P49/KWnPPjAiL/NrMMHiJb1WgYuNSHtkmFdEbb2GJonljlyFFDw2VAkISWx0+3GD8LvZiWs9gUMR8R4hmzr+zEiQM x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?M0gBdWR5RKceJmixM/+sCdPY87OKkx3WN44bOIj6YbY2ixakFwlMHokk48d2?= =?us-ascii?Q?SdB6d5olZFWj+DZaMj4lZGhP6IOiBiegWPvPsVkze6CxQ6ekLB8eEzCIreAo?= =?us-ascii?Q?Oc9ey+huqGtuTqIiu4w/MMUkW6ssPNZNO8MD6lt5AclfHEgbJp907sTxq2JH?= =?us-ascii?Q?wZ5dWs2uU69zBEeO9LsmoiUinYqtFZIcLxsyC4yW1zHmaQvjiqT+lp+Tg0To?= =?us-ascii?Q?WI1ekF/kWafeyvOJBajMihcAr3hY4N4TBykONspjS2JeTclNYnQMQpGywts2?= =?us-ascii?Q?6lJVqMbYHYWmfxi8P/U07J/zAMOIAEKN3EEuRv6pOB1I8PrphvIRe6WEmbNl?= =?us-ascii?Q?hjiEOSm9TSNxuBVMzTlJ/FXcHk4B86iFmDpgIPYgsyLGdzar7LxBGz6s3s/5?= =?us-ascii?Q?F6Aj/Y19pEwqm59z343PVyN3s6ddKiWJWVa7TNPGnQCxtr4ITsC2HRIx39t6?= =?us-ascii?Q?uCfXQ9q7chDV8RPXroJNNhGjpzP7Yglk2DiouWSiKMrdSFmAQH8yJLU7GF3t?= =?us-ascii?Q?4eg4BlOAd0EpsryhTNd0u+Id6d5e5lQ+Zci0nRqpmu3hhaqWDz5ZbyQExSeU?= =?us-ascii?Q?vc8lN1M6t8uIWR8NMVib3MSvlmdY4cB+ZbL/EwYgRMbMquSRK5jty0vXozIh?= =?us-ascii?Q?meaYO3slFAND6XfGy8Zjgi+JyH0VLsA2p/GbroW0aBMOwCisFKzRPoSshVih?= =?us-ascii?Q?US6Z7XlOlEHZh77qxKLKI5gxd+SvY9YFSKMyjISzRw10U2cJKVKlU6kLcrtg?= =?us-ascii?Q?nkUTqchVGnMBR0DMYHJ/9K/iZxlfTWlUyJJ58kdv2rO3eFJnFdiPBJmZlljc?= =?us-ascii?Q?v3S4WRHbDU7NlfM/GpEPhAZiYDiEmHVU3+QuQ5S9HpJkv9/E80JPy3UIqlZx?= =?us-ascii?Q?U+D5a392kq/O4I1dAwIeMa+Xtx9kxQ3MduNa5CGlUK91FzSX8XB0W0nBrY7d?= =?us-ascii?Q?1Us5YdTzr0TQGAmtbLfVikyGQW/1oMfacd4avMZuAJJfGpy1Xd8PRwaQXEuk?= =?us-ascii?Q?zJaAbtOChG3h5fXw2AIXSmAqfwebR90oI0jVQCfZnnKk+DJ1cuZFvoZr6nHS?= =?us-ascii?Q?mgPMdxE7F3ceKWGzbr4611+Bf2U+uv4qPTiX8CfLQz/uk4zJC+eGNBT1iMak?= =?us-ascii?Q?Ouv/Jdk6YM+jDcL3lERJ833+ihWBBudtZCRWbwouPnDMRw8mfIpLFU/5MCJv?= =?us-ascii?Q?n0xl3y90kKRza6JCReLF/vVpu1X1aldSq0xPgTbdeat3pKeMp22jLlt6ZZK0?= =?us-ascii?Q?oXX1vjxlQ8q+C4frwNUc+HY1E76GXTLrCj3UPlzy1lK+7051S14prAd1r8Jn?= =?us-ascii?Q?9xtpoHLaqUDLnaTK9jDveWOhQZfj/tjMZN3xKsFC4GhRLgqOvuV7Y8t1tRa3?= =?us-ascii?Q?TC5/NlpB1q0wd3ZmxMg4cRsmE5ZJsBSWmDwW/BsNlVDQqZLzEiiMrN0VmI2s?= =?us-ascii?Q?+p4rTedD2Mi+C6N1Ivwb8dMeEosj4NEDdP38xcrRfwpg22FqEJt/SDohkwOY?= =?us-ascii?Q?F95poMvrybXy7y+TD3uQ8hGg/GrFjqtR6R4p033OxXwnybE5v2OOLJ7F68TT?= =?us-ascii?Q?Q9l4bJPPicjpTupTbXk=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: 2a25b383-3248-46a6-c8d5-08dc328e482e X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Feb 2024 03:36:25.7080 (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: 9/E/Lfm0uw+AfCukLYpQvls3WiULyXNS296TSobtzwyBBIQ/BV2td4WEa9YUWOxQoEhRaexiFlU6R0G3bob2yA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB6867 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: TwoIkU0RHWTxpg6Hn1RVGsjLx7686176AA= 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=O5i896Bk; 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; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") 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 (#115704): https://edk2.groups.io/g/devel/message/115704 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-