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 ACA9C78003C for ; Thu, 7 Dec 2023 00:22:55 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=AmF60RunTACoHCkew7fo20np/DbVHhKjgNLY9nmj34E=; 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=1701908574; v=1; b=R9enNm7/8o6ZZJjjbWveMzFUmFkJ9R0HgSul5HIJrNylwtQ0GnGcdwBih44Yd4lW4wI7hemE E7VqaLbGjG36yYXa5n01IDOZ80CJFRXLGj7ICV3KGDCr1qHvtq0njzGMjtweiyjlaydZhIuGaBz zKyYI9syNUDpZHYNsi9En2hM= X-Received: by 127.0.0.2 with SMTP id uf36YY7687511xyOtjPZRZ1q; Wed, 06 Dec 2023 16:22:54 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by mx.groups.io with SMTP id smtpd.web10.67589.1701908573738535007 for ; Wed, 06 Dec 2023 16:22:53 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10916"; a="7453328" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="7453328" X-Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2023 16:22:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="19502737" X-Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orviesa001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 06 Dec 2023 16:22:53 -0800 X-Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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; Wed, 6 Dec 2023 16:22:52 -0800 X-Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Wed, 6 Dec 2023 16:22:46 -0800 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.100) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 6 Dec 2023 16:22:46 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OQojudL2CUqPRa7V2BvI/IUXZrUwQGA+B2jboKHNSDhISQpfZpmhXn3id35sMAur2cFBjxVd9/hQGuUMr7rvBKmJicJzBw8XtutFpRV9uVuV+8HQptq1A/z7g6ngmTRhjZOpfpY9LiGIrAzd0HnHYp/+T8yzYDDgjvyjElxj/Qs3HCN9QeR7xk/W+nzgEk22pzm3zxeVqIg10stIrXX0ezzvj+KNTE2FUrAAWfh/CDmSq5QrWacU9sJdjV/V+IsVKMrY7jJa5pB9tU018SYDvVUMo3GOoEGHBun5VlYHnHZPLN9+i870ntT3W26QejlN0R3/jxXrbsrVAtElGsSjfw== 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=pdvCOE2c2dINk3Q1xtSCjB3Gj8vUXJWXwbQzjqwyn4I=; b=eEblEvptjzCCSRDfswiFamHKVdQcsG7cUD/nDmtC3RJ3fk4o1rnX/B9tlLzJvFNVKy8ljCdwji1Ip9CuOTCHmsH32ZWRppMmL8NQ/R4OHS07b+oF5CGZ6iapRrhgt6/H0rfg0OjZNL6XL2EYkSJj+JeVEb5MdvZbxh82Camh0qZ6EJu2o0PuqLXW41kdOdYdyq3L2Z+yWa5GqoPgz1M/1IomJ90aW2sXZhnjbAS5ZCrlD08VMRo7iqxYjEou9A9N+pYk7PymlQkrHaN6hm93WGIWb4G8A91r0Fn0giYZMrKwH3QSiVS5HQO+EH9haKKMJxSsrC1iQTonQBr4DyW1jQ== 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 BN9PR11MB5483.namprd11.prod.outlook.com (2603:10b6:408:104::10) by PH8PR11MB7965.namprd11.prod.outlook.com (2603:10b6:510:25c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34; Thu, 7 Dec 2023 00:22:39 +0000 X-Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::6da1:a4b7:4771:14e1]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::6da1:a4b7:4771:14e1%5]) with mapi id 15.20.7068.025; Thu, 7 Dec 2023 00:22:39 +0000 From: "duntan" To: "Ni, Ray" , "devel@edk2.groups.io" CC: "Dong, Eric" , "Kumar, Rahul R" , Gerd Hoffmann Subject: Re: [edk2-devel] [PATCH 3/6] UefiCpuPkg: Consume MpInfo2Hob in PiSmmCpuDxe Thread-Topic: [PATCH 3/6] UefiCpuPkg: Consume MpInfo2Hob in PiSmmCpuDxe Thread-Index: AQHaJz7RGa6jjpG2MkGGLZfxXJAGj7Cb/d5wgAD2uBA= Date: Thu, 7 Dec 2023 00:22:39 +0000 Message-ID: References: <20231205054900.926-1-dun.tan@intel.com> <20231205054900.926-4-dun.tan@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BN9PR11MB5483:EE_|PH8PR11MB7965:EE_ x-ms-office365-filtering-correlation-id: 8f04e16c-4ec1-4272-467b-08dbf6ba9f15 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: jdEIdm7GADCl+N4mcwiCxPwJgVtM8BN4BBlao8bocoiVNiBKjJlgl08SA+aa73OjIcPdDqODGB2tJ5y0Za9d2as8KUyi0I6+DOVpcHoJhW3EGoKXuqrTSIc3zfUpKxmK6wQlRRmYWy+TGEera8aNPGSumujVIvyqimQTxWnhAvbbaXlDVFFo2yB/gl10c2+rikvl8AUxDw5UAslO1tDzZMk4vOeBwum4NnjlIu2rwrWhKdv9Y/UzxkaRzY0pICjJnCe9julYJyjJmPfEVx6aZWXmY14kKsbZ2vFapwAhpw/PkDnPIyG6sGp6grq2I/aX3J1ygWnFQ9rOCu+LB7/pgGLPj2R0vtWgYe+KFXi37caN2nEqm+XoyoEsQBDM6ZmjRv85I+Zejm3kb+An2hlHere4nIBtz50psXzcB/St77yTlTXdmYSkAysx8/yJlJr6O6NH5a1UTfyXkG7APXw+xOKLFCoC5VOSwZxcSr3sqrxz7Z+yKAjg55w323m8IKzl4Wdm+0MmLrg8sc741hGWxhizbxbyF0FL8jC0nFlECRW4lZ/Fhj+GBbFuLDAv7xjR+L2e40hFj1hZOpf84ECE/HrJM80gg3n/9FQF9K6WOOXGkU8mhdCnpubWNuoey6C/ x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?aOVukUbN6sMXx8El+5GymZhBajR8aCwgKH+CzY6isKOuthyJFGzNAqABk4F2?= =?us-ascii?Q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Nc5J4JkFkNG3f6s?= =?us-ascii?Q?XuzrS7ZFYmTIIMhnQxIRl20Tmx/mL5hCXSZPUIRdTfcc8Gd3jV0eVAXXdV/j?= =?us-ascii?Q?Yb6yPfnQv63jkcl2nudp340imQapuKVkxD1q+tyqKI6Cu/l7Tvbc93/x/B2c?= =?us-ascii?Q?bNSQRbWgEzADnDlfEiQARgREHneXQyOsJ/NdTdnsWJl3VeHB8s/knDFc05Yh?= =?us-ascii?Q?pkxV68tPfkoJAJ9Jg+vSc8rYLOJjRUIzlVi4w+dz6vSO1smShpBWsrMyKwU4?= =?us-ascii?Q?mzI0aIikA968idKGpx/Dj8PbgGgsYUazlrOKmXifeYNZj/T0O8xi6qCkK9YC?= =?us-ascii?Q?TBtTkoGwv/cNfVFpiI630Jsyks96DU4fyfvheIpuKPmrgBtcjpDMm5IjbUoj?= =?us-ascii?Q?5DE72BSpoq8RaJzKFo3Udnt+DS3Q+/ca+cJJ6V/lfPfwzfaTYddS3n1a3lGm?= =?us-ascii?Q?H8wFi7SUlXAp+g8EG1avOgxjJRvWxDoY3hA9b5RC9Y5l3n8IScPDKV5rgn7I?= =?us-ascii?Q?HKBkzro+OW2oi8l/MmCHuubPp2vmFOAkPBecSEC057+U3KzlQLuqRxFytINr?= =?us-ascii?Q?1MaXQvRFILcHeFuKAeaSccX+bhIrpP3GkbOb98zKKkOC9Q4UTJmyfa4gj6xQ?= =?us-ascii?Q?3ucljvvi2m3MEj6fdUU=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5483.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f04e16c-4ec1-4272-467b-08dbf6ba9f15 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Dec 2023 00:22:39.6314 (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: BQmbl6/NNi9wxmjCT2lSTJA4hOj6bmCQAmTmMEjYCkAfMGSAuOR+nzWLyWK46JZmZQUr26OZKVl64IQyUqh9bw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR11MB7965 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,dun.tan@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 4IJ8jVALpOnjvmXKz1lKshQ4x7686176AA= 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="R9enNm7/"; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); 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 Will change the code based on comments 1-9. About comments 10, "10. The depex change means that CpuSmm driver could run= before CpuMp driver runs. Have you verified if CpuSmm can start well even = removing CpuMp DXE driver?" Yes, I verified it in OvmfIa32X64 boot. CpuSmm can start well even removing= CpuMp DXE driver.(also removed some checking for gEfiCpuArchProtocolGuid) Thanks, Dun -----Original Message----- From: Ni, Ray =20 Sent: Wednesday, December 6, 2023 5:55 PM To: Tan, Dun ; devel@edk2.groups.io Cc: Dong, Eric ; Kumar, Rahul R ; Gerd Hoffmann Subject: RE: [PATCH 3/6] UefiCpuPkg: Consume MpInfo2Hob in PiSmmCpuDxe 1. The function name can be "GetMpInformation()" without mentioning "FromMp= Info2Hob". > + EFI_HOB_GUID_TYPE *GuidHob; > + EFI_HOB_GUID_TYPE *FirstMpInfor2Hob; 2. "FirstMpInfo2Hob". Please remove "r". >+ FirstMpInfor2Hob =3D GetFirstGuidHob (&gMpInformationHobGuid2); 3. Please update comments to explain "FirstMpInfo2Hob" is to speed up the 2= nd while-loop without needing to look for MpInfo2Hob from beginning. > + > + ASSERT (CpuCount <=3D PcdGet32 (PcdCpuMaxLogicalProcessorNumber)); > + *NumberOfCpus =3D CpuCount; 4. There is no "return" before "*NumberOfCpus" assignment. So, why not remo= ve "CpuCount" and directly udpates "*NumberOfCpus" in the while-loop? > + > + MpInfomation2Buffer =3D AllocatePool (sizeof > (MP_INFORMATION2_HOB_DATA *) * HobCount); 5. MpInfomation2Buffer -> MpInfo2Hobs 6. Can you move "PrevProcessorIndex" assignment just above the "for" loop? > + for (Index =3D 0; Index < HobCount; Index++) { 7. Index -> HobIndex > + CopyMem ( > + ProcessorInfo + PrevProcessorIndex + ProcessorIndex, 8. &ProcessorInfo[PrevProcessorIndex + ProcessorIndex] > + > + *ProcessorInfoPointer =3D ProcessorInfo; 9. If you let the function just return ProcessorInfo and NULL when failure = happens, will it simplify the code? >=20 > +[Depex] > + TRUE > -[Depex] > - gEfiMpServiceProtocolGuid 10. The depex change means that CpuSmm driver could run before CpuMp driver= runs. Have you verified if CpuSmm can start well even removing CpuMp DXE d= river? -=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 (#112146): https://edk2.groups.io/g/devel/message/112146 Mute This Topic: https://groups.io/mt/102987139/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-