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 F212F740032 for ; Wed, 21 Feb 2024 05:48:11 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=aXBRjhcsLbHDrdQIWETcwHcSfswvbU6+oP0GopqJBdg=; 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=1708494490; v=1; b=LMyAxl/2XrnnXSxqbX9Y5SxMtIH/ks64o6EZjYA3g0npQPsvXLsuQe2kdWY00ZL4BHwV9mC9 T8qcUSqwfNH6y7WAqYyiBy+d/nF96SzcdsSR9BcQlfJ168xq9ki8k6yxrCTxLjGWuXA+Y6oE8gP UELGcWzNd5bd8LQvpzLdC794= X-Received: by 127.0.0.2 with SMTP id yDVBYY7687511x3vAFIjDUf5; Tue, 20 Feb 2024 21:48:10 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by mx.groups.io with SMTP id smtpd.web11.6914.1708494489942208726 for ; Tue, 20 Feb 2024 21:48:10 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10990"; a="2508182" X-IronPort-AV: E=Sophos;i="6.06,174,1705392000"; d="scan'208";a="2508182" X-Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2024 21:47:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,174,1705392000"; d="scan'208";a="42502270" X-Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orviesa001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 20 Feb 2024 21:47:53 -0800 X-Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX602.amr.corp.intel.com (10.22.229.15) 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 21:47:52 -0800 X-Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx612.amr.corp.intel.com (10.22.229.25) 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 21:47:52 -0800 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (134.134.137.102) 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 21:47:51 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wff7+AVS2lJAuJWLjRfaD5iQO9T4wLQ1LXyCqbd8Dk7vlALHRl8IsOA1E3/gC6FU2jPa384xsKwavDNa3ziqF8kO4DlB5DD8lwJD4ztWYv+3EmTyHmfgM6JWnVwR14wXjkqpGhV3Tm/6eGvDnGfx48lUksfffkGjxpwY6mH/6+cD8QYUBfMJvSLzAYPAIh63K8zK1XoNYzNQASqdxUWtNDCguVbUOKwiH7kipOKLwIDyUt+AONNhhec/VrS47Z0tbDekEMpomU1lkhSbJtmzT/fq9SM1ZdDrxKw5vxAWyRdyD197GHXUk+0k/ooZzdGCp8jlK3tAUvuL9Mo5Wjd2Ow== 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=7hD3STFlyHZM4nqQmzHnTACi1EqBIwMRdFgTs22v0jU=; b=jL3vhW8xceLh6MqfqNIwA/rN55tTgBKdkqt4L1UDqNpzga9st9+SVdUzLPujNR87yIAsxMX++6MfgInIGykMejrvDUYaPksvz3LbitHdW7dENc7bOnj2+t3Yho6/Kex5tlypDKJKWEUvdxG/BtPqhlOW4beEEh0CRZOXShd1CNsj3U0dPlEy248CHxmFNqxfvr1pzpkc8mhBfZZfDICHItTE5vCaJ0vry0NbV4OOojrWlSddTaCNDDOGhxZPDqchrf6Dp+5Ph+t/JBiIVkd88fhIdmcpLInC04ChA/gyPjy3ZTG2KzPcP8aHTRU/3bRBkoCAai1okOoVWrR/aCMzfQ== 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 PH7PR11MB6554.namprd11.prod.outlook.com (2603:10b6:510:1a8::14) 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 05:47:49 +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 05:47:49 +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 3/5] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to SwitchApContext() Thread-Topic: [PATCH v2 3/5] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to SwitchApContext() Thread-Index: AQHaZCU8CPhErCyWVEyS/PEQFCw4ZrEUSm9Q Date: Wed, 21 Feb 2024 05:47:49 +0000 Message-ID: References: <20240220174939.1288689-1-kraxel@redhat.com> <20240220174939.1288689-4-kraxel@redhat.com> In-Reply-To: <20240220174939.1288689-4-kraxel@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|PH7PR11MB6554:EE_ x-ms-office365-filtering-correlation-id: 2161438d-1522-4d6d-4762-08dc32a0a308 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: JnxVglsedonx5yl43MBOjBVUh4+4gzhIOp+CfWcFg1w2ouSdfKr+FqdMiMXq4R3YjphHWCYyYRCyH44i8OerL0DP6ylGJG95npsuGqcGa+RWNcRPkS1eFPu3VwgFQ4TnwDnJ0UBYrQgJfdylBtsRi6cruGcv6y1tNQQoLRNS019XGYabqnNHfVDO4senJi+exAf3smPgxA/vVwr6wxXFLbQEUWHNh0RcyBCN+GZbCqEQG7SmltO7DZzh6EP3GmjkMZVpl+foz7mlEfwwAbAtay17v6qU9j+j8tud+eOdQcywzCuzBdKk6+vxrkIWxkfuhwBhxQMnXlPZNPpVzsCQjYCBOen+1ePD9hV2t7PX383jEO7Aa0QmlRit1oOlMznl8CDH6hsHnwdaGHUvp4SsQ8GCOUMR3YICPl2/Bv6t22SdqDHiiiwGg4C3PxjJ8fDDK9+5Kcq24BuyxNeMz3Xg3KPPPrbMyqYuA2bmeVcb3HxcwEgz1+5uVN0Yo27ZIdI1Fgy1vgEZlb/b1L/oOQzZGaegmLKddBoJHl8Q+wo0L5H2Kn6S/NXIkWF8n/nd/NSm645FPu8J4bDEKakkb499BzTl7Fp9j0jCm+c31dj66lVrfwJctKrqW2hsH6qzkM4x x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?V9fA7iPqXcrdpqVdyeJnKjYbNloQmCwMhy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VS0ilZIVinj3+my0GB42k/e4hzlIInc3BsoTdMYzQVRwm+etfQeKbdw1a?= =?us-ascii?Q?wYcm2k9OCteN4k1dhlv3Bo8/deWVsWNwnEoOv6uNLY45QcTX4t3VBEw3+qMW?= =?us-ascii?Q?1vcJgXSFmnuwzRk6DCPCuwIGw879Bwwx6HchjJ5CCfVOfBDglHynB8oYXK7/?= =?us-ascii?Q?OthOiWJab9ZbpjycrQx/NnZQiFswQexjNgwgqwT0LcsmfTNwmPbN404BdInx?= =?us-ascii?Q?MGBRfyu1TPy4mURaVRBd91x8UxBcq00oqaUw8vPjTkBwpFTN/lX3r4KG5Qw/?= =?us-ascii?Q?8D/S7jNmfhumD3lSD5DUXTquPwsU/whMgbhuA1XMWZkSCn38UkifhOeBQhwe?= =?us-ascii?Q?1QmlUgAYHcrG+z/TsG/Kt0zzepsxDqrp/ScaIa24wmymIBeKdR+MqELgWblk?= =?us-ascii?Q?J6I2aknhXvJG10R6Xfqa249NnBxIIu6JFAekea3+n7eRxnPLq+hSyWzOXlm/?= =?us-ascii?Q?7gofvkDXqjhWa8s+B83v3ALSrS9wkA1dMOZsrlEdO1ntRF2V0WjGHph6uKqz?= =?us-ascii?Q?KZFikURkQi3kL5N17obQD5Uvs9ECjUlULK0/YXFy8Wj9JdUybRQsvRO6ohlA?= =?us-ascii?Q?3MXiMJ6VeLjKlsRTvwTvSZ68phMomdY50TpEBhIv+y3NtaAzZHdhR3AfhEhj?= =?us-ascii?Q?6Ly2HZiXhueGujf8y6U=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: 2161438d-1522-4d6d-4762-08dc32a0a308 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Feb 2024 05:47:49.0573 (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: s7CesGaeuTtHhmlNjGntaZyQligpl4njlWQZgkueA8fyikrqHMQxTy9gl/YmIBS34wHdgp9Pdiu5+O3XN/kkIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6554 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: 7usBWPx6aNP095gsvdRYBZbex7686176AA= 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="LMyAxl/2"; 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 3/5] UefiCpuPkg/MpInitLib: Add support for multiple > HOBs to SwitchApContext() >=20 > Rename the MpHandOff parameter to FirstMpHandOff. Add loops so the > function inspects all HOBs present in the system. >=20 > Signed-off-by: Gerd Hoffmann > --- > UefiCpuPkg/Library/MpInitLib/MpLib.h | 2 +- > UefiCpuPkg/Library/MpInitLib/MpLib.c | 35 ++++++++++++++++++---------- > 2 files changed, 24 insertions(+), 13 deletions(-) >=20 > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.h > b/UefiCpuPkg/Library/MpInitLib/MpLib.h > index bc2a0232291d..b5214b904b41 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.h > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h > @@ -482,7 +482,7 @@ GetWakeupBuffer ( > **/ > VOID > SwitchApContext ( > - IN MP_HAND_OFF *MpHandOff > + IN CONST MP_HAND_OFF *FirstMpHandOff > ); >=20 > /** > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c > b/UefiCpuPkg/Library/MpInitLib/MpLib.c > index 8f198ff6d817..c13de34e5769 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c > @@ -1938,31 +1938,42 @@ GetBspNumber ( > This procedure allows the AP to switch to another section of > memory and continue its loop there. >=20 > - @param[in] MpHandOff Pointer to MP hand-off data structure. > + @param[in] FirstMpHandOff Pointer to first MP hand-off HOB. > **/ > VOID > SwitchApContext ( > - IN MP_HAND_OFF *MpHandOff > + IN CONST MP_HAND_OFF *FirstMpHandOff > ) > { > - UINTN Index; > - UINT32 BspNumber; > + UINTN Index; > + UINT32 BspNumber; > + CONST MP_HAND_OFF *MpHandOff; >=20 > - BspNumber =3D GetBspNumber (MpHandOff); > + BspNumber =3D GetBspNumber (FirstMpHandOff); >=20 > - for (Index =3D 0; Index < MpHandOff->CpuCount; Index++) { > - if (Index !=3D BspNumber) { > - *(UINTN > *)(UINTN)MpHandOff->Info[Index].StartupProcedureAddress =3D > (UINTN)SwitchContextPerAp; > - *(UINT32 *)(UINTN)MpHandOff->Info[Index].StartupSignalAddress > =3D MpHandOff->StartupSignalValue; > + for (MpHandOff =3D FirstMpHandOff; > + MpHandOff !=3D NULL; > + MpHandOff =3D GetNextMpHandOffHob (MpHandOff)) > + { > + for (Index =3D 0; Index < MpHandOff->CpuCount; Index++) { > + if (MpHandOff->ProcessorIndex + Index !=3D BspNumber) { > + *(UINTN > *)(UINTN)MpHandOff->Info[Index].StartupProcedureAddress =3D > (UINTN)SwitchContextPerAp; > + *(UINT32 > *)(UINTN)MpHandOff->Info[Index].StartupSignalAddress =3D > MpHandOff->StartupSignalValue; > + } > } > } >=20 > // > // Wait all APs waken up if this is not the 1st broadcast of SIPI > // > - for (Index =3D 0; Index < MpHandOff->CpuCount; Index++) { > - if (Index !=3D BspNumber) { > - WaitApWakeup ((UINT32 > *)(UINTN)(MpHandOff->Info[Index].StartupSignalAddress)); > + for (MpHandOff =3D FirstMpHandOff; > + MpHandOff !=3D NULL; > + MpHandOff =3D GetNextMpHandOffHob (MpHandOff)) > + { > + for (Index =3D 0; Index < MpHandOff->CpuCount; Index++) { > + if (MpHandOff->ProcessorIndex + Index !=3D BspNumber) { > + WaitApWakeup ((UINT32 > *)(UINTN)(MpHandOff->Info[Index].StartupSignalAddress)); > + } > } > } > } > -- > 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 (#115713): https://edk2.groups.io/g/devel/message/115713 Mute This Topic: https://groups.io/mt/104472306/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-