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 80919D81112 for ; Mon, 19 Feb 2024 02:41:25 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=XFajKhBQBkzLcMWFmfGE4uWryT86lZbxR3zasg9YdOM=; 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=1708310484; v=1; b=UTPHZtdHJUk9q3Xyz7XJLxEVka2hPHNAv5KsRbzZVrWewlhR/MKtPwOrABYljD5aVnITOtG3 agQtoSUAm42r4KSS+l0iQecajKleNex3yUmRRNdYUBxLWSOfimcrgUVZJtGW4KqyqAJOyl5CMJA /OWZeY2POOfXO1pSK9NTLfG4= X-Received: by 127.0.0.2 with SMTP id pFqYYY7687511xfdOWZdFsLI; Sun, 18 Feb 2024 18:41:24 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by mx.groups.io with SMTP id smtpd.web11.33416.1708310483467348445 for ; Sun, 18 Feb 2024 18:41:23 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10988"; a="6177646" X-IronPort-AV: E=Sophos;i="6.06,170,1705392000"; d="scan'208";a="6177646" X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2024 18:41:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10988"; a="912785081" X-IronPort-AV: E=Sophos;i="6.06,170,1705392000"; d="scan'208";a="912785081" X-Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga002.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 18 Feb 2024 18:41:22 -0800 X-Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 18 Feb 2024 18:41:22 -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; Sun, 18 Feb 2024 18:41:21 -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; Sun, 18 Feb 2024 18:41:21 -0800 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.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; Sun, 18 Feb 2024 18:41:21 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gtY8tQ1yr6IZJkzB20FazJtmTNpxGkVHddBVMA2oyzYC+WzY9Im4Kt4e4tlGqKDgCOcG0Vnjd74mMi2xd8DmNm7GXRkoSdls1lnrevI1k6EuFy0EUU1XQeSYJ9giOxcfi9Hz9/BDQ2GTsL4ksbp46jj8gp7tq/7IeMNjlTwmen8vA7dozVRToQr509lAXtecvoIakVQ5SM5q0yY4A5kpjqR4QyEdErtdYWV77wkONEyuREvV9ZVSQ5gySVx6BhqLTZPchdjlMwuTucw2W/NIBfnu6UrDS1IZTmY/lQ38nBhHxV0Nn+QPpZUhBo7LuZcZ27hNwqnuLVOU/yHPmH87fg== 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=wV4dTgn/SsMvpoorSVkzw2W+W2vSK+7cK60J/ho41vU=; b=O7J1UaLlL0QcQNJplatj1Th/ZLqTjHKK9qM1tF6Dx2QH3qdsB/PFCer3SB4CBPgYRU7iCWQupsXx9E4TdWjvU5Y4yP/C3UCGRnDEj+9xnbfn7ZTwO7segn6hM57riMN0dBUM0GBEblGZJcJTRk2USmfylytQA0II5dLC0yhx89Ak4i3uOC/HdvDLsu+XTFiJoMMoO/MVikgTCqJlkGoT33b3i9+Kx7F1wx+Rw1iXi5dP/nZ1Z8wAX3I/wNZ3tYk3EHM7Nqj4LzKI3iaaMSy/35Nxk77D1lzkRuTE02Y/LF9fJ5o3YbHBhXj2AMbsPHAufrGoDi1vCDeLmSUSAqgiUQ== 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 LV8PR11MB8464.namprd11.prod.outlook.com (2603:10b6:408:1e7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.37; Mon, 19 Feb 2024 02:41:19 +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; Mon, 19 Feb 2024 02:41:16 +0000 From: "Ni, Ray" To: Gerd Hoffmann , "devel@edk2.groups.io" CC: Oliver Steffen , Laszlo Ersek , "Kumar, Rahul R" Subject: Re: [edk2-devel] [PATCH 2/5] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetBspNumber() Thread-Topic: [PATCH 2/5] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetBspNumber() Thread-Index: AQHaX/HW62EogiGGMEy0isNKDNYrt7EQ+WJw Date: Mon, 19 Feb 2024 02:41:16 +0000 Message-ID: References: <20240215093149.251319-1-kraxel@redhat.com> <20240215093149.251319-3-kraxel@redhat.com> In-Reply-To: <20240215093149.251319-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_|LV8PR11MB8464:EE_ x-ms-office365-filtering-correlation-id: 08178a57-52c3-4943-1fd4-08dc30f43ee1 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: 1P2vKL1h2gQAt3oNuLXbhBBq8E3iX7kDyEbnDLuDh9II+inHn5J2UDzgHazCnvfx1+bLKIropqOnTI8Mtk2/HvqI1jzUO16gTbnF1HPUYQkxjB1DWYy6Nv8kqz173OvxjEEhTki++qMMUO9+DFfuLBOv/bWo1XwEO/BtUv8INB8nFcZBXHoGAyoqDbcoCXW6Utf9XEyqGOvXTu+tj4P4zbYGQkLTrO7j8RCMiboJvGItSdxuA1/C8DXZvw4tyr+8kGlc+QK8poYGdV0MpqVBIKlvv9CAwTLiCTBY190fdb8nonl0NOEBjKEo+oNkTgHR9BwRMI8OWJ46Zm6nUwyaji3Orv7sySDtSRwUNnYnsyrYUL9OWvlTTEA3rj7D3N9WwvmxWtJ4VEC6DPmMwd85vGC5LtqqO45n9VQpobLD7qwMa7ycJ4SPFAvWSv1Q++J7Gl0epNQ+0PbIGkUsS+ODjAthyDrJMVCPLc69XsRDCAmWeZEFSHBQem9pQk8SpZQijxCA3UA8OwJ4TuJkNfPPc09DbHnPcPvohllzXRHZaKhOXzP9AxZvmGnk9wJ3yyXbCISmCLDt34K9hVIXtqAiUBWuYggzTRi3niJB3V4bd07s+x3Ji+HOYgOSz9Wzcy8i x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?PNUkoldRIkh14s/g1sZtDU5EHEcIRTashSEKAmKnHBydNwIzoJFG90CWFjZ3?= =?us-ascii?Q?LoYoLu4wxqQ2xYwcshM+WCkkRiOIJQmizDHUeJJCHz0chR/wtkJv2ubzaZF0?= =?us-ascii?Q?jt6x76aIgt3fzMFw54gksmpWmiV3sRqgtpbjBxXcO971IPRH6oKVk9IMaVTi?= =?us-ascii?Q?sYd92e0mgZS4jxbNDW209kO7lA8unssYsUVZgD0wmM8DU+HSgo76KscunXIZ?= =?us-ascii?Q?74S8pokxHNygtA7fLd79lJgWGeb6F5ZqAJyprIQ+B3mIOoN6a4izXbpp8Lcr?= =?us-ascii?Q?XiNg9KXRlbf3l6hhDVttW6rmjGbgO0uiIXoBInGhx7DLO9D6jwBCLz2PYBpa?= =?us-ascii?Q?hgccunYnC/fYujuQfJRhL+pBwNqAjAGHTmyza5JOFujKUWlTpdCarT+hgZEv?= =?us-ascii?Q?P05myirNRILQnyGXWG1br7KCdBBTl6sYjDV2s6HSW8TCUSfBJ5RN1R7tS/ZS?= =?us-ascii?Q?j5d/lrzwZs1z05mFOTUr5GtOVzql1FgZ4CRe6F59NLqkBF0Y1iChmG5GEeGc?= =?us-ascii?Q?k+tbuzPWp0//Yj7GMCUg3EHyFeSDCWhNqDqPVRpo0RD9yMWVtHQ7VVEZJUUe?= =?us-ascii?Q?wMlUReePtqsRzzsdeWTe1T4+01hnb93oKnUdsEJ/QkXOgG3kOCFuUGtVIBFu?= =?us-ascii?Q?Io8szRb6QMrnx9S4Gx+4YcXTt7KxdO6vyh2d6AKOTMCOOJyUe5WboWpGlJ7E?= =?us-ascii?Q?8xBvFuwpX8CJbP4GhJFZwgsASfdDnNbBmDjc1GYQvDalOp72aXPx2q5EUAN4?= =?us-ascii?Q?7wEPov4OqcjXB9FCFxLfQG51crF0A4YWPZenneXon9vKqHSLFJlf+RoqhT9W?= =?us-ascii?Q?yZDNUW6Z657Q/c3lg/acAR7uUKpavHi7XgQSQnFNEEd6IZpi12n1Uzimc8y+?= =?us-ascii?Q?143qNfacd4SQkBUyInaunWE41zsw24ucjinL1KNI16mzVldGO9BSCFSrCdKR?= =?us-ascii?Q?BCEHaDrzHflikMfACdZLZKrTh+WVudrRt51WWqZpDOiX0mOwjm8dO6OSKEeD?= =?us-ascii?Q?0Lqb+pYDR4FhzhbjtXPsFafMHAyEI/Nd4Z3g3a1ki+Bj0We2qgllDiBdusrY?= =?us-ascii?Q?8jwPB6ziMCkWg15TTd/4eI/fr+NQTjGBtEv6Znu5S9mX6TZqeNL7tvDej9Rt?= =?us-ascii?Q?CFEi+Uxyo+5+W85DlDRpJCcBmUPk/nv//FrOSQCQesgjxp+8N1SRUOuYga7f?= =?us-ascii?Q?RbgaYRLbe9hLxtuGTwHbMgy+TAA8mvzwE56zwClIfQW6l4hWv4qoFPp5A/AX?= =?us-ascii?Q?tYvuUwd1sS7L+bGMABmS+Q05Ks7wGHy59hVXXMoU6rlyn2nag5hF7GeRK1bl?= =?us-ascii?Q?rWSWM0l9APbt8OVYOTod7MR2j8OzHpf5s22xhCsgT3x1dA944G1fZcd/H/I+?= =?us-ascii?Q?APG3GogDK5e9wowKB8tK06LNNvxpr8/cdckBfRvwQTOqX4cbQ5/YP352QeR7?= =?us-ascii?Q?yUsRYmtwsAa4uO5eO6u5ANaFb9/s7iW9p8JWNIGPI7Fc55AmdQUQd75W7hP0?= =?us-ascii?Q?t35Tp0ZSQvvZctr3+J11mvHS8RTUa4ifmjtLxlCJbaXFDfpjc5k7Rto8fqDj?= =?us-ascii?Q?2EOah6qGj374WNNP4Uo=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: 08178a57-52c3-4943-1fd4-08dc30f43ee1 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Feb 2024 02:41:16.4759 (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: UMeNuhCrSn9A76Gn+4QuPTbQv9auUgpG5NTBS9l20dAgrs4KroqDQvUy3aVCNFLdGFXirsqonDyDMIk8GmL+7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR11MB8464 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: dXNytadyb42my6kYLkBxDcyrx7686176AA= 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=UTPHZtdH; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Since MpHandOff HOBs are created by the PEI instance of MpInitLib, I am ok = that the consumer (DXE instance) assumes the HOB instances are created in the order of ProcessorIndex. Please update the patch accordingly with the change of GetMpHandOffHob() I = commented to patch #1. Thanks, Ray > -----Original Message----- > From: Gerd Hoffmann > Sent: Thursday, February 15, 2024 5:32 PM > To: devel@edk2.groups.io > Cc: Oliver Steffen ; Ni, Ray ; Las= zlo > Ersek ; Kumar, Rahul R ; > Gerd Hoffmann > Subject: [PATCH 2/5] UefiCpuPkg/MpInitLib: Add support for multiple HOBs = to > GetBspNumber() >=20 > Remove the MpHandOff parameter. This is not useful in case multiple > HOBs are present in the system. The function will use GetMpHandOffHob() > to loop over all HOBs instead. >=20 > Signed-off-by: Gerd Hoffmann > --- > UefiCpuPkg/Library/MpInitLib/MpLib.c | 26 ++++++++++++++++---------- > 1 file changed, 16 insertions(+), 10 deletions(-) >=20 > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c > b/UefiCpuPkg/Library/MpInitLib/MpLib.c > index e0a2366073a7..8e6cf50ed171 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c > @@ -1894,26 +1894,32 @@ CheckAllAPs ( > /** > This function Get BspNumber. >=20 > - @param[in] MpHandOff Pointer to MpHandOff > @return BspNumber > **/ > UINT32 > GetBspNumber ( > - IN CONST MP_HAND_OFF *MpHandOff > + VOID > ) > { > - UINT32 ApicId; > - UINT32 BspNumber; > - UINT32 Index; > + UINT32 ApicId; > + UINT32 BspNumber; > + UINT32 Index; > + 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 GetMpHandOffHob (0); > + MpHandOff !=3D NULL; > + MpHandOff =3D GetMpHandOffHob (MpHandOff->ProcessorIndex + > MpHandOff->CpuCount)) > + { > + for (Index =3D 0; Index < MpHandOff->CpuCount; Index++) { > + if (MpHandOff->Info[Index].ApicId =3D=3D ApicId) { > + BspNumber =3D MpHandOff->ProcessorIndex + Index; > + } > } > } >=20 > @@ -1941,7 +1947,7 @@ SwitchApContext ( > UINTN Index; > UINT32 BspNumber; >=20 > - BspNumber =3D GetBspNumber (MpHandOff); > + BspNumber =3D GetBspNumber (); >=20 > for (Index =3D 0; Index < MpHandOff->CpuCount; Index++) { > if (Index !=3D BspNumber) { > @@ -2191,7 +2197,7 @@ MpInitLibInitialize ( > } >=20 > CpuMpData->CpuCount =3D MpHandOff->CpuCount; > - CpuMpData->BspNumber =3D GetBspNumber (MpHandOff); > + CpuMpData->BspNumber =3D GetBspNumber (); > CpuInfoInHob =3D (CPU_INFO_IN_HOB > *)(UINTN)CpuMpData->CpuInfoInHob; > for (Index =3D 0; Index < CpuMpData->CpuCount; Index++) { > InitializeSpinLock (&CpuMpData->CpuData[Index].ApLock); > -- > 2.43.1 -=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 (#115577): https://edk2.groups.io/g/devel/message/115577 Mute This Topic: https://groups.io/mt/104369845/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-