Re: [edk2] Query about variable initialization

2018-06-20 Thread Laszlo Ersek
On 06/20/18 20:03, Ard Biesheuvel wrote: > On 20 June 2018 at 19:48, Evan Lloyd wrote: >> Hi Ard, Leif. >> I've noticed a number of comments like Ard's recent "We don't permit >> initialized automatic variables.", >> and similar changes have been made to Sami's AcpiView. Note: I'm not >>

Re: [edk2] Query about variable initialization

2018-06-20 Thread Andrew Fish
> On Jun 20, 2018, at 12:01 PM, Ard Biesheuvel > wrote: > > On 20 June 2018 at 20:57, Laszlo Ersek > wrote: >> On 06/20/18 20:03, Ard Biesheuvel wrote: >>> On 20 June 2018 at 19:48, Evan Lloyd wrote: Hi Ard, Leif. I've noticed a number of comments like

[edk2] [PATCH v1 08/11] BaseTools: refactor to change object types

2018-06-20 Thread Jaben Carsey
change to object types that are closer to use case. for example: when using a list as a double ended queue, use the built in object. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey ---

[edk2] [PATCH v1 07/11] BaseTools: refactor file opening/writing

2018-06-20 Thread Jaben Carsey
change mode minimal needed permissions change to use with statement Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 57 -

[edk2] [PATCH v1 09/11] BaseTools: refactor to stop re-allocating strings

2018-06-20 Thread Jaben Carsey
strings are immutable. allocate minimal duplication. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 30 BaseTools/Source/Python/AutoGen/GenC.py

[edk2] [PATCH v1 11/11] BaseTools: remove extra assignment

2018-06-20 Thread Jaben Carsey
there is no use to assign back to a variable. just return the result. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/Expression.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)

[edk2] [PATCH v1 04/11] BaseTools: remove repeated calls to startswith/endswith

2018-06-20 Thread Jaben Carsey
As both can take a tuple, use that instead of calling repeatedly. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/GenMake.py | 2 +-

[edk2] [PATCH v1 05/11] BaseTools: use set presence instead of series of equality

2018-06-20 Thread Jaben Carsey
Instead of testing each equality individually, just make a set and test once. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Ecc/Configuration.py | 10 +- 1 file changed, 1 insertion(+), 9

[edk2] [PATCH v1 06/11] BaseTools: refactor section generation

2018-06-20 Thread Jaben Carsey
use with for opening files remove unneeded variables dont seek to 0 for just opened file Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/DataType.py | 1 +

[edk2] [PATCH v1 02/11] BaseTools: Workspace - create a base class

2018-06-20 Thread Jaben Carsey
refactor 3 classes and create a new base class for their shared functions. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Workspace/BuildClassObject.py | 140 +++- 1 file changed,

[edk2] [PATCH v1 03/11] BaseTools: remove unused code

2018-06-20 Thread Jaben Carsey
delete commented out code delete never used class/variable/function/import refactor to remove Ffs class dont construct class just for class attribute Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey ---

[edk2] [PATCH v2 00/11] BaseTools Refactoring

2018-06-20 Thread Jaben Carsey
This patch cleans up BaseTools. On classes that are not instantiated and are deisgned as purely base classes, they get marked using the abstract base class to prevent instantiation. This prevents future errors. Create a new shared base class to centralize some code that was identical in multiple

[edk2] [PATCH v1 01/11] BaseTools: decorate base classes to prevent instantiation

2018-06-20 Thread Jaben Carsey
use python's ABC (abstract base class) to raise type errors if we instantiate classes we designed to be used only as base classes for other classes. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey ---

Re: [edk2] [PATCH] ArmPkg/ArmMmuLib ARM: remove cache maintenance of block mapping contents

2018-06-20 Thread Leif Lindholm
On Wed, Jun 20, 2018 at 09:10:07PM +0200, Ard Biesheuvel wrote: > Peculiarly enough, the current page table manipulation code takes it > upon itself to write back and invalidate the memory contents covered > by section mappings when their memory attributes change. It is not > generally the case

Re: [edk2] Query about variable initialization

2018-06-20 Thread Ard Biesheuvel
On 20 June 2018 at 20:57, Laszlo Ersek wrote: > On 06/20/18 20:03, Ard Biesheuvel wrote: >> On 20 June 2018 at 19:48, Evan Lloyd wrote: >>> Hi Ard, Leif. >>> I've noticed a number of comments like Ard's recent "We don't permit >>> initialized automatic variables.", >>> and similar changes have

Re: [edk2] [PATCH] ArmPkg/ArmMmuLib ARM: fix Mva to use idx instead of table base

2018-06-20 Thread Ard Biesheuvel
On 19 June 2018 at 22:52, Chris Co wrote: > Hi, > > Just checking if there is anything needed on my end to get this patch merged > in. > Well, the patch looks obviously correct, but I just tested it and it breaks ArmVirtQemu running in 32-bit mode. I will investigate >> -Original

[edk2] Is the PEI Core MP Safe? UefiCpuPkg seems to think so calling GetFirstGuidHob on the APs?

2018-06-20 Thread Andrew Fish
Is there some MP safe contract with the PEI Core implementation I don't know about? Looks like the APs are calling PeiServicesGetHobList() to figure out "who they are"? How does this work? Or am I missing something?

Re: [edk2] Query about variable initialization

2018-06-20 Thread Ard Biesheuvel
On 20 June 2018 at 19:48, Evan Lloyd wrote: > Hi Ard, Leif. > I've noticed a number of comments like Ard's recent "We don't permit > initialized automatic variables.", > and similar changes have been made to Sami's AcpiView. Note: I'm not > objecting to doing it the way maintainers prefer,

Re: [edk2] [PATCH] ArmPkg/ArmMmuLib ARM: fix Mva to use idx instead of table base

2018-06-20 Thread Ard Biesheuvel
On 20 June 2018 at 18:39, Ard Biesheuvel wrote: > On 19 June 2018 at 22:52, Chris Co wrote: >> Hi, >> >> Just checking if there is anything needed on my end to get this patch merged >> in. >> > > Well, the patch looks obviously correct, but I just tested it and it > breaks ArmVirtQemu running

[edk2] [PATCH] ArmPkg/ArmMmuLib ARM: remove cache maintenance of block mapping contents

2018-06-20 Thread Ard Biesheuvel
Peculiarly enough, the current page table manipulation code takes it upon itself to write back and invalidate the memory contents covered by section mappings when their memory attributes change. It is not generally the case that data must be written back when such a change occurs, even when

Re: [edk2] [PATCH v2] Silicon/NXP/Pcf8563RealTimeClockLib: add Voltage-low handling

2018-06-20 Thread Masahisa Kojima
Hi Ard, Yes, you are correct. I will send update patch. Thank you. On Wed, 20 Jun 2018 at 15:21, Ard Biesheuvel wrote: > > On 20 June 2018 at 05:02, wrote: > > From: Masahisa Kojima > > > > BcdToDecimal8() in LibGetTime() asserts with the > > following condition. > > 1) RTC device has not

[edk2] [PATCH v3] Silicon/NXP/Pcf8563RealTimeClockLib: add Voltage-low handling

2018-06-20 Thread masahisa . kojima
From: Masahisa Kojima BcdToDecimal8() in LibGetTime() asserts with the following condition. 1) RTC device has not been initialized yet, RTC device returns indeterminate value with VL bit(1) 2) DEBUG build UEFI boot fails with assertion when it satisfies above conditions. Aside form boot

Re: [edk2] [PATCH v2 00/20] BaseTools: One step toward python3

2018-06-20 Thread Zhu, Yonghong
Hi Paolo and Gary, The patches are good and helpful. But it is out of date, so could you help to recreate the patches ? Best Regards, Zhu Yonghong -Original Message- From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Paolo Bonzini Sent: Wednesday, June 20, 2018

Re: [edk2] [PATCH v2] Silicon/NXP/Pcf8563RealTimeClockLib: add Voltage-low handling

2018-06-20 Thread Ard Biesheuvel
On 20 June 2018 at 05:02, wrote: > From: Masahisa Kojima > > BcdToDecimal8() in LibGetTime() asserts with the > following condition. > 1) RTC device has not been initialized yet, RTC device > returns indeterminate value with VL bit(1) > 2) DEBUG build > > UEFI boot fails with assertion

Re: [edk2] [PATCH v2 00/20] BaseTools: One step toward python3

2018-06-20 Thread Paolo Bonzini
On 01/02/2018 09:35, Gary Lin wrote: > v2 changes: > - Rebase to the current git HEAD (821807bcefb9a36e598d71a8004fae5aab2052a0) > - Apply "futurize -f libfuturize.fixes.fix_absolute_import" and > refactor some python scripts to break the circular imports. > > This patch series is also

Re: [edk2] [PATCH v3] MdeModulePkg: Enable SATA Controller PCI mem space

2018-06-20 Thread Zeng, Star
Pushed at 24fee0528c32b240720547afdd737ca928b34e60. Thanks, Star -Original Message- From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Sami Mujawar Sent: Wednesday, June 20, 2018 4:23 PM To: Zeng, Star ; edk2-devel@lists.01.org Cc: Ni, Ruiyu ; nd ; Stephanie

[edk2] [Patch] SecurityPkg: Cache TPM interface type info

2018-06-20 Thread Zhang, Chao B
Cache TPM interface type info to avoid excessive interface ID register read Cc: Long Qin Cc: Yao Jiewen Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chao Zhang Signed-off-by: Zhang, Chao B --- SecurityPkg/Include/Library/Tpm2DeviceLib.h| 12 +++-

[edk2] [PATCH v3 00/20] BaseTools: One step toward python3

2018-06-20 Thread Gary Lin
v3 changes: - Rebase to the current git HEAD (2e1083038d9aa74fcaa2db8158fdee7c8b4af3bb) - Fix a typo in BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/ini.py - Remove the patch for reduce() since it's not used anymore v2 changes: - Rebase to the current git HEAD

[edk2] [PATCH v3 04/20] BaseTools: Remove the old python "not-equal"

2018-06-20 Thread Gary Lin
Replace "<>" with "!=" to be compatible with python3. Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin --- BaseTools/Source/Python/AutoGen/AutoGen.py | 2 +-

[edk2] [PATCH v3 08/20] BaseTools: Replace StandardError with Expression

2018-06-20 Thread Gary Lin
StandardError has been removed from python 3. Replace it with Exception. Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin --- BaseTools/Source/Python/UPT/UPT.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[edk2] [PATCH v3 07/20] BaseTools: Remove the deprecated hash_key()

2018-06-20 Thread Gary Lin
Replace "has_key()" with "in" to be compatible with python3. Based on "futurize -f lib2to3.fixes.fix_has_key" Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin ---

[edk2] [PATCH v3 05/20] BaseTools: Use the python3-range functions

2018-06-20 Thread Gary Lin
Replace xrange() and range() with the newer range() function Based on "futurize -f libfuturize.fixes.fix_xrange_with_import" Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin --- BaseTools/Scripts/BinToPcd.py

[edk2] [PATCH v3 02/20] BaseTools: Refactor python except statements

2018-06-20 Thread Gary Lin
Convert "except ... ," to "except ... as" to be compatible with python3. Based on "futurize -f lib2to3.fixes.fix_except" Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin ---

[edk2] [PATCH v3 03/20] BaseTools: Refactor python print statements

2018-06-20 Thread Gary Lin
Refactor print statements to be compatible with python 3. Based on "futurize -f libfuturize.fixes.fix_print_with_import" Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin --- BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py

[edk2] [PATCH v3 06/20] BaseTools: Remove tuple parameter in python scripts

2018-06-20 Thread Gary Lin
According to PEP3113, tuple parameter is removed in python 3. (PEP3113: https://www.python.org/dev/peps/pep-3113/) Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin --- BaseTools/Source/Python/Common/VpdInfoFile.py | 3 ++- 1 file

[edk2] [PATCH v3 10/20] BaseTools: Refactor python raise statement

2018-06-20 Thread Gary Lin
Make "raise" to be compatible with python3. Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin --- BaseTools/gcc/mingw-gcc-build.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[edk2] [PATCH v3 15/20] BaseTools: Replace StringIO.StringIO with io.BytesIO

2018-06-20 Thread Gary Lin
Replace StringIO.StringIO with io.BytesIO to be compatible with python3. This commit also removes "import StringIO" from those python scripts that don't really use it. Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin ---

[edk2] [PATCH v3 01/20] BaseTools: Fix a typo in ini.py

2018-06-20 Thread Gary Lin
"if mis not None:" => "if m is not None:" Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Jaben Carsey Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin --- BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/ini.py | 2 +- 1 file changed, 1 insertion(+), 1

[edk2] [PATCH v3 09/20] BaseTools: Remove types.TypeType

2018-06-20 Thread Gary Lin
"types.TypeType" is now an alias of the built-in "type" and is not compatible with python 3. Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin --- BaseTools/Tests/TestTools.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)

[edk2] [PATCH v3 18/20] BaseTools: Move OverrideAttribs to OptRomInfStatement.py

2018-06-20 Thread Gary Lin
Move "class OverrideAttribs" to OptRomInfStatement.py to remove "import OptionRom" which may form a circular import: GenFds.OptionRom => GenFds.OptRomInfStatement => GenFds.OptionRom Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin

[edk2] [PATCH v3 13/20] BaseTools: Unify long int and int in python scripts

2018-06-20 Thread Gary Lin
According to PEP237, long int and int are unified. https://www.python.org/dev/peps/pep-0237/ Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin --- BaseTools/Source/Python/Common/Expression.py | 3 +-- 1 file changed, 1

[edk2] [PATCH v3 17/20] BaseTools: Adopt absolute import for python scripts

2018-06-20 Thread Gary Lin
Based on "futurize -f libfuturize.fixes.fix_absolute_import" Since circular import is not allowed after adopting absolute import, the following changes are applied to break the circles. * BaseTools/Source/Python/GenFds/Capsule.py - Delay "from .GenFds import GenFds" until GenCapsule() -

[edk2] [PATCH v3 16/20] BaseTools: Treat GenFds.py and build.py as python modules

2018-06-20 Thread Gary Lin
Since GenFds.py and build.py import modules from its own directory, add "-m" to the python parameters so that they can import its own modules. Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin ---

[edk2] [PATCH v3 14/20] BaseTools: Fix old python2 idioms

2018-06-20 Thread Gary Lin
Based on "futurize -f lib2to3.fixes.fix_idioms" * Change some type comparisons to isinstance() calls: type(x) == T -> isinstance(x, T) type(x) is T -> isinstance(x, T) type(x) != T -> not isinstance(x, T) type(x) is not T -> not isinstance(x, T) * Change "while 1:" into "while

[edk2] [PATCH v3 20/20] BaseTools: Move ImageBinDict to GenFdsGlobalVariable.py

2018-06-20 Thread Gary Lin
Move "ImageBinDict" from GenFds.py to GenFdsGlobalVariable.py so that we can remove the requirement to import GenFds.GenFds in Capsule.py, Fd.py and Fv.py. This breaks the following circular imports: * GenFds.FdfParser => GenFds.Capsule => GenFds.GenFds => GenFds.FdfParser * GenFds.FdfParser =>

[edk2] [PATCH v3 12/20] BaseTools: Migrate to the new octal literal

2018-06-20 Thread Gary Lin
Change the octal literals according to PEP3127 https://www.python.org/dev/peps/pep-3127/ Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin --- BaseTools/Source/Python/Common/LongFilePathOs.py | 2 +-

Re: [edk2] [PATCH v1 1/1] BaseTools/tools_def: Add WINGCC49 support

2018-06-20 Thread Gao, Liming
Chris: I suggest to name this tool chain as GCC49xASL and align to other ASL tool chain, such as VS2015xASL. And, ASL_PATH can be set to DEF(WIN_ASL_BIN). WINGCC49_ARM_PREFIX is not required. GCC49_ARM_PREFIX can still be used. Besides, please add this tool chain introduction in file

[edk2] [PATCH v1] Readme.md: add Socionext SynQuacer in Supported Platforms

2018-06-20 Thread masahisa . kojima
From: Masahisa Kojima Socionext SynQuacer(SC2A11) was already supported and Developerbox(Linaro's 96Boards EE compliant board) is publicly available. Let's add in Supported Platforms. Signed-off-by: Masahisa Kojima --- Readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Readme.md

Re: [edk2] Is the PEI Core MP Safe? UefiCpuPkg seems to think so calling GetFirstGuidHob on the APs?

2018-06-20 Thread Andrew Fish
> On Jun 20, 2018, at 8:06 PM, Ni, Ruiyu wrote: > > Andrew, > Good catch! It does break the rule that AP shouldn't call PEI services. > But considering the specific case, it should be safe. > Because: > 1. HOB only stores a pointer to the buffer that contains all the MP > information. > 2.

Re: [edk2] Is the PEI Core MP Safe? UefiCpuPkg seems to think so calling GetFirstGuidHob on the APs?

2018-06-20 Thread Ni, Ruiyu
Andrew, Today's MpInitLib does depend on physical memory (the waking up vector sits below 1MB). So the MpPei module can use RegisterForShadow() to make sure it is loaded in memory before running. Then the module global variable can be used. But when system is in S3 boot path, it seems PeiCore

Re: [edk2] [PATCH v2 00/20] BaseTools: One step toward python3

2018-06-20 Thread Gary Lin
On Wed, Jun 20, 2018 at 07:29:40AM +, Zhu, Yonghong wrote: > Hi Paolo and Gary, > > The patches are good and helpful. But it is out of date, so could you help to > recreate the patches ? > Sure. I'll re-run the futurize scripts since BaseTools has been changed a lot recently and it might

Re: [edk2] [PATCH v3] MdeModulePkg: Enable SATA Controller PCI mem space

2018-06-20 Thread Sami Mujawar
Hi Star, I agree with this change. Regards, Sami Mujawar -Original Message- From: Zeng, Star Sent: 20 June 2018 05:42 AM To: Sami Mujawar ; edk2-devel@lists.01.org Cc: Dong, Eric ; Ni, Ruiyu ; ard.biesheu...@linaro.org; leif.lindh...@linaro.org; Matteo Carlini ; Stephanie

Re: [edk2] [PATCH] ShellPkg/comp: return NOT_EQUAL when compared files are different

2018-06-20 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey > -Original Message- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of > Ruiyu Ni > Sent: Wednesday, June 13, 2018 10:55 PM > To: edk2-devel@lists.01.org > Cc: Carsey, Jaben > Subject: [edk2] [PATCH] ShellPkg/comp: return NOT_EQUAL when

Re: [edk2] Is the PEI Core MP Safe? UefiCpuPkg seems to think so calling GetFirstGuidHob on the APs?

2018-06-20 Thread Dong, Eric
Hi Ruiyu & Andrew, I have submit https://bugzilla.tianocore.org/show_bug.cgi?id=993 for this issue and will follow up to fix it. Thanks, Eric -Original Message- From: Ni, Ruiyu Sent: Thursday, June 21, 2018 11:35 AM To: af...@apple.com Cc: edk2-devel ; Fan Jeff ; Dong, Eric ; Gao,

Re: [edk2] [PATCH v3] Silicon/NXP/Pcf8563RealTimeClockLib: add Voltage-low handling

2018-06-20 Thread Ard Biesheuvel
On 20 June 2018 at 09:15, wrote: > From: Masahisa Kojima > > BcdToDecimal8() in LibGetTime() asserts with the > following condition. > 1) RTC device has not been initialized yet, RTC device > returns indeterminate value with VL bit(1) > 2) DEBUG build > > UEFI boot fails with assertion