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 476AD940F77 for ; Mon, 19 Feb 2024 02:57:17 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=WsQIAc1JaabL1NVKBnc3epRJFseo+S06ntoLoy7F/Zk=; 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=1708311435; v=1; b=Uon66Da2/T9mGyZ+K6nW2FItt3kmGWbuhNeiZ7MGuuIhKCewlDk4YokXGIv9Hph2OqIBs8wj fzlqauQi4UUAJXN02qCbexU3jwKjfHCeuZgkzTOIM+/bpsUUmOUekddWPVXMLuRgUI+PKcV83GC Ut8isC225ihtBpq+PT/F+Dr4= X-Received: by 127.0.0.2 with SMTP id OUzqYY7687511xw6mXiwpann; Sun, 18 Feb 2024 18:57:15 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mx.groups.io with SMTP id smtpd.web11.33651.1708311435225528170 for ; Sun, 18 Feb 2024 18:57:15 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10988"; a="24836259" X-IronPort-AV: E=Sophos;i="6.06,170,1705392000"; d="scan'208";a="24836259" X-Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2024 18:57:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,170,1705392000"; d="scan'208";a="4660524" X-Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orviesa007.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 18 Feb 2024 18:57:15 -0800 X-Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) 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:57:14 -0800 X-Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX611.amr.corp.intel.com (10.22.229.24) 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:57:14 -0800 X-Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) 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:57:14 -0800 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.40) 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; Sun, 18 Feb 2024 18:57:13 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q3UWc3xjzFLsNh274oNS6cnMYhoVeIWqL1KiH0HYROE2OKonl9vcz/f+R86MfkSkdCu6LZmaySaghE4EnimcXflRWMsMKEIMbKsqiYGmuEWoIv/l44/pbFGJPhbazMOdlF+islXkBLYI5TqxAPkrJNQVt1BbECyiBV1sBGaSRRVkY1uEMKG9e/82P4QfXXne6z7gvEPgKHf0YpBgQ/Fz9zr9KGC7V9BqR0aN9bDghHIKxr/AnorWcHm0/T0Xcw9cldjiyfUtywD/k094p1GzH7Mu1PLZq747KSRDfxOjrnSAhtHHA7cBU1qcyD1MQgpaW8KAzx/eU5AGsgPEjiXpng== 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=V6r2SdMJZtD3bZE+GofiWbdvWSOhMRi5i4CzJ34Z1hY=; b=famZfw8ZYo+YN2egpwvruY+0HVEABnMSfeFM8bQt3RYBqbw1ntMERghyM+En7F3QB1bbdnB8CzJ5EGK7GMPpxaR+LjmOw29X2Opr4INFkLSyxXLr+8s5wdcvwSS8d/QEymbVjifIx+iWwfgu0X29MqFBVcF/od7cD8TEOWZhGkr3QbiCOXrntegFLCGXg7II/iARfNEykLjYzy+l+ozOVZG03XLI2eiG5hJJL/gs1RpgCsESXFo8fgVyJ3razFLMw2FaYxjvq43OgZY6UTy7RQTjjp9b1PFgYUdQ4bFcOlIjI6Jy+vt1ZBqjOK4IUJDrgokj7+HLMEITKNsTwo3z5w== 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 CH3PR11MB7866.namprd11.prod.outlook.com (2603:10b6:610:124::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.38; Mon, 19 Feb 2024 02:57:12 +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:57:12 +0000 From: "Ni, Ray" To: Gerd Hoffmann , "devel@edk2.groups.io" CC: Oliver Steffen , Laszlo Ersek , "Kumar, Rahul R" Subject: Re: [edk2-devel] [PATCH 4/5] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to MpInitLibInitialize Thread-Topic: [PATCH 4/5] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to MpInitLibInitialize Thread-Index: AQHaX/HXtabwWmpZikaF5eE85wdrUbEQ+3Hg Date: Mon, 19 Feb 2024 02:57:12 +0000 Message-ID: References: <20240215093149.251319-1-kraxel@redhat.com> <20240215093149.251319-5-kraxel@redhat.com> In-Reply-To: <20240215093149.251319-5-kraxel@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|CH3PR11MB7866:EE_ x-ms-office365-filtering-correlation-id: 9652978d-21b7-4176-3fae-08dc30f678b9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: RP3XIdOqf7/+HlRGNpKzr64fiY/iW9eJdOEFKN2Hz+g/fI/syOQsEBAB/WWxUE99TIGtDKpgwdxAxjRlS7KWAH9lw83rji2rovnhots+nNvOT1GbG67+QtJRmo/2V1QIpKHKjhkNL6pj1riYBL99//X3nlVLmPxRU2KWBEBItrjIZ+oRbZkBEH0W6VCMHkYqxXGFJskYZDGYP9Ii+rdHYBvWq15vIxJyELKfTkRZNvh93Qoe7jxTU97Z5bl9egNkvAqO3yRzmp0URVHmWocKvvkzU9WyTFRMSP62xQ5FyZC6zpQ65E5wYW1qcSUATjwM+51h9de0/5BLewhRNYwLy5GRKhGFF7ZyF2GB46neWs6TfM3XhVMBrFhm+uXvob9GpQRbNjiVoNdk8LziX8/CRrNvFzjaO7BJTndJJ6LH8ndEUcDB99wcguX3I+rv0dapoUwAYe1oGPJX63OWW/urKPCdFjEQ6tkuIOv5gtxqgiRFLt8h8oPRCVBe1fM0knZdIPjSFacVTGMROocSeKKt/TylseoByZD1BZBHh8c/zUoa5+QA60nP7z01skLSBACIGibeU3QhFA5hahhVh93FDmlKTTh7kw1vdPNRdD+G61US/VlNTHSixEZ5dA0fkvG2 x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?y/H/gmVYRGT4UluDJ4WVVXL6aBy+9WW0tKvVD+PWdbLUXisLlupq3aX7/shT?= =?us-ascii?Q?YtoP/FwebXEmsk27dM8zHcuMo2RbSc2zsXADJQ2L8JsBA1jG0yOG9tVMTNx2?= =?us-ascii?Q?Mv5uwX9vSQsL2hyaPO+t9+guzwNhxMleo4v992bnDBOl8dJgGvtSnMJI5oA0?= =?us-ascii?Q?5V0vkA7oEEfR8wsLwLRti2WzTZW3zLbmRc4iERnMyqtDG8Gdpa2qUvNdQYWZ?= =?us-ascii?Q?SQ6E3oIc99l/43XwEFQOvM68OHY8W/ePsYe2HcPqOVw5w+wOQU9bURWZ22QI?= =?us-ascii?Q?72SlZlr03hyNUcyFFXRhARyXzBisRA6W5ctQYlJ2KfUvRg3S5v2XXjoVHYrn?= =?us-ascii?Q?j9Qo3RZQgV/4HD+HY28FaNCAs9gJhgTpk7CKSJQtneLXVipPMlI+d4p7mvMQ?= =?us-ascii?Q?2hL1Avj85v6nGbJ/jafMfiJBVR4BdnA/WTivBq5dokrvb+AVmi55cUK5GoKW?= =?us-ascii?Q?NOjBlZaJeSGVX3HIc3pqND9wp+gKm4tZwVBhHlwU970zVYpI5VazBYmFcadM?= =?us-ascii?Q?YmyBSk1ymJF/iT3KGb6Wj+qe8VKe9KjDN8GtaNUw2FZEagOnrYTC5UC1deVC?= =?us-ascii?Q?+q3SjDFNpY5knF0uOumcsOxRcU+NUxsuD4sUr11QDwr2HY/gBkmggFMBBxyr?= =?us-ascii?Q?kAQi2FNifD3Vv2la11hdEUKYc+pNSEPw/s/Jx0ntq/bhRsN8w4hsJZzrUrd0?= =?us-ascii?Q?Pn5sxbJGxjOQiWqsw5aI/xYkM52kMjLo/ecIieNDPJyu9SIms+P+z2UrWieM?= =?us-ascii?Q?+fnlHytNOIaDQN8yZihyhAZaBlcWS9uXN84jVI1WDCjKgedCqHisvcNbvlMV?= =?us-ascii?Q?JhJs4Qg/slfQn0X4h2jQ2sTZVxDc0uPhxaE0QoPEbMwgBd0ipkJGvK8W9XAn?= =?us-ascii?Q?psD3AxQ5nA1xhKlm+MLM5DzOZIkDWjjlfTzl5w8oieVKEvAo6C3ZkK6OlZzm?= =?us-ascii?Q?fNqnFgsSw4JZBl0qN6VGmOHFCidgWV5IQ4Je1JYuec3Nc9sqZvebQHx3o+Ml?= =?us-ascii?Q?NRPOBr8uUf9SDzK4th/8hJPhE+B1ZPCSFZ3tVIH7z0tnGRJ3c7TNwnVATkrk?= =?us-ascii?Q?W+rm20at7pL1LS5v8/0il5g666jZCXTsqdTGEVJErZkkmcEGzLdtQFtDArMP?= =?us-ascii?Q?/WHqfA/MLkVkD+FTYkunkJaRTNAc0dRkUp4QvMWGa+GQxtdb1okAakqaVJEA?= =?us-ascii?Q?B9G2Mu1W2CTSEB4kx62unhb4g7u3PLHBJwF6DfUq7E50gCZO1AS9OHNGNEka?= =?us-ascii?Q?I+/J2m1QmhCyksv2VaLCl5HXyNVzNuhOW984zF7TycFhj0aZr/x/tfjwzCVS?= =?us-ascii?Q?O0vNbDbP6D6pabj1H3Bvr57gLgNFi5MpSj6EcMuWDQe7sWZXnvcR7zP5sghq?= =?us-ascii?Q?3km8jImsLgYmoc5u5jS+GfYJ62m7l7e4rnLtAhKMKVArSpbf/l9VLmz1KU2Z?= =?us-ascii?Q?fmI2mGqAiRW7OWrZsPqF/G0xOGZzZbKYO7AcEO+MGXmCm9ZMScogPiwb9x1a?= =?us-ascii?Q?AQm3EoxQBRN8G9Jsis+HKXdsxvvPxwpDu6RgZBtxAcndk7Yfb2MclE0bkX2q?= =?us-ascii?Q?QrBH8cpuaQGlgfT+zI8=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: 9652978d-21b7-4176-3fae-08dc30f678b9 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Feb 2024 02:57:12.4923 (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: be51BfELhpN3XXdwNsxfyhesM5all4dm2N8zI55oEbUjThkLhRY3eIvkQ1ufm6Hrmg2n0tsoGct05psM4MybHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB7866 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: u1PPizGNhhUirLMxh20SattXx7686176AA= 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=Uon66Da2; 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 > - MpHandOff =3D GetMpHandOffHob (0); > - if (MpHandOff =3D=3D NULL) { > + MaxLogicalProcessorNumber =3D 0; > + HaveMpHandOff =3D FALSE; 1. Can we cache the first MpHandOff instance? It can be used as an indicato= r to replace "HaveMpHandOff", and also can speed up the HOB enumeration in later logic. > + > + while ((MpHandOff =3D GetMpHandOffHob > (MaxLogicalProcessorNumber)) !=3D 0) { 2. Can you use "!=3D NULL" instead of "!=3D 0"? > + DEBUG (( > + DEBUG_INFO, > + "%a: ProcessorIndex=3D%u CpuCount=3D%u\n", > + __func__, > + MpHandOff->ProcessorIndex, > + MpHandOff->CpuCount > + )); 3. can you add an assertion "ASSERT (MaxLogicalProcessorNumber =3D=3D MpHan= dOff->ProcessorIndex);"? It's to ensure no gap or overlap. > + MaxLogicalProcessorNumber +=3D MpHandOff->CpuCount; > + HaveMpHandOff =3D TRUE; > + } > + > + if (!HaveMpHandOff) { 4. "HaveMpHandOff =3D=3D TRUE" --> "FirstMpHandOff !=3D NULL" > + for (HobIndex =3D 0; HobIndex < MpHandOff->CpuCount; HobIndex++) 5. How about "ProcessorIndexInHob"? "HobIndex" is a bit confusing. >=20 > + MpHandOff =3D GetMpHandOffHob (0); 6. All the GetMpHandOffHob(0) can be replaced with "FirstMpHandOff". -=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 (#115579): https://edk2.groups.io/g/devel/message/115579 Mute This Topic: https://groups.io/mt/104369843/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-