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 4F26A74003A for ; Mon, 1 Apr 2024 07:45:30 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=9OXsC3HbwQZBIPNs0C5JzTmd/pzugUuvGW4vs1Jv5zk=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type; s=20240206; t=1711957529; v=1; b=AzdjcpU3LLvmGgtOw3/OxqMMJE+rRHQNOgPedwi9c/VQS/o/vKX/mE4oPKVD3Tk2ezvWObHt eOJOUmyVkSHpxynelrbAuM6p+sEbAI1BeXXA44/wWwCpM/NK+ni5GYBDLlOGRGHwVdqYm8SXs4l D61hOoHMx2haXj/OBlCuK/jwKNz/LVeEaJM04El/her3r9o/G4ewEU9/7UxVJIcR9qEg+vW2p48 PRMdPKOB7llhK9Ehr0fPweEVokdzUuxD6FZwCplYu1+wZt+dVMZQvVDniW5/lZ/Tv8bA5voL3f/ cNJRteb4fwUTWfXbYOBEhZXhEMvOkagY3TzvqCzbHHKDg== X-Received: by 127.0.0.2 with SMTP id UfsdYY7687511xeXRu5yL8Gv; Mon, 01 Apr 2024 00:45:29 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by mx.groups.io with SMTP id smtpd.web11.32554.1711957528428993181 for ; Mon, 01 Apr 2024 00:45:28 -0700 X-CSE-ConnectionGUID: 6JZyBDyIT9S3GnIRtC5gkw== X-CSE-MsgGUID: XV7pS8pIQUCvOPr7eWnKow== X-IronPort-AV: E=McAfee;i="6600,9927,11030"; a="6939077" X-IronPort-AV: E=Sophos;i="6.07,171,1708416000"; d="scan'208,217";a="6939077" X-Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2024 00:45:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,171,1708416000"; d="scan'208,217";a="55111897" X-Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orviesa001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 01 Apr 2024 00:45:28 -0700 X-Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) 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; Mon, 1 Apr 2024 00:45:27 -0700 X-Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 1 Apr 2024 00:45:26 -0700 X-Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 1 Apr 2024 00:45:26 -0700 X-Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.41) 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; Mon, 1 Apr 2024 00:45:26 -0700 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by DS7PR11MB7836.namprd11.prod.outlook.com (2603:10b6:8:e3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.24; Mon, 1 Apr 2024 07:45:25 +0000 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::2c31:82b7:9f26:5817]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::2c31:82b7:9f26:5817%5]) with mapi id 15.20.7409.031; Mon, 1 Apr 2024 07:45:24 +0000 From: "Ni, Ray" To: "Tan, Dun" , "devel@edk2.groups.io" CC: "Lou, Yun" , "Chiu, Chasel" , "Desimone, Nathaniel L" , Liming Gao , "Dong, Eric" Subject: Re: [edk2-devel] [edk2-platforms V2 2/3] MinPlatformPkg: Get CoreType for all cores Thread-Topic: [edk2-platforms V2 2/3] MinPlatformPkg: Get CoreType for all cores Thread-Index: AQHag/p64HzPIVqTGk2EPn4EsZlmALFTCRmL Date: Mon, 1 Apr 2024 07:45:24 +0000 Message-ID: References: <20240401060411.899-1-dun.tan@intel.com> <20240401060411.899-3-dun.tan@intel.com> In-Reply-To: <20240401060411.899-3-dun.tan@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|DS7PR11MB7836:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: t6nA6DoSpGPMbSSWIiHfLaoRm9BgCOBqtqpm2IPkhRL0cGXzWbUxqzJlLIEm1PQkllaoFZWGcRormo4McGV8L1fttynYw7AKErghM6pjoks5trFXgIYUVlLUdnZQhz2Q3maHuB2rmvUkXv5hm294T8L6qpNE+XxPhrg1krkUHGb1kJHCKHoBLpClUN46cc4viQtA437TnAqbnfNUYTkhfaiCVhXqqY1UFa6hs2y6JuOjJYPEpRUqEt5x4CDDdtF8aNXz+4NNXa5dZ9CvuXJGKmLeLJeQjEZVubcEYrAmhpyt7VycufacQRVR4abppN+awMELPTWRCZlSFX8uOBRQQojCNZeg97m7yhmjx0pSmrpRH1PPSlLCdAbeGi8UoOxzLdutEAzLDzfFTcVKdTQZfcUI5fkvEMTefNX2nWqjyWOOUqEK6o/FDNqn+ZSLAWeRNYcE3gKTWMVueAELJVSERV59teR1fj8tEFN4t0nrcTI2lE5PO4iLrlPTCuoSzd+j30QL33nRRigsaHd1AWjoenG76JjDBUeyxf7hQeTaqw09EviF4b97weUaXN4GzI5tMq+l7Qfxoi9KVmaN4BWzZrDs6OmWy30lm00Ac9ss40vPX4+HSkuxuy67XPTWE9cbS/uY3mgXvqbnY1m9h/cOwrthQoa5RpXy+dq0wz0INJQ= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?krTx8toWg3WOiB3MIrZ/8uEzOqEST9kRrxqACV0PO3tIUX0NREOTqgBrgXjw?= =?us-ascii?Q?b5bNR98Uh57V7V/DjtGsXG85AcKXOM133jwcHU29T58PTFOhKh/uGACFLejI?= =?us-ascii?Q?F0yHw9dmmaMemruWRFSf8ZiYLC26daxBez0BGZ0UX4xpJa62aj6kQmEmj/8B?= =?us-ascii?Q?zBDjaViMuz4/yf+EOapCZmM+XRImqvq6m6K0FSwf5tNhRTBYEk+ReikPz43s?= =?us-ascii?Q?T8I2R6acii2weTOS5Vv1rgeuvM2gylvCD6s3WVo9BmNG6iurMWzUWLg3CXR/?= =?us-ascii?Q?khI7S2NPRm89h4Yf1ShJR6wUUzBtiyMys1Q8BWzdW43Xt3a7dCa86ljjzuIW?= =?us-ascii?Q?Svi1wbhJmfoUIsQSL3gvgvZJKn7qWV3ozaIifZxeq37z2tOHNXEtpVS8Q+LP?= =?us-ascii?Q?XaOy0Pf4DTUGzyGk6DS0FH/KE8q8YhUKNO/ZVijK2ehOm+hG/qujGAl4OarG?= =?us-ascii?Q?8gQtadu9PANn8/m9TbDvIDYeY407X6Xj8+fHJKSI5NgAMRustjw+mq6ooAM3?= =?us-ascii?Q?a/WE8jcy8CmMVkUMioyyLi49SKqJ5Ge5jbtdB+fa1P+b3zC7pQP8h8rQ9Zl/?= =?us-ascii?Q?TVaiVf/ltHZoibeheSa+wDONJc3H7Bxu7npEIux4DrEf5W5lkcKAQMbpgvUT?= =?us-ascii?Q?TLTSCuIO+N0vsQNoo8UA/S9ZWMTudPSZySKNnPtFe55N9QMZ4wvkCY23khjw?= =?us-ascii?Q?nE84cK+KozobvaE5MDhMTacrmFUeQwi7YhW67d6jdowNLVCaD3bQQJ8xj2t1?= =?us-ascii?Q?1EUZu2nD7I5He8dlRe2JVj2R3iMgfns273AUdysKwSem1JU+/kKec4jnk4OL?= =?us-ascii?Q?rDb+VHEj1Zijc9UcDuPHefohB2HRjaRnTE1RMK4EO/EhZlJO82Bl60BvL0d7?= =?us-ascii?Q?wX2PzsxJq2MlHr3uRBadKcAa0nZxNxdDelERwe2wk7tDtc7Z1DLG52cOBnND?= =?us-ascii?Q?Nw+2CW8iVCoFAk6ClJB1s2x+qhzf0tiPstbcbD3I63b3e16FaJJw2fBcuV58?= =?us-ascii?Q?LNsNIc9vMF4EJMKkpu+whXN/Ke1rSKAXlbyjSwsQrECD9wwpdzz+elJJWRo7?= =?us-ascii?Q?xVGWGFaUaxpQtkxzZSV8hB5CD37tv4r1QhiFbYkbVZx5Mn3nur9RaqyF1rJp?= =?us-ascii?Q?SfdwVzVIc+vAnXiuuGir0692g0a86MJ9Zg9tdWuTyCXPPAbyD70nlUuETqni?= =?us-ascii?Q?m7Z0ewaPwmdBFDgUms+n0Ok/UVRr1y84tC58mxrLl973GoXyGEgNdweBpSHC?= =?us-ascii?Q?0lD5s6a6GNG2gU5ufBsEWTG5AidYeJaAxJX/YeP/oQo7c6yaME73CXd4Merz?= =?us-ascii?Q?98uq9Xx3DcWtiyW0cWl+LViDvC5KsEKH4vmb/cS0u2v1qPy/o4tdP7JSaX1Q?= =?us-ascii?Q?poN6IsDRduduq2a3kj8bKdRvlU/wKJD7ojrkKerhts8ApiJQf/yDZk6NlruL?= =?us-ascii?Q?Da1B2ZfWNwACtq4RO1s9FxtxO1v0Cd4/+VQZ/DODaGCBwwa4CsOq2kLqkECc?= =?us-ascii?Q?ksUQGTTJViQI6TqShhyjYjgPQXgmeojy5ya4Hz3tgM8Amui73WKMBpGYqzRd?= =?us-ascii?Q?OhY0pY+zoALwstqX77E=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a8ad873-153b-4b81-d6f0-08dc521fb126 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2024 07:45:24.8911 (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: eJnO3Dnh2XP9LMKMoT7/SnVB8xL429GEswm3VI8C1UHZBQzO82Cfhtx5cAqI/rODNX0MUdx1vpT3fK+JS/nm0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR11MB7836 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 Resent-Date: Mon, 01 Apr 2024 00:45:28 -0700 Reply-To: devel@edk2.groups.io,ray.ni@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: NVyEMdtct6dHR7gj6yBzPJdWx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MN6PR11MB8244D157CA3172268D4E49318C3F2MN6PR11MB8244namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=AzdjcpU3; 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 --_000_MN6PR11MB8244D157CA3172268D4E49318C3F2MN6PR11MB8244namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni Thanks, Ray ________________________________ From: Tan, Dun Sent: Monday, April 1, 2024 14:04 To: devel@edk2.groups.io Cc: Ni, Ray ; Lou, Yun ; Chiu, Chasel = ; Desimone, Nathaniel L ; Liming Gao ; Dong, Eric Subject: [edk2-platforms V2 2/3] MinPlatformPkg: Get CoreType for all cores Add a new field CoreType in EFI_CPU_ID_ORDER_MAP and get CoreType for all cores. Signed-off-by: Dun Tan Cc: Ray Ni Cc: Jason Lou Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Cc: Eric Dong --- Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 50 ++++++++= ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c b= /Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c index 62a7da290a..1fa70e3df9 100644 --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c @@ -18,6 +18,7 @@ typedef struct { UINT32 Flags; UINT32 SocketNum; UINT32 Thread; + UINT8 CoreType; } EFI_CPU_ID_ORDER_MAP; // @@ -71,15 +72,16 @@ DebugDisplayReOrderTable ( { UINT32 Index; - DEBUG ((DEBUG_INFO, "Index AcpiProcId ApicId Thread Flags Skt\n")= ); + DEBUG ((DEBUG_INFO, "Index AcpiProcId ApicId Thread Flags Skt Co= reType\n")); for (Index =3D 0; Index < mNumberOfCpus; Index++) { - DEBUG ((DEBUG_INFO, " %02d 0x%02X 0x%02X %d %d = %d\n", + DEBUG ((DEBUG_INFO, " %02d 0x%02X 0x%02X %d %d = %d 0x%x\n", Index, CpuApicIdOrderTable[Index].AcpiProcessorUid, CpuApicIdOrderTable[Index].ApicId, CpuApicIdOrderTable[Index].Thread, CpuApicIdOrderTable[Index].Flags, - CpuApicIdOrderTable[Index].SocketNum)); + CpuApicIdOrderTable[Index].SocketNum, + CpuApicIdOrderTable[Index].CoreType)); } } @@ -130,6 +132,31 @@ AppendCpuMapTableEntry ( } +/** + Get CPU core type. + + @param[in] CpuApicIdOrderTable Point to a buffer which will be f= illed in Core type information. +**/ +VOID +EFIAPI +CollectCpuCoreType ( + IN EFI_CPU_ID_ORDER_MAP *CpuApicIdOrderTable + ) +{ + UINTN ApNumber; + EFI_STATUS Status; + CPUID_NATIVE_MODEL_ID_AND_CORE_TYPE_EAX NativeModelIdAndCoreTypeEax; + + Status =3D mMpService->WhoAmI ( + mMpService, + &ApNumber + ); + ASSERT_EFI_ERROR (Status); + + AsmCpuidEx (CPUID_HYBRID_INFORMATION, CPUID_HYBRID_INFORMATION_MAIN_LEAF= , &NativeModelIdAndCoreTypeEax.Uint32, NULL, NULL, NULL); + CpuApicIdOrderTable[ApNumber].CoreType =3D (UINT8)NativeModelIdAndCoreTy= peEax.Bits.CoreType; +} + /** Collect all processors information and create a Cpu Apic Id table. @@ -146,8 +173,23 @@ CreateCpuLocalApicInTable ( UINT32 CurrProcessor; EFI_CPU_ID_ORDER_MAP *CpuIdMapPtr; UINT32 Socket; + UINT32 CpuidMaxInput; - Status =3D EFI_SUCCESS; + Status =3D EFI_SUCCESS; + + AsmCpuid (CPUID_SIGNATURE, &CpuidMaxInput, NULL, NULL, NULL); + if (CpuidMaxInput >=3D CPUID_HYBRID_INFORMATION) { + CollectCpuCoreType (CpuApicIdOrderTable); + mMpService->StartupAllAPs ( + mMpService, // This + (EFI_AP_PROCEDURE) CollectCpuCoreType, // Procedure + TRUE, // SingleThrea= d + NULL, // WaitEvent + 0, // TimeoutInMi= crosecsond + CpuApicIdOrderTable, // ProcedureAr= gument + NULL // FailedCpuLi= st + ); + } for (CurrProcessor =3D 0, Index =3D 0; CurrProcessor < mNumberOfCpus; Cu= rrProcessor++, Index++) { Status =3D mMpService->GetProcessorInfo ( -- 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 (#117284): https://edk2.groups.io/g/devel/message/117284 Mute This Topic: https://groups.io/mt/105259124/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- --_000_MN6PR11MB8244D157CA3172268D4E49318C3F2MN6PR11MB8244namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Reviewed-by: Ray Ni <ray.ni@intel.com>



Thanks,
Ray

From: Tan, Dun <dun.tan@= intel.com>
Sent: Monday, April 1, 2024 14:04
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Ni, Ray <ray.ni@intel.com>; Lou, Yun <yun.lou@intel.com= >; Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L <= ;nathaniel.l.desimone@intel.com>; Liming Gao <gaoliming@byosoft.com.c= n>; Dong, Eric <eric.dong@intel.com>
Subject: [edk2-platforms V2 2/3] MinPlatformPkg: Get CoreType for al= l cores
 
Add a new field CoreType in EFI_CPU_ID_ORDER_MAP and get CoreType for all cores.

Signed-off-by: Dun Tan <dun.tan@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jason Lou <yun.lou@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
---
 Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 50 +++= +++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 46 insertions(+), 4 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c b= /Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
index 62a7da290a..1fa70e3df9 100644
--- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
+++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
@@ -18,6 +18,7 @@ typedef struct {
   UINT32   Flags;
   UINT32   SocketNum;
   UINT32   Thread;
+  UINT8    CoreType;
 } EFI_CPU_ID_ORDER_MAP;
 
 //
@@ -71,15 +72,16 @@ DebugDisplayReOrderTable (
 {
   UINT32 Index;
 
-  DEBUG ((DEBUG_INFO, "Index  AcpiProcId  ApicId =   Thread  Flags   Skt\n"));
+  DEBUG ((DEBUG_INFO, "Index  AcpiProcId  ApicId =   Thread  Flags   Skt  CoreType\n"));
   for (Index =3D 0; Index < mNumberOfCpus; Index++) {
-    DEBUG ((DEBUG_INFO, " %02d    =    0x%02X      0x%02X   &= nbsp;   %d      %d   &nbs= p;  %d\n",
+    DEBUG ((DEBUG_INFO, " %02d    =    0x%02X      0x%02X   &= nbsp;   %d      %d   &nbs= p;  %d      0x%x\n",
            &nb= sp;            =    Index,
            &nb= sp;            =    CpuApicIdOrderTable[Index].AcpiProcessorUid,
            &nb= sp;            =    CpuApicIdOrderTable[Index].ApicId,
            &nb= sp;            =    CpuApicIdOrderTable[Index].Thread,
            &nb= sp;            =    CpuApicIdOrderTable[Index].Flags,
-            &n= bsp;            = ;  CpuApicIdOrderTable[Index].SocketNum));
+            &n= bsp;            = ;  CpuApicIdOrderTable[Index].SocketNum,
+            &n= bsp;            = ;  CpuApicIdOrderTable[Index].CoreType));
   }
 }
 
@@ -130,6 +132,31 @@ AppendCpuMapTableEntry (
 
 }
 
+/**
+  Get CPU core type.
+
+  @param[in] CpuApicIdOrderTable      &= nbsp;  Point to a buffer which will be filled in Core type information= .
+**/
+VOID
+EFIAPI
+CollectCpuCoreType (
+  IN EFI_CPU_ID_ORDER_MAP  *CpuApicIdOrderTable
+  )
+{
+  UINTN          &n= bsp;            = ;             A= pNumber;
+  EFI_STATUS         &nb= sp;            =          Status;
+  CPUID_NATIVE_MODEL_ID_AND_CORE_TYPE_EAX  NativeModelIdAndCoreT= ypeEax;
+
+  Status =3D mMpService->WhoAmI (
+            &n= bsp;            mMpS= ervice,
+            &n= bsp;            &= ;ApNumber
+            &n= bsp;            ); +  ASSERT_EFI_ERROR (Status);
+
+  AsmCpuidEx (CPUID_HYBRID_INFORMATION, CPUID_HYBRID_INFORMATION_MAIN= _LEAF, &NativeModelIdAndCoreTypeEax.Uint32, NULL, NULL, NULL);
+  CpuApicIdOrderTable[ApNumber].CoreType =3D (UINT8)NativeModelIdAndC= oreTypeEax.Bits.CoreType;
+}
+
 /**
   Collect all processors information and create a Cpu Apic Id ta= ble.
 
@@ -146,8 +173,23 @@ CreateCpuLocalApicInTable (
   UINT32         &n= bsp;            = ;            &n= bsp; CurrProcessor;
   EFI_CPU_ID_ORDER_MAP       =             &nb= sp;  *CpuIdMapPtr;
   UINT32         &n= bsp;            = ;            &n= bsp; Socket;
+  UINT32          &= nbsp;           &nbs= p;             = CpuidMaxInput;
 
-  Status     =3D EFI_SUCCESS;
+  Status =3D EFI_SUCCESS;
+
+  AsmCpuid (CPUID_SIGNATURE, &CpuidMaxInput, NULL, NULL, NULL); +  if (CpuidMaxInput >=3D CPUID_HYBRID_INFORMATION) {
+    CollectCpuCoreType (CpuApicIdOrderTable);
+    mMpService->StartupAllAPs (
+            &n= bsp;     mMpService,      = ;            &n= bsp;            // T= his
+            &n= bsp;     (EFI_AP_PROCEDURE) CollectCpuCoreType, &n= bsp;  // Procedure
+            &n= bsp;     TRUE,       = ;            &n= bsp;            = ;     // SingleThread
+            &n= bsp;     NULL,       = ;            &n= bsp;            = ;     // WaitEvent
+            &n= bsp;     0,       &n= bsp;            = ;            &n= bsp;       // TimeoutInMicrosecsond
+            &n= bsp;     CpuApicIdOrderTable,    &n= bsp;            = ;     // ProcedureArgument
+            &n= bsp;     NULL       =             &nb= sp;            =       // FailedCpuList
+            &n= bsp;     );
+  }
 
   for (CurrProcessor =3D 0, Index =3D 0; CurrProcessor < mNum= berOfCpus; CurrProcessor++, Index++) {
     Status =3D mMpService->GetProcessorInfo (
--
2.31.1.windows.1

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#117284) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_MN6PR11MB8244D157CA3172268D4E49318C3F2MN6PR11MB8244namp_--