From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 3077820080305 for ; Fri, 31 Mar 2017 07:25:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490970345; x=1522506345; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=lpnWgVnVVmawYHG2KYQ/Lr5cfYa7t9sSn53Y1L5J+qI=; b=s0iCkXyOOM+6qQme8KvJ131qM8AIz5DEPZOVSUWfI7fr4Yit1jDbjub1 emwMa9Px8XFmf385Iq2Vht6gN9XhfQ==; Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Mar 2017 07:25:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,252,1486454400"; d="scan'208";a="1149289692" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga002.fm.intel.com with ESMTP; 31 Mar 2017 07:25:43 -0700 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 31 Mar 2017 07:25:43 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 31 Mar 2017 07:25:43 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.42]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.253]) with mapi id 14.03.0248.002; Fri, 31 Mar 2017 22:25:41 +0800 From: "Ni, Ruiyu" To: Laszlo Ersek , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH 00/10] Use a better algorithm to calculate MTRR Thread-Index: AQHSqDkqQc1aTt63b0aIL6DuzGi+kaGuJtoAgADd/pA= Date: Fri, 31 Mar 2017 14:25:40 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5B8F5666@SHSMSX104.ccr.corp.intel.com> References: <20170329030346.249872-1-ruiyu.ni@intel.com> <4f11fb54-c607-6afe-9f14-15f3255b26d6@redhat.com> In-Reply-To: <4f11fb54-c607-6afe-9f14-15f3255b26d6@redhat.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGM3NDU3MWItY2YzOC00MjIyLWExNDAtNWQ3OTA0NDExZTQzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjQrdDdlYStPblwvY3Q3djFhN1lSc3FyRE1WK25DSnNTU0lvVGl3R3piU0g0PSJ9 x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 00/10] Use a better algorithm to calculate MTRR 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: Fri, 31 Mar 2017 14:25:45 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Just fixed the build failure. sorry about that. Regards, Ray >-----Original Message----- >From: Laszlo Ersek [mailto:lersek@redhat.com] >Sent: Friday, March 31, 2017 5:11 PM >To: Ni, Ruiyu ; edk2-devel@lists.01.org >Subject: Re: [edk2] [PATCH 00/10] Use a better algorithm to calculate MTRR > >On 03/29/17 05:03, Ruiyu Ni wrote: >> The new algorithm finds out the more optimal MTRR solution for >> current memory type settings. >> Compare against the original algorithm, the new one guarantees >> to find the correct MTRR solution, but doesn't guarantee to >> find the most optimal MTRR solution. >> >> Ruiyu Ni (10): >> UefiCpuPkg/MtrrLib: Correct typo in comments and remove TABs >> UefiCpuPkg/MtrrLib: Add CacheInvalid enum type to MtrrLib.h >> UefiCpuPkg/MtrrLib: IsMtrrSupported uses definitions in Msr.h >> UefiCpuPkg/MtrrLib: GetVariableMtrrCountWorker uses definitions in >> Msr.h >> UefiCpuPkg/MtrrLib: Add MtrrLib prefix to ProgramFixedMtrr >> UefiCpuPkg/MtrrLib: Add MtrrLib prefix to several internal functions >> UefiCpuPkg/MtrrLib: MtrrLibInitializeMtrrMask() uses definitions in >> CpuId.h >> UefiCpuPkg/MtrrLib: Use a better algorithm to calculate MTRR >> UefiCpuPkg/MtrrLib: Refine MtrrGetMemoryAttributeByAddressWorker >> UefiCpuPkg/MtrrLib: All functions use definitions in Msr.h >> >> UefiCpuPkg/Include/Library/MtrrLib.h | 17 +- >> UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 1838 ++++++++++++++++++++-------= ------- >> 2 files changed, 1068 insertions(+), 787 deletions(-) >> > >This series seems to trigger a number of build failures with GCC: > >UefiCpuPkg/Library/MtrrLib/MtrrLib.c: In function 'MtrrSetMemoryAttributeW= orker': >UefiCpuPkg/Library/MtrrLib/MtrrLib.c:2051:90: error: suggest parentheses a= round arithmetic in operand of '|' >[-Werror=3Dparentheses] > VariableSettings->Mtrr[Index].Mask =3D (~(OriginalVariableMtrr[In= dex].Length - 1)) & MtrrValidAddressMask | >BIT11; > >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ > >UefiCpuPkg/Library/MtrrLib/MtrrLib.c: In function 'MtrrLibGetMtrrNumber': >UefiCpuPkg/Library/MtrrLib/MtrrLib.c:945:24: error: 'Length' may be used u= ninitialized in this function >[-Werror=3Dmaybe-uninitialized] > LeastRightMtrrNumber =3D MtrrLibGetPositiveMtrrNumber (BaseAddress, Len= gth, Alignment0); > ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~ > >UefiCpuPkg/Library/MtrrLib/MtrrLib.c:927:17: error: 'BaseAddress' may be u= sed uninitialized in this function >[-Werror=3Dmaybe-uninitialized] > BaseAddress +=3D BaseAlignment; > ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ > >UefiCpuPkg/Library/MtrrLib/MtrrLib.c: In function 'MtrrLibSetMemoryType': >UefiCpuPkg/Library/MtrrLib/MtrrLib.c:1430:6: error: 'LengthRight' may be u= sed uninitialized in this function >[-Werror=3Dmaybe-uninitialized] > if (LengthRight =3D=3D 0) { > ^ > >UefiCpuPkg/Library/MtrrLib/MtrrLib.c:1444:31: error: 'LengthLeft' may be u= sed uninitialized in this function >[-Werror=3Dmaybe-uninitialized] > Ranges[StartIndex].Length =3D LengthLeft; > ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ > >UefiCpuPkg/Library/MtrrLib/MtrrLib.c: In function 'MtrrSetMemoryAttributeW= orker': >UefiCpuPkg/Library/MtrrLib/MtrrLib.c:2085:3: error: 'OriginalVariableMtrrC= ount' may be used uninitialized in this function >[-Werror=3Dmaybe-uninitialized] > for (Index =3D 0; Index < OriginalVariableMtrrCount; Index++) { > ^~~ > >UefiCpuPkg/Library/MtrrLib/MtrrLib.c:1833:30: error: 'VariableSettings' ma= y be used uninitialized in this function >[-Werror=3Dmaybe-uninitialized] > MTRR_VARIABLE_SETTINGS *VariableSettings; > ^~~~~~~~~~~~~~~~ > >UefiCpuPkg/Library/MtrrLib/MtrrLib.c:2105:10: error: 'Status' may be used = uninitialized in this function >[-Werror=3Dmaybe-uninitialized] > return Status; > ^~~~~~ >cc1: all warnings being treated as errors >GNUmakefile:328: recipe for target >'Build/OvmfIa32/DEBUG_GCC49/IA32/UefiCpuPkg/Library/MtrrLib/MtrrLib/OUTPUT= /MtrrLib.obj' failed >make: *** [Build/OvmfIa32/DEBUG_GCC49/IA32/UefiCpuPkg/Library/MtrrLib/Mtrr= Lib/OUTPUT/MtrrLib.obj] Error 1 > >Thanks >Laszlo