From nobody Fri May 17 23:25:09 2024 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+113138+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+113138+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1704353553; cv=none; d=zohomail.com; s=zohoarc; b=jUmpL3DvJb9toB4JrNStsbaBBaskfyzcDkUuCv1EeFuK58OhzxXQhIoMCZAb7OP9iVR64Vl7VWYj7VxP4R/4k77YMIkpDeDl0eQyhlvdwwiyhmMgwM6IfCjwmSx6T0nN7GtXE1lP2cKLWPOoMar2sV7hcki6pnAjipdOP3UbxVA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704353553; 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=uKA673CahNmubDYhvWdzVbSUK9LOujEUSj9LDNa3118=; b=mzr1z1ST8hIzHE12BbT7NB/iPpFT8kyPfa9rgzkQ2TcEQqHYOnJvJHz7ryBIxgt8UCyftSbUJxO9MSrK2xZD+YIM1X36ftn0ye6aXYpRr1YyqvRbqW3lRYmA1DXpgk7p+rU/tIqtmEdAXJn3NovkWu+syR8cR4fNVtCv7qjJ9nI= 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+113138+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 1704353553048298.39700702471487; Wed, 3 Jan 2024 23:32:33 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=YnBqWPlTLJL9Cwspmny2bIt9EKo7eTzdk81PiBNAM9o=; 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=SvhVcAqVPtLYchP+o6KDzf3KsFC8dv7YkwIowS1kppTpl9gZZB+G5Dho7ZPYNuwS/r+BB/lR EkHiWhVn8NnmlImGt7TwpGA0V2miwLe/19k4PeXpvxBbiUCWwxC4EJZ/eprA5nbQCebBT6XL0bF U4sdpKwUkd3TdLVGi0mjKDn8= X-Received: by 127.0.0.2 with SMTP id XJMCYY1788612xPXzQcxKBaO; 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: GH1UL4ZSmOQbn2b5yMHJX5Jzx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704353554440100001 Content-Type: text/plain; charset="utf-8" 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/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..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. =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. @@ -115,6 +117,16 @@ MpInitLibGetProcessorInfo ( ProcessorInfoBuffer->Location.Package =3D 0; ProcessorInfoBuffer->Location.Core =3D 0; ProcessorInfoBuffer->Location.Thread =3D 0; + + if ((ProcessorNumber & CPU_V2_EXTENDED_TOPOLOGY) !=3D 0) { + ProcessorInfoBuffer->ExtendedInformation.Location2.Package =3D 0; + ProcessorInfoBuffer->ExtendedInformation.Location2.Die =3D 0; + ProcessorInfoBuffer->ExtendedInformation.Location2.Tile =3D 0; + ProcessorInfoBuffer->ExtendedInformation.Location2.Module =3D 0; + ProcessorInfoBuffer->ExtendedInformation.Location2.Core =3D 0; + ProcessorInfoBuffer->ExtendedInformation.Location2.Thread =3D 0; + } + if (HealthData !=3D NULL) { GuidHob =3D GetFirstGuidHob (&gEfiSecPlatformInformationPpiGuid); if (GuidHob !=3D NULL) { --=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 (#113138): https://edk2.groups.io/g/devel/message/113138 Mute This Topic: https://groups.io/mt/103518742/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- From nobody Fri May 17 23:25:09 2024 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+113139+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+113139+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1704353555; cv=none; d=zohomail.com; s=zohoarc; b=b6iEdEn3qfNwXUiTAUU+42iXXP0qaMSN0m9Wmap1YvcjVMdEOKy/h9CuIe1Dg/8q38IYOk25P6wfLgUYqRLNDQKRajxdvWsBnI2udA5uxrqSSo4CgJe+DCqC09OPxfMQyIAFUd6+8P7i1Pba/Z/TMecgD3pO0/lByImH/wpH4NQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704353555; 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=d8yMx1C4OLag4SESG/EESUemlCY6H2VK9qDSDJ2u5CU=; b=nfe5WYxdzdPArc6P040rvwYp0xKqcx/RSI0IgFru86Or2kLjcdwxwWy5LzMgMuACgCHJQKXQh5Lph/Vjg0NZoU8aQOwuQFn3VpyqoPzB3SOxwkemJmArNcNtHEcHz+HI4Mfjnb1DixGcsPhjCkCX0Ugh4qmx8llr6Syh8yKeU4I= 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+113139+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 1704353555952897.8308523318115; Wed, 3 Jan 2024 23:32:35 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=DhFnKK2//0NPw3AVypU/mgTFRndlg2w4GHrySC3InSQ=; 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=1704353555; v=1; b=qFbNKps8l9FKcOWqMMJM8GAjSXs/vaKkzwWrI/AAI6fEyODqP6rCUx3ZJKMG4gS8NA1XKu+P 0atSY4ywyz+/iTEJy+ukoninF5jHUZNrRwXcSvceoHwiLt+1/Ha190Cq5WmOlVukZyuPugGM2SW vmQ1FCfNvSbJHjFN0kEppVWA= X-Received: by 127.0.0.2 with SMTP id C0s1YY1788612x65EebCFUBm; Wed, 03 Jan 2024 23:32:35 -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:35 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10942"; a="3961026" X-IronPort-AV: E=Sophos;i="6.04,330,1695711600"; d="scan'208";a="3961026" 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:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10942"; a="850702343" X-IronPort-AV: E=Sophos;i="6.04,330,1695711600"; d="scan'208";a="850702343" 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:33 -0800 From: "duntan" To: devel@edk2.groups.io Cc: Ray Ni , Laszlo Ersek , Rahul Kumar , Gerd Hoffmann , Min Xu Subject: [edk2-devel] [PATCH 2/2] UefiCpuPkg: Check lower 24 bits of ProcessorNumber Date: Thu, 4 Jan 2024 15:32:16 +0800 Message-Id: <20240104073216.1327-3-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: PX9swytwBZDX79wTOVY1E0Nkx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704353556370100005 Content-Type: text/plain; charset="utf-8" Check lower 24 bits of ProcessorNumber instead of the value of ProcessorNumber in the API MpInitLibGetProcessorInfo() of MpInitLibUp instance. Lower 24 bits of ProcessorNumber contains the actual processor number. The BIT24 of input ProcessorNumber might be set to indicate if the EXTENDED_PROCESSOR_INFORMATION will be retrived. Signed-off-by: Dun Tan Cc: Ray Ni Cc: Laszlo Ersek Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Min Xu Reviewed-by: Laszlo Ersek --- UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c b/UefiCpuPkg/Libr= ary/MpInitLibUp/MpInitLibUp.c index 3af4911d4b..b804e400e6 100644 --- a/UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c +++ b/UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c @@ -106,7 +106,10 @@ MpInitLibGetProcessorInfo ( return EFI_INVALID_PARAMETER; } =20 - if (ProcessorNumber !=3D 0) { + // + // Lower 24 bits contains the actual processor number. + // + if ((ProcessorNumber & (CPU_V2_EXTENDED_TOPOLOGY - 1)) !=3D 0) { return EFI_NOT_FOUND; } =20 --=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 (#113139): https://edk2.groups.io/g/devel/message/113139 Mute This Topic: https://groups.io/mt/103518743/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-