From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 E26BF21A04802 for ; Fri, 31 Mar 2017 08:05:01 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0FC37C05B1CE; Fri, 31 Mar 2017 15:05:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0FC37C05B1CE Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0FC37C05B1CE Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-153.phx2.redhat.com [10.3.116.153]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1059881872; Fri, 31 Mar 2017 15:04:59 +0000 (UTC) To: "Ni, Ruiyu" , "edk2-devel@lists.01.org" References: <20170329030346.249872-1-ruiyu.ni@intel.com> <4f11fb54-c607-6afe-9f14-15f3255b26d6@redhat.com> <734D49CCEBEEF84792F5B80ED585239D5B8F5666@SHSMSX104.ccr.corp.intel.com> From: Laszlo Ersek Message-ID: <070186a9-ef97-dbf2-fe04-774d3fb381d6@redhat.com> Date: Fri, 31 Mar 2017 17:04:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5B8F5666@SHSMSX104.ccr.corp.intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 31 Mar 2017 15:05:01 +0000 (UTC) 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 15:05:02 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 03/31/17 16:25, Ni, Ruiyu wrote: > Just fixed the build failure. sorry about that. No problem -- I wasn't annoyed or anything (such breakages are unavoidable without a centralized build farm, as no developer can test-build the tree with all the supported toolchains), I just wanted to report it. Thank you for the prompt action! Laszlo >> -----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 'MtrrSetMemoryAttributeWorker': >> UefiCpuPkg/Library/MtrrLib/MtrrLib.c:2051:90: error: suggest parentheses around arithmetic in operand of '|' >> [-Werror=parentheses] >> VariableSettings->Mtrr[Index].Mask = (~(OriginalVariableMtrr[Index].Length - 1)) & MtrrValidAddressMask | >> BIT11; >> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ >> >> UefiCpuPkg/Library/MtrrLib/MtrrLib.c: In function 'MtrrLibGetMtrrNumber': >> UefiCpuPkg/Library/MtrrLib/MtrrLib.c:945:24: error: 'Length' may be used uninitialized in this function >> [-Werror=maybe-uninitialized] >> LeastRightMtrrNumber = MtrrLibGetPositiveMtrrNumber (BaseAddress, Length, Alignment0); >> ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> UefiCpuPkg/Library/MtrrLib/MtrrLib.c:927:17: error: 'BaseAddress' may be used uninitialized in this function >> [-Werror=maybe-uninitialized] >> BaseAddress += BaseAlignment; >> ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ >> >> UefiCpuPkg/Library/MtrrLib/MtrrLib.c: In function 'MtrrLibSetMemoryType': >> UefiCpuPkg/Library/MtrrLib/MtrrLib.c:1430:6: error: 'LengthRight' may be used uninitialized in this function >> [-Werror=maybe-uninitialized] >> if (LengthRight == 0) { >> ^ >> >> UefiCpuPkg/Library/MtrrLib/MtrrLib.c:1444:31: error: 'LengthLeft' may be used uninitialized in this function >> [-Werror=maybe-uninitialized] >> Ranges[StartIndex].Length = LengthLeft; >> ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ >> >> UefiCpuPkg/Library/MtrrLib/MtrrLib.c: In function 'MtrrSetMemoryAttributeWorker': >> UefiCpuPkg/Library/MtrrLib/MtrrLib.c:2085:3: error: 'OriginalVariableMtrrCount' may be used uninitialized in this function >> [-Werror=maybe-uninitialized] >> for (Index = 0; Index < OriginalVariableMtrrCount; Index++) { >> ^~~ >> >> UefiCpuPkg/Library/MtrrLib/MtrrLib.c:1833:30: error: 'VariableSettings' may be used uninitialized in this function >> [-Werror=maybe-uninitialized] >> MTRR_VARIABLE_SETTINGS *VariableSettings; >> ^~~~~~~~~~~~~~~~ >> >> UefiCpuPkg/Library/MtrrLib/MtrrLib.c:2105:10: error: 'Status' may be used uninitialized in this function >> [-Werror=maybe-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/MtrrLib/OUTPUT/MtrrLib.obj] Error 1 >> >> Thanks >> Laszlo