From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7363B2095DFF5 for ; Wed, 23 Aug 2017 16:00:23 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Aug 2017 16:02:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,417,1498546800"; d="scan'208";a="1209654826" Received: from orsmsx109.amr.corp.intel.com ([10.22.240.7]) by fmsmga002.fm.intel.com with ESMTP; 23 Aug 2017 16:02:56 -0700 Received: from orsmsx114.amr.corp.intel.com (10.22.240.10) by ORSMSX109.amr.corp.intel.com (10.22.240.7) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 23 Aug 2017 16:02:56 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.211]) by ORSMSX114.amr.corp.intel.com ([169.254.8.13]) with mapi id 14.03.0319.002; Wed, 23 Aug 2017 16:02:56 -0700 From: "Kinney, Michael D" To: "Dong, Eric" , "edk2-devel@lists.01.org" , "Kinney, Michael D" CC: "Ni, Ruiyu" Thread-Topic: [Patch 1/2] UefiCpuPkg/CpuCommonFeaturesLib: Remove redundant definition. Thread-Index: AQHTG7fq+JSZfNsb1U23kG59S+3RMaKSj6EA Date: Wed, 23 Aug 2017 23:02:54 +0000 Message-ID: References: <1503455473-14360-1-git-send-email-eric.dong@intel.com> <1503455473-14360-2-git-send-email-eric.dong@intel.com> In-Reply-To: <1503455473-14360-2-git-send-email-eric.dong@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Subject: Re: [Patch 1/2] UefiCpuPkg/CpuCommonFeaturesLib: Remove redundant definition. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Aug 2017 23:00:23 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Eric, Comment below. Mike > -----Original Message----- > From: Dong, Eric > Sent: Tuesday, August 22, 2017 7:31 PM > To: edk2-devel@lists.01.org > Cc: Kinney, Michael D ; Ni, Ruiyu > > Subject: [Patch 1/2] UefiCpuPkg/CpuCommonFeaturesLib: Remove > redundant definition. >=20 > The EnumProcTraceMemDisable/OutputSchemeInvalid are redundant > definitions. These definitions can be handled by other code, > so remove them. >=20 > Cc: Michael Kinney > Cc: Ruiyu Ni > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Eric Dong > --- > UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c | 14 ++++---- > ------ > 1 file changed, 4 insertions(+), 10 deletions(-) >=20 > diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c > b/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c > index a90dd4e..6524882 100644 > --- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c > +++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c > @@ -35,8 +35,7 @@ typedef enum { > Enum16M, > Enum32M, > Enum64M, > - Enum128M, > - EnumProcTraceMemDisable > + Enum128M > } PROC_TRACE_MEM_SIZE; >=20 > /// > @@ -44,8 +43,7 @@ typedef enum { > /// > typedef enum { > OutputSchemeSingleRange =3D 0, > - OutputSchemeToPA, > - OutputSchemeInvalid > + OutputSchemeToPA > } PROC_TRACE_OUTPUT_SCHEME; >=20 > typedef struct { > @@ -134,10 +132,6 @@ ProcTraceSupport ( > // Check if ProcTraceMemorySize option is enabled (0xFF means > disable by user) > // > ProcTraceData =3D (PROC_TRACE_DATA *) ConfigData; > - if ((ProcTraceData->ProcTraceMemSize >=3D > EnumProcTraceMemDisable) || > - (ProcTraceData->ProcTraceOutputScheme >=3D > OutputSchemeInvalid)) { > - return FALSE; > - } I see the ProcTraceOutputScheme values are checked below. Do we need to keep the check for a valid ProcTraceMemSize value? >=20 > // > // Check if Processor Trace is supported > @@ -151,8 +145,8 @@ ProcTraceSupport ( > AsmCpuidEx (CPUID_INTEL_PROCESSOR_TRACE, > CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF, NULL, NULL, &Ecx.Uint32, > NULL); > ProcTraceData->ProcessorData[ProcessorNumber].TopaSupported =3D > (BOOLEAN) (Ecx.Bits.RTIT =3D=3D 1); > ProcTraceData- > >ProcessorData[ProcessorNumber].SingleRangeSupported =3D (BOOLEAN) > (Ecx.Bits.SingleRangeOutput =3D=3D 1); > - if (ProcTraceData->ProcessorData[ProcessorNumber].TopaSupported > || > - ProcTraceData- > >ProcessorData[ProcessorNumber].SingleRangeSupported) { > + if ((ProcTraceData- > >ProcessorData[ProcessorNumber].TopaSupported && (ProcTraceData- > >ProcTraceOutputScheme =3D=3D OutputSchemeToPA)) || > + (ProcTraceData- > >ProcessorData[ProcessorNumber].SingleRangeSupported && > (ProcTraceData->ProcTraceOutputScheme =3D=3D > OutputSchemeSingleRange))) { > return TRUE; > } >=20 > -- > 2.7.0.windows.1