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 04B36740032 for ; Mon, 19 Feb 2024 02:44:03 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=3jcnanhxT8srl5TD8UUoM/F+dm7S+n6VWLx/8ima6Lw=; 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=1708310642; v=1; b=QGyRdeod7cHaga7GPfiGfyWLW9qsIMuN/gNZyWwdUq0qdKdHtUVBstyzJfZPfrlUTaPjtB2B uOhhvoNy9XXyhJGYCpWkxK6oKKRCvBGBLPkJNAnp+sds+1Q2og8MmdLOBo1XwXxfAJKAvlNDew/ E4ZFEq0wdBtx8LCZ3ZoEsjj0= X-Received: by 127.0.0.2 with SMTP id qGW6YY7687511xcl3H5GdWFb; Sun, 18 Feb 2024 18:44:02 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by mx.groups.io with SMTP id smtpd.web11.33454.1708310642109670414 for ; Sun, 18 Feb 2024 18:44:02 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10988"; a="2239496" X-IronPort-AV: E=Sophos;i="6.06,170,1705392000"; d="scan'208";a="2239496" X-Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2024 18:44:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,170,1705392000"; d="scan'208";a="41861829" X-Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orviesa001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 18 Feb 2024 18:44:02 -0800 X-Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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; Sun, 18 Feb 2024 18:44:01 -0800 X-Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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:44:01 -0800 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) 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; Sun, 18 Feb 2024 18:44:01 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sk+q7CdP03V5zlTtpYwK+sCRbJJSKHCLPtWlmGkghIsKrSIi+//R1Be61JtocG++B4MHwG9kjt+JkrS8+eY7qTHMoQcO5zefmb4K1SmJ1AiGLclF/Stje2LzMo+hdoNy6DVNcqyxCVu5+a2E0lW0vv0kj5691d5OOOttiFlNKGtmZ/H2PYLO2upKnKw7tiOah+rVTqF/yWamAehLtdeBOMKfPEqq0FdlP4xYItbFPg2y3/9IsUo7tdrighcWkdpzx45+TQIWoG0dQVYSXc2S1zpkK2vcJQnXm5f4aMtxDF86cMEhPoqIVDf/0dkrGMp+xey6g67ITbHJEGndRkrM9w== 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=mrx+c6QS0MoltELyd72zaizkrf4lPS7am2G+GGa6e+c=; b=lYMNUyHGsgrWv5e8rRZoTouxhZ+gxydlcWeR3pGsV2hN5n5L1XKOdaQHN8070M2CJCt1OTYDMkI9HYaFOaPlSBER0ca+cE9hpvFWY8V9nmaOy3UX1G0VXYqt+YCsuNTksQAxrX7ZGzqc7C/0B8pjlZ1QSUOmC0/bnd4JBsURwXDF+rUm1HScTQTeY6Q0fSt7/D51V+rfNhRBIN4wjl+n/ACvxV6mz2yDEJmc8PTY7P8x96GGqZZwkmh9LMY58t+Ckou4aO9SJ2+2YhPwbqsGag9dlOhuvjn8huwTRJWt5A80UG/7krC1HGIM7V8NYZOt8kj3JAV5zvLgyHooxZ89ng== 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:43:59 +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:43:59 +0000 From: "Ni, Ray" To: Gerd Hoffmann , "devel@edk2.groups.io" CC: Oliver Steffen , Laszlo Ersek , "Kumar, Rahul R" Subject: Re: [edk2-devel] [PATCH 3/5] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to SwitchApContext() Thread-Topic: [PATCH 3/5] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to SwitchApContext() Thread-Index: AQHaX/HcMxNaJv7jbUGdNt6Sma2fOLEQ+nXA Date: Mon, 19 Feb 2024 02:43:59 +0000 Message-ID: References: <20240215093149.251319-1-kraxel@redhat.com> <20240215093149.251319-4-kraxel@redhat.com> In-Reply-To: <20240215093149.251319-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_|LV8PR11MB8464:EE_ x-ms-office365-filtering-correlation-id: aa309d2f-c450-4154-3b75-08dc30f49fd0 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: t4zDW7Ne+Ktb0FyVcFwACOL4LX7zKfKM6L7aERY+bHS/TVOGub5Y5Hrip4uxMJF2FCSEvYBviKh9ghvHw90PZZ9GLjPbcHdMOtv6RsY/u1fbd0+CJkWKAosbSV4Jj4gERRyhZYUBad8F7z2MJs+I8L9bA6dKvDnIbm6mz1oO6KH32gfGyuHR62lzK2egTxv/CdvTMhnouLlLoFtuJVfLxSJzyuNG/7EGuk005X7A2dq+LzPIqYalL7a11Cgmv5wqAInByUhhmEuT3l5KJGfQugT/av2LH1do+m4PpzR+OfEw9Q9K0OMbM8AK8CyuZrKOVOogsH0i5a3E6M8RQiitHbdVHOZS16tdyB0XYTJVf1Ajr7j80QPCXt5mVfs6qA3661HrLctqumidxXUIGaOx6imM5Faarjl+mqojsnUjQ4OHKNg7eiOHSJBV4Eb0oBqgCZQjF4VZ8M62+79JqoGHezlVD3OO0rU/O9l1raIXIyO2Ry//IFBZWkcAZBe6T9nbvRW4nZfYsYiEW2VvH367zH+Yx3AGzi6ogc81hWPlaKi0FAJcnaFD29/Iu3sg+am8FPW3wlqMkjRjqzo71Gtb3/lzX2WkB2RsxphRA7O8VW0eRlfqxPeJP4nFXnzGLXwM x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?iz8X2OLCYaD1a7IiOaBDqfdAzpfW4P/q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YKPEJM/dMyZF2Fk7AJiii3zJGzGGNPptA7JaBQ18IYRVkCPe2ls5CS1e?= =?us-ascii?Q?v8rOleQBJaC3DqLQHKmRjqS2oR4XSOW4x2+3RKUQf00ZjPWsuc3Nri1r3GEv?= =?us-ascii?Q?VnQ2fKq0mRiSfbGnBdWx6ZGU56CGWjrVKSpeuIlR7W04hxWQjoQEPKMRtNep?= =?us-ascii?Q?KEdfYlAna1vrlkURrjwTZ+D3wzh17qJiysGtWxxzY9GGztXX6ehRA5XluFwc?= =?us-ascii?Q?U77kAaoFlkk83JZgaeGZfgWleYdkq8N2NbQRrfRlmCaYn2UDPfDZruFY3hVa?= =?us-ascii?Q?Wzsc8knTsJuNupmfwGhVvf8/XgDQg4Yqe27IsZ7qN7URrHKNHtukXvBoVbkb?= =?us-ascii?Q?FViqa1RWmS5xb4ZyR/GPrOtWlDDZ2lpTiJbiw2/IU00/9c41iWJ3BKRTSSTN?= =?us-ascii?Q?gjsaauIS0GVMjzurbOjgmC0iAQdtYYKTUhIp3o6HhffGOz2r8LIKl1WowiXU?= =?us-ascii?Q?cnmn/7DRh/M7uPhhL5oFipbjlA+/h8LHvHchwvEV0tcYxKfr97YHnrwVLjLl?= =?us-ascii?Q?F85GKwg4HzWkwx20zgZLpVgjv/AM3+wRG/xbLXWmfYTFUKWaksNd93R1cO8Q?= =?us-ascii?Q?ad3xigBPLGqx5rbLe1H5vPp2OOOM7L6d49GD7o4aIp4+YxMRlPpoBUKEcVo/?= =?us-ascii?Q?IF69xBnSDx/AzmzWrJ4=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: aa309d2f-c450-4154-3b75-08dc30f49fd0 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Feb 2024 02:43:59.0839 (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: uYDtcvsUeTEyWZOc3oXrIKF20ZGkXU3b1f89mdAP9TFiuj34Mf2odHDKk+mUsvpCrwSIFqqIU0vgZRvnzspXzA== 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: u6wYeN0IrUGA88SwHvyXK74jx7686176AA= 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=QGyRdeod; 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}") SwitchApContext() can cache the first instance of MpHandOffHob so that the = second enumeration can avoid searching for the MpHandOffHob from the top of HOB list. > VOID > SwitchApContext ( > - IN MP_HAND_OFF *MpHandOff > + VOID > ) > { > - UINTN Index; > - UINT32 BspNumber; > + UINTN Index; > + UINT32 BspNumber; > + MP_HAND_OFF *MpHandOff; >=20 > BspNumber =3D GetBspNumber (); >=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 GetMpHandOffHob (0); > + MpHandOff !=3D NULL; > + MpHandOff =3D GetMpHandOffHob (MpHandOff->ProcessorIndex + > MpHandOff->CpuCount)) > + { > + 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 GetMpHandOffHob (0); > + MpHandOff !=3D NULL; > + MpHandOff =3D GetMpHandOffHob (MpHandOff->ProcessorIndex + > MpHandOff->CpuCount)) > + { > + for (Index =3D 0; Index < MpHandOff->CpuCount; Index++) { > + if (MpHandOff->ProcessorIndex + Index !=3D BspNumber) { > + WaitApWakeup ((UINT32 > *)(UINTN)(MpHandOff->Info[Index].StartupSignalAddress)); > + } > } > } > } > @@ -2226,7 +2235,7 @@ MpInitLibInitialize ( > // enables the APs to switch to a different memory section and > continue their > // looping process there. > // > - SwitchApContext (MpHandOff); > + SwitchApContext (); > // > // Wait for all APs finished initialization > // > -- > 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 (#115578): https://edk2.groups.io/g/devel/message/115578 Mute This Topic: https://groups.io/mt/104369847/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-