From: Laszlo Ersek <lersek@redhat.com>
To: Ruiyu Ni <ruiyu.ni@intel.com>, edk2-devel@lists.01.org
Subject: Re: [PATCH 00/10] Use a better algorithm to calculate MTRR
Date: Fri, 31 Mar 2017 11:10:56 +0200 [thread overview]
Message-ID: <4f11fb54-c607-6afe-9f14-15f3255b26d6@redhat.com> (raw)
In-Reply-To: <20170329030346.249872-1-ruiyu.ni@intel.com>
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
next prev parent reply other threads:[~2017-03-31 9:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-29 3:03 [PATCH 00/10] Use a better algorithm to calculate MTRR Ruiyu Ni
2017-03-29 3:03 ` [PATCH 01/10] UefiCpuPkg/MtrrLib: Correct typo in comments and remove TABs Ruiyu Ni
2017-03-29 3:03 ` [PATCH 02/10] UefiCpuPkg/MtrrLib: Add CacheInvalid enum type to MtrrLib.h Ruiyu Ni
2017-03-29 3:03 ` [PATCH 03/10] UefiCpuPkg/MtrrLib: IsMtrrSupported uses definitions in Msr.h Ruiyu Ni
2017-03-29 3:03 ` [PATCH 04/10] UefiCpuPkg/MtrrLib: GetVariableMtrrCountWorker " Ruiyu Ni
2017-03-29 3:03 ` [PATCH 05/10] UefiCpuPkg/MtrrLib: Add MtrrLib prefix to ProgramFixedMtrr Ruiyu Ni
2017-03-29 3:03 ` [PATCH 06/10] UefiCpuPkg/MtrrLib: Add MtrrLib prefix to several internal functions Ruiyu Ni
2017-03-29 3:03 ` [PATCH 07/10] UefiCpuPkg/MtrrLib: MtrrLibInitializeMtrrMask() uses definitions in CpuId.h Ruiyu Ni
2017-03-29 3:03 ` [PATCH 08/10] UefiCpuPkg/MtrrLib: Use a better algorithm to calculate MTRR Ruiyu Ni
2017-03-29 3:03 ` [PATCH 09/10] UefiCpuPkg/MtrrLib: Refine MtrrGetMemoryAttributeByAddressWorker Ruiyu Ni
2017-03-29 3:03 ` [PATCH 10/10] UefiCpuPkg/MtrrLib: All functions use definitions in Msr.h Ruiyu Ni
2017-03-31 5:03 ` [PATCH 00/10] Use a better algorithm to calculate MTRR Fan, Jeff
2017-03-31 9:10 ` Laszlo Ersek [this message]
2017-03-31 14:25 ` Ni, Ruiyu
2017-03-31 15:04 ` Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4f11fb54-c607-6afe-9f14-15f3255b26d6@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox