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 74DE3AC0BBB for ; Thu, 4 Jan 2024 07:32:34 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=2ZDqil2moCuJT/qEK2gUdKIAHEPdDKKC2u5aSHaSxQI=; 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=1704353552; v=1; b=orr8rRrIJjdBnQISNZ1tXXqxTlTUsWYJR1W0MK63rRv3aC1EVBd6C2ETOlQPOA+VI1LvCQtd y/3+lrCtdPXXky6HXrkveBaeCT6Qii2EgTQ5WcmcqAXsKz30UbYjFVzGgb8F/zmJhN6gUnWW8NM Yoy831pqSFgheUjA93cuab9I= X-Received: by 127.0.0.2 with SMTP id QuQTYY7687511xramGo9ePu4; Wed, 03 Jan 2024 23:32:32 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by mx.groups.io with SMTP id smtpd.web10.49450.1704353547906751806 for ; Wed, 03 Jan 2024 23:32:32 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10942"; a="3961018" X-IronPort-AV: E=Sophos;i="6.04,330,1695711600"; d="scan'208";a="3961018" X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2024 23:32:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10942"; a="850702333" X-IronPort-AV: E=Sophos;i="6.04,330,1695711600"; d="scan'208";a="850702333" 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; 03 Jan 2024 23:32:30 -0800 From: "duntan" To: devel@edk2.groups.io Cc: Ray Ni , Laszlo Ersek , Rahul Kumar , Gerd Hoffmann , Min Xu Subject: [edk2-devel] [PATCH 1/2] UefiCpuPkg: Retrive EXTENDED_PROCESSOR_INFORMATION Date: Thu, 4 Jan 2024 15:32:15 +0800 Message-Id: <20240104073216.1327-2-dun.tan@intel.com> In-Reply-To: <20240104073216.1327-1-dun.tan@intel.com> References: <20240104073216.1327-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: FE5S2IfWAokYLQBsqVoffIhLx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=orr8rRrI; 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 Retrive EXTENDED_PROCESSOR_INFORMATION in the API MpInitLibGetProcessorInfo() of MpInitLibUp instance when the BIT24 of input ProcessorNumber is set. It's to align with the behavior in PEI/DXE MpInitLib 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 | 12 ++++++++++++ 3 files changed, 16 insertions(+) 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 BSP. @param[in] ProcessorNumber The handle number of processor. + Lower 24 bits contains the actual processor 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 BSP. @param[in] ProcessorNumber The handle number of processor. + Lower 24 bits contains the actual processor 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..3af4911d4b 100644 --- a/UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c +++ b/UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c @@ -77,6 +77,8 @@ MpInitLibGetNumberOfProcessors ( instant this call is made. This service may only be called from the BSP. @param[in] ProcessorNumber The handle number of processor. + Lower 24 bits contains the actual processor 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. @@ -115,6 +117,16 @@ MpInitLibGetProcessorInfo ( ProcessorInfoBuffer->Location.Package = 0; ProcessorInfoBuffer->Location.Core = 0; ProcessorInfoBuffer->Location.Thread = 0; + + if ((ProcessorNumber & CPU_V2_EXTENDED_TOPOLOGY) != 0) { + ProcessorInfoBuffer->ExtendedInformation.Location2.Package = 0; + ProcessorInfoBuffer->ExtendedInformation.Location2.Die = 0; + ProcessorInfoBuffer->ExtendedInformation.Location2.Tile = 0; + ProcessorInfoBuffer->ExtendedInformation.Location2.Module = 0; + ProcessorInfoBuffer->ExtendedInformation.Location2.Core = 0; + ProcessorInfoBuffer->ExtendedInformation.Location2.Thread = 0; + } + if (HealthData != NULL) { GuidHob = GetFirstGuidHob (&gEfiSecPlatformInformationPpiGuid); if (GuidHob != NULL) { -- 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113138): https://edk2.groups.io/g/devel/message/113138 Mute This Topic: https://groups.io/mt/103518742/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-