From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: eric.dong@intel.com) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by groups.io with SMTP; Wed, 03 Apr 2019 23:24:03 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Apr 2019 23:24:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,306,1549958400"; d="scan'208";a="137471337" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga008.fm.intel.com with ESMTP; 03 Apr 2019 23:24:00 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 3 Apr 2019 23:24:00 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 3 Apr 2019 23:24:00 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.206]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.147]) with mapi id 14.03.0415.000; Thu, 4 Apr 2019 14:23:58 +0800 From: eric.dong@intel.com To: "Ni, Ray" , "devel@edk2.groups.io" CC: "Zeng, Star" , "Qin, Zhiqiang" Subject: Re: [PATCH v2 1/2] UefiCpuPkg/Cpuid.h: Remove duplicated struct definition for leaf 1FH Thread-Topic: [PATCH v2 1/2] UefiCpuPkg/Cpuid.h: Remove duplicated struct definition for leaf 1FH Thread-Index: AQHU6qusR4YNat7nSUyb5BbGrARzbKYriItQ Date: Thu, 4 Apr 2019 06:23:58 +0000 Message-ID: References: <20190404060306.168500-1-ray.ni@intel.com> <20190404060306.168500-2-ray.ni@intel.com> In-Reply-To: <20190404060306.168500-2-ray.ni@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: eric.dong@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Eric Dong > -----Original Message----- > From: Ni, Ray > Sent: Thursday, April 4, 2019 2:03 PM > To: devel@edk2.groups.io > Cc: Dong, Eric ; Zeng, Star ; Q= in, > Zhiqiang > Subject: [PATCH v2 1/2] UefiCpuPkg/Cpuid.h: Remove duplicated struct > definition for leaf 1FH >=20 > Per SDM CPUID.0BH and CPUID.1FH outputs the same format of data in > EAX/EBX/ECX/EDX except CPUID.1FH reports more level types such as > module, tile, die. >=20 > The patch removes the unnecessary duplicated structure definitions for > CPUID.1FH because when the structure definitions for CPUID.0BH can be > used for CPUID.1FH. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ray Ni > Cc: Eric Dong > Cc: Star Zeng > Cc: Zhiqiang Qin > --- > UefiCpuPkg/Application/Cpuid/Cpuid.c | 24 ++--- > UefiCpuPkg/Include/Register/Cpuid.h | 126 ++------------------------- > 2 files changed, 20 insertions(+), 130 deletions(-) >=20 > diff --git a/UefiCpuPkg/Application/Cpuid/Cpuid.c > b/UefiCpuPkg/Application/Cpuid/Cpuid.c > index 67cacf2714..d229ac8e7b 100644 > --- a/UefiCpuPkg/Application/Cpuid/Cpuid.c > +++ b/UefiCpuPkg/Application/Cpuid/Cpuid.c > @@ -1,7 +1,7 @@ > /** @file > UEFI Application to display CPUID leaf information. >=20 > - Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
> + Copyright (c) 2016 - 2019, Intel Corporation. All rights > + reserved.
> This program and the accompanying materials > are licensed and made available under the terms and conditions of the = BSD > License > which accompanies this distribution. The full text of the license may= be > found at @@ -1394,26 +1394,26 @@ CpuidV2ExtendedTopologyEnumeration > ( > VOID > ) > { > - CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_EAX Eax; > - CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_EBX Ebx; > - CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_ECX Ecx; > - UINT32 Edx; > + CPUID_EXTENDED_TOPOLOGY_EAX Eax; > + CPUID_EXTENDED_TOPOLOGY_EBX Ebx; > + CPUID_EXTENDED_TOPOLOGY_ECX Ecx; > + UINT32 Edx; >=20 > - if (CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION > > gMaximumBasicFunction) { > + if (CPUID_V2_EXTENDED_TOPOLOGY > gMaximumBasicFunction) { > return; > } >=20 > AsmCpuidEx ( > - CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION, > - CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_MAIN_LEAF, > + CPUID_V2_EXTENDED_TOPOLOGY, > + 0, > &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx > ); > - Print (L"CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION (Leaf %08x, > Sub-Leaf %08x)\n", CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION, > CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_MAIN_LEAF); > + Print (L"CPUID_V2_EXTENDED_TOPOLOGY (Leaf %08x, Sub-Leaf %08x)\n", > + CPUID_V2_EXTENDED_TOPOLOGY, 0); > Print (L" EAX:%08x EBX:%08x ECX:%08x EDX:%08x\n", Eax.Uint32, > Ebx.Uint32, Ecx.Uint32, Edx); >=20 > - PRINT_BIT_FIELD (Eax, BitsNum); > - PRINT_BIT_FIELD (Ebx, ProcessorsNum); > - PRINT_BIT_FIELD (Ecx, LevelNum); > + PRINT_BIT_FIELD (Eax, ApicIdShift); > + PRINT_BIT_FIELD (Ebx, LogicalProcessors); PRINT_BIT_FIELD (Ecx, > + LevelNumber); > PRINT_BIT_FIELD (Ecx, LevelType); > PRINT_VALUE (Edx, x2APICID); > } > diff --git a/UefiCpuPkg/Include/Register/Cpuid.h > b/UefiCpuPkg/Include/Register/Cpuid.h > index fab199b6e2..e0f4f968f4 100644 > --- a/UefiCpuPkg/Include/Register/Cpuid.h > +++ b/UefiCpuPkg/Include/Register/Cpuid.h > @@ -6,7 +6,7 @@ > If a register returned is a single 32-bit value, then a data structure= is > not provided for that register. >=20 > - Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
> + Copyright (c) 2015 - 2019, Intel Corporation. All rights > + reserved.
> This program and the accompanying materials are licensed and made > available under > the terms and conditions of the BSD License which accompanies this > distribution. > The full text of the license may be found at @@ -3620,130 +3620,20 @@ > typedef union { > number of logical processors available to BIOS/OS/Applications may be > different from the > value of EBX[15:0], depending on software and platform hardware > configurations. >=20 > - @param EAX CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION > (0x1F) > - @param ECX > CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_MAIN_LEAF (0x0) > - > -**/ > -#define CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION > 0x1F > - > -/** > - CPUID V2 Extended Topology Enumeration Leaf > - > - @param EAX CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION > (0x1F) > - @param ECX > CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_MAIN_LEAF (0x00) > - > - @retval EAX Returns V2 Extended Topology Enumeration Leaf described > by > - the type CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_EAX. > - @retval EBX Returns V2 Extended Topology Enumeration Leaf described > by > - the type CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_EBX. > - @retval ECX Returns V2 Extended Topology Enumeration Leaf described > by > - the type CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_ECX. > - @retval EDX Returns x2APIC ID the current logical processor. > - > - Example usage > - @code > - CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_EAX Eax; > - CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_EBX Ebx; > - CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_ECX Ecx; > - UINT32 Edx; > - > - AsmCpuidEx ( > - CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION, > - CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_MAIN_LEAF, > - &Eax.Uint32, &Ebx.Uint32, &Ecx.Uint32, &Edx > - ); > - @endcode > -**/ > -#define CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_MAIN_LEAF > 0x00 > - > -/** > - CPUID V2 Extended Topology Enumeration Leaf EAX for CPUID leafs. > -**/ > -typedef union { > - /// > - /// Individual bit fields > - /// > - struct { > - /// > - /// [Bits 4:0] Number of bits to shift right on x2APIC ID to get a u= nique > - /// topology ID of the next level type. All logical processors with = the > - /// same next level ID share current level. > - /// > - UINT32 BitsNum:5; > - /// > - /// [Bits 31:5] Reserved. > - /// > - UINT32 Reserved:27; > - } Bits; > - /// > - /// All bit fields as a 32-bit value > - /// > - UINT32 Uint32; > -} CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_EAX; > - > -/** > - CPUID V2 Extended Topology Enumeration Leaf EBX for CPUID leafs. > -**/ > -typedef union { > - /// > - /// Individual bit fields > - /// > - struct { > - /// > - /// [Bits 15:0] Number of logical processors at this level type. The= number > - /// reflects configuration as shipped by Intel. > - /// > - UINT32 ProcessorsNum:16; > - /// > - /// [Bits 31:5] Reserved. > - /// > - UINT32 Reserved:16; > - } Bits; > - /// > - /// All bit fields as a 32-bit value > - /// > - UINT32 Uint32; > -} CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_EBX; > + @param EAX CPUID_V2_EXTENDED_TOPOLOGY (0x1F) > + @param ECX Level number >=20 > -/** > - CPUID V2 Extended Topology Enumeration Leaf ECX for CPUID leafs. > **/ > -typedef union { > - /// > - /// Individual bit fields > - /// > - struct { > - /// > - /// [Bits 7:0] Level number. Same value in ECX input. > - /// > - UINT32 LevelNum:8; > - /// > - /// [Bits 7:0] Level type. > - /// > - UINT32 LevelType:8; > - > - /// > - /// [Bits 31:5] Reserved. > - /// > - UINT32 Reserved:16; > - } Bits; > - /// > - /// All bit fields as a 32-bit value > - /// > - UINT32 Uint32; > -} CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_ECX; > +#define CPUID_V2_EXTENDED_TOPOLOGY 0= x1F >=20 > /// > -/// @{ Define value for > CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_ECX.LevelType > +/// @{ Define value for CPUID_EXTENDED_TOPOLOGY_ECX.LevelType > /// The value of the "level type" field is not related to level numbers = in /// > any way, higher "level type" values do not mean higher levels. > /// > -#define > CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_LEVEL_TYPE_INVALID > 0x00 > -#define > CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_LEVEL_TYPE_SMT > 0x01 > -#define > CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_LEVEL_TYPE_CORE > 0x02 > -#define > CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_LEVEL_TYPE_MODULE > 0x03 > -#define > CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_LEVEL_TYPE_TILE > 0x04 > -#define > CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION_LEVEL_TYPE_DIE > 0x05 > +#define CPUID_V2_EXTENDED_TOPOLOGY_LEVEL_TYPE_MODULE > 0x03 > +#define CPUID_V2_EXTENDED_TOPOLOGY_LEVEL_TYPE_TILE > 0x04 > +#define CPUID_V2_EXTENDED_TOPOLOGY_LEVEL_TYPE_DIE > 0x05 > /// > /// @} > /// > -- > 2.21.0.windows.1