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 2C474942184 for ; Tue, 9 Jan 2024 09:00:25 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=cRU0DLVt6rCSl9vKHzvqIMSaKxmxM97hXZG/l9aH6Hc=; 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=1704790824; v=1; b=uCur3dfygHB4LaLeb9lZoHawQ+ps5jwJtt2JGjanP4oWJtSjzaQBpf95auusanVbf3fZAFXD JaWcQIQ3QXYoBCFyn8EUOUaS7l6ml/FuNE0ZChCkV60ePOrLOPOXMfkvBp20S+JMxilcta9m6Z0 G/LIjiWQJGCtlwBMNCC4ym9M= X-Received: by 127.0.0.2 with SMTP id mCWyYY7687511xks4D8S0c1h; Tue, 09 Jan 2024 01:00:24 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web11.12712.1704790823770983168 for ; Tue, 09 Jan 2024 01:00:23 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10947"; a="395295061" X-IronPort-AV: E=Sophos;i="6.04,182,1695711600"; d="scan'208";a="395295061" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2024 01:00:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10947"; a="774776881" X-IronPort-AV: E=Sophos;i="6.04,182,1695711600"; d="scan'208";a="774776881" X-Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga007.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 09 Jan 2024 01:00:22 -0800 X-Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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; Tue, 9 Jan 2024 01:00:21 -0800 X-Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 9 Jan 2024 01:00:21 -0800 X-Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx611.amr.corp.intel.com (10.18.126.91) 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, 9 Jan 2024 01:00: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; Tue, 9 Jan 2024 01:00:21 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DHDmwroTOPBdquG8mF+cb8ON8vsbXcVrYzQ0jmUvNewJ70n5l42sd6s+MdK0TxxHwq7n0xUE28ktuMYLli76DeKdI5fjtZOWFeEKu2Z+3yddDExWTL7ohTa6CJpp6SjiLz10MP+ajY9R+T69ZSr6AVNQxTJWfjlJNY+xUFMjSrhagvv6HAp7MwL0edSddACjayKuBhLXFUw251nlgFlf4s4bZRaA/1WF1lzMxueDhGbN7QADzQGbQJfs9Y7EwvMh3ZWiXLNVEqgr1CW+qni4Hdz9r/yhu6Dm0CpasJpQcud/M/XUlAerxy94L9wN/ufpDdRraLNhQgPcaoPzblREUw== 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=1/U57aGnwK+Ip+iPKCtwrheImZ5iIFsVvw24mcm+JWQ=; b=hKMR8wfLAdB7f2zFdX1wgz/eEeUpBnZKyVPFMFojQkE+bomtap7KCAI0t60VAeE5ONisTeKRL0oQ11RtfgcbI/AT5OgTYjdB0Zy0tHHnQEnM6imRzMXZT5pNrbr2+uFzCR0aRe9v3FfLq7k8Cy7omOLdZ/It8DuqongU6BvMT26zL7WvmBLYd501hEhVt7Y5dYXm9lDT4A9Yh4+QqjBKkaREmiiD1LwxUZ5dvi0qk0tShT7R5duID4eNgGDznsZ/rkNTjklyFa5gjVdTgKFIEQRfAI6yHKTkhyFrkgqkD+uQiwusa5uNXw3r0iR5OoqR+vv2dccAzRD1oSqVqLAlQA== 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 PH7PR11MB7571.namprd11.prod.outlook.com (2603:10b6:510:27e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.23; Tue, 9 Jan 2024 09:00:19 +0000 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::3fea:ca2b:2ef7:e3d4]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::3fea:ca2b:2ef7:e3d4%4]) with mapi id 15.20.7159.020; Tue, 9 Jan 2024 09:00:18 +0000 From: "Ni, Ray" To: "Tan, Dun" , "devel@edk2.groups.io" CC: Laszlo Ersek , "Kumar, Rahul R" , Gerd Hoffmann , "Xu, Min M" Subject: Re: [edk2-devel] [Patch V3 1/2] UefiCpuPkg: set EXTENDED_PROCESSOR_INFORMATION to 0 Thread-Topic: [Patch V3 1/2] UefiCpuPkg: set EXTENDED_PROCESSOR_INFORMATION to 0 Thread-Index: AQHaQfC6+dv8+0LrzEu3xq1XUpVk+7DRMJlA Date: Tue, 9 Jan 2024 09:00:18 +0000 Message-ID: References: <20240108050804.1718-1-dun.tan@intel.com> <20240108050804.1718-2-dun.tan@intel.com> In-Reply-To: <20240108050804.1718-2-dun.tan@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|PH7PR11MB7571:EE_ x-ms-office365-filtering-correlation-id: 74c61551-3330-4e2e-cc98-08dc10f1677a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: g68c6B47VCcB8c9X4/Qx6YpOAGEyTN1imDT+vyXNbGPT13aWWg/QhypYXlUo2tSrzlnKlAgEP3j7ZcUJa4h1TrXUg7cuOvwL21UdTO8c+AdBboSPYXpo/+OjAZR0Pxkikt7jHxmso2wJGibtvow1swJkjHLCQXDhlKE7Uuok4RjEEFAVKUKFn+1HK5m1kfZPxggKTkquwfmKNWnZjV9dqVl6CVevQsm3GKrjl+yO10o01xXb7PzJ+dSi2xbBs4B5tDJTLWurgDrGhiTssSUWezX5MWtAbSm7do2mqwng4dxD8L5I6pYzUe/4z7i1pdOknJ0R2CLq7SdlMPa/jCVOHc69RmgDy7rzWTLXZMZSR8IHTX+OOM7G3fRzXnGiqFEjhxFgMYiy3J+yipLe2OlQsJ+i1Lcs9y1zJHUXf/wFXBCplDcmRfWXjjVrwx3ELCyNHANVAUf+LZYDiFX/8RL+sJn4ae+yNhWGDpPRdzR0kF1id2LVopfM1WKKLHyswO39EQ0cINWENdNpQQjXW0EbffThDPD0lSeK4v6LDIXuvmX+9biAEEUbae5si3erzLxLm390o2bNd34RYnvgTieBrhnovq7DVQFQGaSXTcvwVTlQ6z7Am1hgWd6GLlXhcqCE x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?DBsIi3kwr7n4881DoQJtsVst5SKVHyf0rwWbpa6ZMh4z01cNSYL4gdt+bh1w?= =?us-ascii?Q?fjnH2F+QpASkEDGB8FA0liZoxwGL4zr12NDSscgC5H8AjOuIYn1CmjrZRgGS?= =?us-ascii?Q?BYyUlHgja/TLR2RZef+bTs+0olfKNgCx5S3MkgBNhBldOTlpe7w71110WWYd?= =?us-ascii?Q?mpnPsuLld+HUGTceiVTumWDufR4n9IK80h+WqjRxP4TCMrs+Fs9fWgVjNvpm?= =?us-ascii?Q?kfp+wxYoUOFT/bxyyAnFC4uL8dyOu02xMEaz2E9aYu7RYCq/kWVVvu0M0Fjt?= =?us-ascii?Q?ZsSNChIAdEglJ67T+aMzvqfJCzoP/LyR/+YF+6QQxDvEiQIOtbInbiExUOJh?= =?us-ascii?Q?cfEdJh/Cy+ogWJgUKFmbBZsU+5xbRLEVZfIJZSOpbIWKrf6wZISbNxD783dg?= =?us-ascii?Q?TlR/YOTYpYT/qDDGFoNxVmKHKq4+NvqxZ9R5WIHGUywYOnh/Y8OVJKfdYHv5?= =?us-ascii?Q?GNDyH7xRIVEr6SUkcHhrFc+oec+R1NLjllV5sXkkJPUY4/VBMPSC69NiYEqd?= =?us-ascii?Q?mvZog/VQg9ZPJk9TMcfcWvpT5Ff+7fj4QYi2OzGcMZfZktFUCzX3VctN8RVS?= =?us-ascii?Q?GJWH/Ag1lDPE5+iutlH13fmtnqx7maT1T1e6i+nC+Eatg20/9pfC2pZjs7nh?= =?us-ascii?Q?G1uNRWhPKlef7yYplDGja89kUQ11a1ruem8SYk435D+U4/oo6leutt+VwTeE?= =?us-ascii?Q?vh/bSLrqxXIGV+HOQCrBBzILX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uthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74c61551-3330-4e2e-cc98-08dc10f1677a X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jan 2024 09:00:18.8866 (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: /OpLp94YoWAfilrcnPYlnVTczLjRLJjIem37lplcA/kVFbT6RPWqGPu8edc7Ow8Mx70DVRstbcaxPIjN5KIytg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB7571 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: akbrrNxkQfRaZ1UyL4lvh0ilx7686176AA= 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=uCur3dfy; 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 Reviewed-by: Ray Ni Thanks, Ray > -----Original Message----- > From: Tan, Dun > Sent: Monday, January 8, 2024 1:08 PM > To: devel@edk2.groups.io > Cc: Ni, Ray ; Laszlo Ersek ; Kumar, > Rahul R ; Gerd Hoffmann ; > Xu, Min M > Subject: [Patch V3 1/2] UefiCpuPkg: set > EXTENDED_PROCESSOR_INFORMATION to 0 >=20 > Set EXTENDED_PROCESSOR_INFORMATION to 0 in API > MpInitLibGetProcessorInfo() of MpInitLibUp. This > commit use ZeroMem() to set all fileds in output > EFI_PROCESSOR_INFORMATION to 0 before StatusFlag > field is reassigned. >=20 > Previously EXTENDED_PROCESSOR_INFORMATION in the API > MpInitLibGetProcessorInfo() of MpInitLibUp is ignored. > In PEI/DXE MpInitLib, EXTENDED_PROCESSOR_INFORMATION > will be retrived when BIT24 of input ProcessorNumber > is set. This commit can avoid garbage in the output > structure in MpInitLibGetProcessorInfo() of MpInitLibUp. >=20 > Signed-off-by: Dun Tan > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Rahul Kumar > Cc: Gerd Hoffmann > Cc: Min Xu > --- > UefiCpuPkg/Include/Library/MpInitLib.h | 2 ++ > UefiCpuPkg/Library/MpInitLib/MpLib.c | 2 ++ > UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c | 15 ++++++++------- > UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.inf | 1 + > 4 files changed, 13 insertions(+), 7 deletions(-) >=20 > diff --git a/UefiCpuPkg/Include/Library/MpInitLib.h > b/UefiCpuPkg/Include/Library/MpInitLib.h > index 1853c46415..842c6f7ff9 100644 > --- a/UefiCpuPkg/Include/Library/MpInitLib.h > +++ b/UefiCpuPkg/Include/Library/MpInitLib.h > @@ -63,6 +63,8 @@ MpInitLibGetNumberOfProcessors ( > instant this call is made. This service may only be called from the BS= P. >=20 > @param[in] ProcessorNumber The handle number of processor. > + Lower 24 bits contains the actual pr= ocessor number. > + BIT24 indicates if the > EXTENDED_PROCESSOR_INFORMATION will be retrived. > @param[out] ProcessorInfoBuffer A pointer to the buffer where > information for > the requested processor is deposited= . > @param[out] HealthData Return processor health data. > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c > b/UefiCpuPkg/Library/MpInitLib/MpLib.c > index a359906923..cdfb570e61 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c > @@ -2333,6 +2333,8 @@ MpInitLibInitialize ( > instant this call is made. This service may only be called from the BS= P. >=20 > @param[in] ProcessorNumber The handle number of processor. > + Lower 24 bits contains the actual pr= ocessor number. > + BIT24 indicates if the > EXTENDED_PROCESSOR_INFORMATION will be retrived. > @param[out] ProcessorInfoBuffer A pointer to the buffer where > information for > the requested processor is deposited= . > @param[out] HealthData Return processor health data. > diff --git a/UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c > b/UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c > index 86f9fbf903..d4f8611af8 100644 > --- a/UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c > +++ b/UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c > @@ -12,6 +12,7 @@ > #include > #include > #include > +#include >=20 > /** > MP Initialize Library initialization. > @@ -77,6 +78,8 @@ MpInitLibGetNumberOfProcessors ( > instant this call is made. This service may only be called from the BS= P. >=20 > @param[in] ProcessorNumber The handle number of processor. > + Lower 24 bits contains the actual pr= ocessor number. > + BIT24 indicates if the > EXTENDED_PROCESSOR_INFORMATION will be retrived. > @param[out] ProcessorInfoBuffer A pointer to the buffer where > information for > the requested processor is deposited= . > @param[out] HealthData Return processor health data. > @@ -108,13 +111,11 @@ MpInitLibGetProcessorInfo ( > return EFI_NOT_FOUND; > } >=20 > - ProcessorInfoBuffer->ProcessorId =3D 0; > - ProcessorInfoBuffer->StatusFlag =3D PROCESSOR_AS_BSP_BIT | > - PROCESSOR_ENABLED_BIT | > - PROCESSOR_HEALTH_STATUS_BIT; > - ProcessorInfoBuffer->Location.Package =3D 0; > - ProcessorInfoBuffer->Location.Core =3D 0; > - ProcessorInfoBuffer->Location.Thread =3D 0; > + ZeroMem (ProcessorInfoBuffer, sizeof (*ProcessorInfoBuffer)); > + ProcessorInfoBuffer->StatusFlag =3D PROCESSOR_AS_BSP_BIT | > + PROCESSOR_ENABLED_BIT | > + PROCESSOR_HEALTH_STATUS_BIT; > + > if (HealthData !=3D NULL) { > GuidHob =3D GetFirstGuidHob (&gEfiSecPlatformInformationPpiGuid); > if (GuidHob !=3D NULL) { > diff --git a/UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.inf > b/UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.inf > index 24ad29c03c..eb0a168f74 100644 > --- a/UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.inf > +++ b/UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.inf > @@ -32,6 +32,7 @@ > DebugLib > LocalApicLib > HobLib > + BaseMemoryLib >=20 > [Ppis] > gEfiSecPlatformInformationPpiGuid ## SOMETIMES_CONSUMES > -- > 2.31.1.windows.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 (#113433): https://edk2.groups.io/g/devel/message/113433 Mute This Topic: https://groups.io/mt/103592278/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-