From nobody Fri Dec 19 18:44:23 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+113355+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113355+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1704690500; cv=none; d=zohomail.com; s=zohoarc; b=nHfOg/0mlvN3eHAFATm4nL39Jr915ekZuu9TRIS7XkUJ2n+syXPWwwR7RupFTCa3pZeWgXcsthmkJxuCudEbAcsq/g7uhNmO4deTFfUrGXQ/anBfiPTivAKtf5B6r2n0osXYUvo7JFqFhJ0nCg+4Nr5ka7mkxsnFJWhHrt2KKRI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704690500; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=SweuqBFgqLkl7LxXfuzJR4Lmx7ZdO5SiYiBUut00jKs=; b=kn6cqpWnM7u8Oo+5HxqCD4ngyI+atQ299MmhFYYvQBpb1YSpC89LzI3NZtsB8vnw4mNBLwpdOCwKOKxnBrqQkdMZj74VTtX305X65vssJ9RfxBsTNSduQybLIMhUXmzwhtgBlfYIBZmq+tgJBFx5XwXam3SKRVMVbO3/NER/xuA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113355+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1704690500150622.2227462971033; Sun, 7 Jan 2024 21:08:20 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=5wchhWGH7HgBZjAIQMSzMp+SS5v/aMfhzSci7PKTaDE=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1704690499; v=1; b=fMJa9s1prAAeTsQEslISM1eKopTYv5Z1A1DZOU4zOZJPG9bOTqd6wQuQkpKZIQcija1AGfhG BfLLeFR+FyqC1XRbcvgF0vpc3bARalTjAIf3fzSrSqjS0IA9olT00Tscr7fBCK6Ta2iO6qP1B+N If/O/k/I7Krh7V4S/nq8Akv4= X-Received: by 127.0.0.2 with SMTP id TFbPYY1788612xJseEADGWEk; Sun, 07 Jan 2024 21:08:19 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.570.1704690496858940286 for ; Sun, 07 Jan 2024 21:08:19 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10946"; a="400552652" X-IronPort-AV: E=Sophos;i="6.04,340,1695711600"; d="scan'208";a="400552652" X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2024 21:08:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10946"; a="851683233" X-IronPort-AV: E=Sophos;i="6.04,340,1695711600"; d="scan'208";a="851683233" X-Received: from shwdeopenlab702.ccr.corp.intel.com ([10.239.55.43]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2024 21:08:17 -0800 From: "duntan" To: devel@edk2.groups.io Cc: Ray Ni , Laszlo Ersek , Rahul Kumar , Gerd Hoffmann , Min Xu Subject: [edk2-devel] [Patch V3 1/2] UefiCpuPkg: set EXTENDED_PROCESSOR_INFORMATION to 0 Date: Mon, 8 Jan 2024 13:08:03 +0800 Message-Id: <20240108050804.1718-2-dun.tan@intel.com> In-Reply-To: <20240108050804.1718-1-dun.tan@intel.com> References: <20240108050804.1718-1-dun.tan@intel.com> MIME-Version: 1.0 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: 12QmDEaIRqpYCK7Y0JUAzupux1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704690501263100007 Content-Type: text/plain; charset="utf-8" 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. 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. Signed-off-by: Dun Tan Cc: Ray Ni Cc: Laszlo Ersek Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Min Xu Reviewed-by: Ray Ni --- 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(-) diff --git a/UefiCpuPkg/Include/Library/MpInitLib.h b/UefiCpuPkg/Include/Li= brary/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 BSP. =20 @param[in] ProcessorNumber The handle number of processor. + Lower 24 bits contains the actual proc= essor number. + BIT24 indicates if the EXTENDED_PROCES= SOR_INFORMATION will be retrived. @param[out] ProcessorInfoBuffer A pointer to the buffer where informat= ion for the requested processor is deposited. @param[out] HealthData Return processor health data. diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpIn= itLib/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 BSP. =20 @param[in] ProcessorNumber The handle number of processor. + Lower 24 bits contains the actual proc= essor number. + BIT24 indicates if the EXTENDED_PROCES= SOR_INFORMATION will be retrived. @param[out] ProcessorInfoBuffer A pointer to the buffer where informat= ion for the requested processor is deposited. @param[out] HealthData Return processor health data. diff --git a/UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c b/UefiCpuPkg/Libr= ary/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 BSP. =20 @param[in] ProcessorNumber The handle number of processor. + Lower 24 bits contains the actual proc= essor number. + BIT24 indicates if the EXTENDED_PROCES= SOR_INFORMATION will be retrived. @param[out] ProcessorInfoBuffer A pointer to the buffer where informat= ion 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/Li= brary/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 --=20 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 (#113355): https://edk2.groups.io/g/devel/message/113355 Mute This Topic: https://groups.io/mt/103592278/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-