From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 A27F721D2E623 for ; Wed, 23 Aug 2017 20:06:18 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Aug 2017 20:08:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,419,1498546800"; d="scan'208";a="143942902" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga006.fm.intel.com with ESMTP; 23 Aug 2017 20:08:52 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 23 Aug 2017 20:08:52 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 23 Aug 2017 20:08:51 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.183]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.219]) with mapi id 14.03.0319.002; Thu, 24 Aug 2017 11:08:50 +0800 From: "Dong, Eric" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" , "Kinney, Michael D" CC: "Ni, Ruiyu" Thread-Topic: [Patch 1/2] UefiCpuPkg/CpuCommonFeaturesLib: Remove redundant definition. Thread-Index: AQHTHGP+TA1y88rLdkmkAamOF+ouTqKS0ubA Date: Thu, 24 Aug 2017 03:08:49 +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: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] 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: Thu, 24 Aug 2017 03:06:18 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Mike, The new check for ProcTraceOutputScheme is for the functionality which is m= issed before. the user selection and hardware capability may not consistent= . So I add this new check. I agree to keep the validate check. Please check the new patch. Thanks, Eric -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Kinn= ey, Michael D Sent: Thursday, August 24, 2017 7:03 AM To: Dong, Eric ; edk2-devel@lists.01.org; Kinney, Mich= ael D Cc: Ni, Ruiyu Subject: Re: [edk2] [Patch 1/2] UefiCpuPkg/CpuCommonFeaturesLib: Remove red= undant definition. 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=20 > > Subject: [Patch 1/2] UefiCpuPkg/CpuCommonFeaturesLib: Remove redundant=20 > definition. >=20 > The EnumProcTraceMemDisable/OutputSchemeInvalid are redundant=20 > definitions. These definitions can be handled by other code, so remove=20 > 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=20 > 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 @@=20 > ProcTraceSupport ( > AsmCpuidEx (CPUID_INTEL_PROCESSOR_TRACE,=20 > 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-=20 > >ProcTraceOutputScheme =3D=3D OutputSchemeToPA)) || > + (ProcTraceData- > >ProcessorData[ProcessorNumber].SingleRangeSupported && > (ProcTraceData->ProcTraceOutputScheme =3D=3D > OutputSchemeSingleRange))) { > return TRUE; > } >=20 > -- > 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel