Re: [edk2] [PATCH] UefiCpuPkg: Enhance CPU feature dependency check

2018-02-01 Thread Laszlo Ersek
On 02/01/18 03:09, Song, BinX wrote: > Hi Laszlo, > > Thanks for your comments. > Explain the issue first: > In CpuCommonFeaturesLib.inf -> CpuCommonFeaturesLib.c -> > CpuCommonFeaturesLibConstructor() function, > it invokes RegisterCpuFeature() to register CPU feature. Some original source >

Re: [edk2] [PATCH] UefiCpuPkg: Enhance CPU feature dependency check

2018-02-01 Thread Laszlo Ersek
On 02/01/18 06:10, Ni, Ruiyu wrote: > On 1/31/2018 5:44 PM, Laszlo Ersek wrote: >> On 01/31/18 08:00, Song, BinX wrote: >>> Current CPU feature dependency check will hang on when meet below or >>> similar case: >>> if (IsCpuFeatureSupported (CPU_FEATURE_AESNI)) { >>>    Status = RegisterCpuFeature

Re: [edk2] [PATCH] BaseTools/build_rule: pass contents of DTC_FLAGS device tree compiler

2018-02-01 Thread Ard Biesheuvel
On 1 February 2018 at 01:32, Gao, Liming wrote: > Ard: > Do you consider to add DTC_FLAGS in tools_def.template file? Its value can > be empty. So, user bases on tools_def.txt to know which option can be set. > You are right, I forgot about the second part

Re: [edk2] [PATCH] ArmPlatformPkg/MemoryInitPeiLib: mark primary FV region as boot services data

2018-02-01 Thread Ard Biesheuvel
Leif, On 3 January 2018 at 07:44, Ard Biesheuvel wrote: > On 3 January 2018 at 05:09, Udit Kumar wrote: >> Thanks Ard, >> This works for us as well >> Few comments inline >> >> >> Regards >> Udit >> >>> -Original Message- >>> From: Ard

[edk2] [PATCH v2] BaseTools/Conf: disable DTC legacy phandle format

2018-02-01 Thread Ard Biesheuvel
By default, the device tree compiler emits phandle properties twice: one called 'phandle' and another called 'linux,phandle'. Given that Linux was updated in early 2010 [0] to accept the former (which is what is specified in the ePAPR and device tree specifications), there is no point in emitting

Re: [edk2] [PATCH] MdeModulePkg/SmmCore: Fix hang due to already-freed memory deference

2018-02-01 Thread Laszlo Ersek
Hello Ray, On 02/01/18 11:15, Ruiyu Ni wrote: > SmiHandlerUnRegister() validates the DispatchHandle by checking > whether the first 32bit matches to a certain signature > (SMI_HANDLER_SIGNATURE). > But if a caller calls *UnRegister() twice and the memory freed by > first call still contains the

Re: [edk2] Why the DEBUG can't output the full string?

2018-02-01 Thread Andrew Fish
> On Feb 1, 2018, at 8:23 AM, Laszlo Ersek wrote: > > On 02/01/18 10:47, krishnaLee wrote: >> Hi, >> For example,the follow code: >> //-code-start >> ConfigRequestHdr = HiiConstructConfigHdr (, >> VariableName, PrivateData1->DriverHandle[0]); >> Size = (StrLen

[edk2] [PATCH edk2-platforms 4/4] Platform/Cello, Overdrive: set fw vendor PCD from FIRMWARE_VENDOR

2018-02-01 Thread Ard Biesheuvel
'AMD Seattle' is not a firmware vendor, nor is 'LeMaker Cello' So let's do what other platforms do, and default to 'EDK II' unless it is overridden at build time by setting FIRMWARE_VENDOR. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel

[edk2] [PATCH edk2-platforms 3/4] Platform/AMD/OverdriveBoard: enable ConsolePrefDxe

2018-02-01 Thread Ard Biesheuvel
Add the ConsolePrefDxe driver so we can get the console on the framebuffer rather than on the serial port. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- Platform/AMD/OverdriveBoard/OverdriveBoard.dsc | 6 ++

[edk2] [PATCH edk2-platforms 0/4] Platform/Cello, Overdrive: various updates

2018-02-01 Thread Ard Biesheuvel
Patch #1 is the counterpart of the edk2-non-osi series I sent out just now, so builds will use the separate SCP and secure AP firmware images (the latter of which is now shared between Cello and Overdrive) Patch #2 modifies the Overdrive capsule definition so it covers these binary images as

[edk2] [PATCH edk2-platforms 2/4] Platform/AMD/OverdriveBoard: cover secure firmware in capsule update

2018-02-01 Thread Ard Biesheuvel
Add the first part of the flash device (FD) to the capsule image so we can update the secure and SCP firmware in one go along with the UEFI firmware volume (FV). Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel ---

[edk2] [PATCH edk2-platforms 1/4] Platform/Cello, Overdrive: switch to split SCP and secure AP firmware images

2018-02-01 Thread Ard Biesheuvel
Switch to the split prebuilt firmware image for the SCP and the AP secure world. This allows Overdrive and Cello to share the latter image, which we will update shortly. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel ---

Re: [edk2] Why the DEBUG can't output the full string?

2018-02-01 Thread Laszlo Ersek
On 02/01/18 10:47, krishnaLee wrote: > Hi, > For example,the follow code: > //-code-start > ConfigRequestHdr = HiiConstructConfigHdr (, > VariableName, PrivateData1->DriverHandle[0]); > Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16); > ConfigRequest = AllocateZeroPool (Size); >

Re: [edk2] [PATCH edk2-non-osi 2/2] Silicon/AMD/Styx: update ArmTrustedFirmware.bin

2018-02-01 Thread Marc Zyngier
On 01/02/18 16:42, Ard Biesheuvel wrote: > On 1 February 2018 at 16:04, Ard Biesheuvel wrote: >> The ARM Trusted Firmware build we have been using up until now was built >> with optimizations disabled (which means every variable manipulation >> involves a load, the

Re: [edk2] [PATCH v2] BaseTools/Conf: disable DTC legacy phandle format

2018-02-01 Thread Laszlo Ersek
On 02/01/18 12:15, Ard Biesheuvel wrote: > By default, the device tree compiler emits phandle properties twice: > one called 'phandle' and another called 'linux,phandle'. Given that > Linux was updated in early 2010 [0] to accept the former (which is > what is specified in the ePAPR and device

[edk2] [PATCH edk2-non-osi 2/2] Silicon/AMD/Styx: update ArmTrustedFirmware.bin

2018-02-01 Thread Ard Biesheuvel
The ARM Trusted Firmware build we have been using up until now was built with optimizations disabled (which means every variable manipulation involves a load, the operation itself and a store), and runs with the MMU disabled, making it needlessly slow. This appears to be due to the fact that a)

[edk2] [PATCH edk2-non-osi 1/2] Platform/Cello, Overdrive: split SCP and secure AP firmware

2018-02-01 Thread Ard Biesheuvel
In preparation of updating the secure AP firmware image to include Spectre variant 2 mitigations, let's split the pre-UEFI firmware image into a SCP part and a ARM Trusted Firmware part. Note that this requires similar changes in the platform's FDF files. Contributed-under: TianoCore Contribution

Re: [edk2] [RFC] MdeModulePkg/PciHostBridgeDxe: Add support for address translation

2018-02-01 Thread Ard Biesheuvel
On 1 February 2018 at 05:03, Ni, Ruiyu wrote: > On 1/29/2018 4:50 PM, Guo Heyi wrote: >> >> Sorry for the late; I caught cold and didn't work for several days last >> week :( >> Please see my comments below: >> >> >> On Mon, Jan 22, 2018 at 11:36:14AM +0800, Ni, Ruiyu wrote:

Re: [edk2] [PATCH edk2-non-osi 2/2] Silicon/AMD/Styx: update ArmTrustedFirmware.bin

2018-02-01 Thread Ard Biesheuvel
On 1 February 2018 at 16:04, Ard Biesheuvel wrote: > The ARM Trusted Firmware build we have been using up until now was built > with optimizations disabled (which means every variable manipulation > involves a load, the operation itself and a store), and runs with the >

[edk2] [PATCH edk2-non-osi 0/2] Platform/Cello, Overdrive: upgrade firmware for Spectre

2018-02-01 Thread Ard Biesheuvel
This is the edk2-non-osi part of the Overdrive/Cello changes to implement the new SMC Calling Convention version 1.1 in ARM Trusted Firmware. Some improvements were made along the way, i.e., to use a release build with optimization enabled, and to fix issues that were preventing EL3 from running

Re: [edk2] [PATCH edk2-non-osi 0/2] Platform/Cello, Overdrive: upgrade firmware for Spectre

2018-02-01 Thread Leif Lindholm
On Thu, Feb 01, 2018 at 04:04:33PM +, Ard Biesheuvel wrote: > This is the edk2-non-osi part of the Overdrive/Cello changes to implement > the new SMC Calling Convention version 1.1 in ARM Trusted Firmware. Some > improvements were made along the way, i.e., to use a release build with >

Re: [edk2] [PATCH edk2-platforms 0/4] Platform/Cello, Overdrive: various updates

2018-02-01 Thread Leif Lindholm
On Thu, Feb 01, 2018 at 04:10:04PM +, Ard Biesheuvel wrote: > Patch #1 is the counterpart of the edk2-non-osi series I sent out just now, > so builds will use the separate SCP and secure AP firmware images (the latter > of which is now shared between Cello and Overdrive) > > Patch #2 modifies

Re: [edk2] [PATCH] MdeModulePkg/SmmCore: Fix hang due to already-freed memory deference

2018-02-01 Thread Ni, Ruiyu
> -Original Message- > From: Laszlo Ersek [mailto:ler...@redhat.com] > Sent: Friday, February 2, 2018 12:12 AM > To: Ni, Ruiyu ; edk2-devel@lists.01.org > Cc: Yao, Jiewen ; Zeng, Star > Subject: Re: [edk2] [PATCH]

Re: [edk2] Why the DEBUG can't output the full string?

2018-02-01 Thread Ni, Ruiyu
On 2/2/2018 12:23 AM, Laszlo Ersek wrote: On 02/01/18 10:47, krishnaLee wrote: Hi, For example,the follow code: //-code-start ConfigRequestHdr = HiiConstructConfigHdr (, VariableName, PrivateData1->DriverHandle[0]); Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16); ConfigRequest =

Re: [edk2] Why the DEBUG can't output the full string?

2018-02-01 Thread krishnaLee
Hi Andrew Fish, I didn't know the internal buffer is limited, I just think the Hii will be a formatted string,I want to understarnd how it worked so I print it,I find the result is not as I expected... I had calculate the first DEBUG string length,it is 199 chars limited.then I search the

Re: [edk2] [PATCH] IntelSiliconPkg/MicrocodeUpdateDxe: Refine debug messages

2018-02-01 Thread Zeng, Star
Minor comments. How about to update the error message like below? + DEBUG((DEBUG_ERROR, "VerifyMicrocode - The extended checksum is incorrect\n")); -> + DEBUG((DEBUG_ERROR, "VerifyMicrocode - The checksum for extended table is incorrect\n")); +

Re: [edk2] [RFC] MdeModulePkg/PciHostBridgeDxe: Add support for address translation

2018-02-01 Thread Ni, Ruiyu
> -Original Message- > From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] > Sent: Friday, February 2, 2018 1:23 AM > To: Ni, Ruiyu > Cc: Guo Heyi ,Dong Wei ; Dong, > Eric ; edk2-devel@lists.01.org;

Re: [edk2] [PATCH] IntelSiliconPkg/MicrocodeUpdateDxe: Refine debug messages

2018-02-01 Thread Wu, Hao A
Sure, I will modify the messages before pushing the change. Best Regards, Hao Wu > -Original Message- > From: Zeng, Star > Sent: Friday, February 02, 2018 10:15 AM > To: Wu, Hao A; edk2-devel@lists.01.org > Cc: Yao, Jiewen; Zeng, Star > Subject: RE: [PATCH]

[edk2] [PATCH] BaseTools: Fix GCC build PcdValueCommon.c bug

2018-02-01 Thread Feng, YunhuaX
error message: PcdValueCommon.c: In function '__PcdGetPtr': PcdValueCommon.c:315:11: error: variable 'Byte' set but not used [-Werror=unused-but-set-variable] UINT8 Byte; ^ cc1: all warnings being treated as errors Cc: Liming Gao Cc: Yonghong Zhu

Re: [edk2] [PATCH] UefiCpuPkg: Enhance CPU feature dependency check

2018-02-01 Thread Song, BinX
Hi Laszlo, Thanks for your reply, I have also discussed this patch with Eric and Ray, all comments will be in the V2 patch. Best Regards, Bell Song > -Original Message- > From: Laszlo Ersek [mailto:ler...@redhat.com] > Sent: Thursday, February 1, 2018 9:16 PM > To: Song, BinX

Re: [edk2] [PATCH] CorebootPayloadPkg/FbGop: Produces correct PixelsPerScanLine

2018-02-01 Thread Ni, Ruiyu
Reviewed-by: Ruiyu Ni Thanks/Ray > -Original Message- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of > Benjamin You > Sent: Tuesday, January 30, 2018 4:39 PM > To: edk2-devel@lists.01.org > Cc: Agyeman, Prince >

Re: [edk2] [PATCH] BaseTools: Fix GCC build PcdValueCommon.c bug

2018-02-01 Thread Zhu, Yonghong
Reviewed-by: Yonghong Zhu Best Regards, Zhu Yonghong -Original Message- From: Feng, YunhuaX Sent: Friday, February 02, 2018 10:34 AM To: edk2-devel@lists.01.org Cc: Zhu, Yonghong ; Gao, Liming Subject: [PATCH]

Re: [edk2] [PATCH edk2-platforms v2 02/15] Hisilicon/D05: Add PPTT support

2018-02-01 Thread Huangming (Mark)
On 2018/2/1 9:11, Jeremy Linton wrote: > Hi, > > > On 01/26/2018 02:00 AM, Ming Huang wrote: >> Add Processor Properties Topology Table, PPTT include >> Processor hierarchy node, Cache Type Structure and ID structure. >> >> PPTT is needed for lscpu command to show socket information correctly.

Re: [edk2] [Patch 0/2] NetworkPkg: Add warning message for PXE if failed to read system GUID from SMBIOS.

2018-02-01 Thread Yao, Jiewen
Got it. I agree. > -Original Message- > From: Fu, Siyuan > Sent: Friday, February 2, 2018 11:49 AM > To: Yao, Jiewen ; edk2-devel@lists.01.org > Subject: RE: [edk2] [Patch 0/2] NetworkPkg: Add warning message for PXE if > failed to read system GUID from SMBIOS. > >

[edk2] [PATCH 03/10] MdeModulePkg/PeiMain: Cleanup whitespace in Reset.c

2018-02-01 Thread Ruiyu Ni
From: Michael D Kinney Cc: Liming Gao Reviewed-by: Ruiyu Ni Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney ---

[edk2] [PATCH 02/10] MdeModulePkg/PeiMain: Always attempt to use Reset2 PPI first

2018-02-01 Thread Ruiyu Ni
From: Michael D Kinney Update PEI Service ResetSystem() to always attempt to use the Reset2 PPI before looking for the Reset PPI. Cc: Liming Gao Reviewed-by: Ruiyu Ni Cc: Star Zeng Contributed-under:

Re: [edk2] [PATCH] MdeModulePkg/SmmCore: Fix hang due to already-freed memory deference

2018-02-01 Thread Shi, Steven
Hi Laszlo, Check the DispatchHandle valid in internal handle set before using it to reference its Signature data is majorly to avoid use-after-free problem here, it also can defense if an input handle is invalid but has a valid signature occasionally or deliberately. > Generally, if client

Re: [edk2] [PATCH 1/3] UefiCpuPkg/PiSmmCpuDxeSmm: update comments in IA32 SmmStartup()

2018-02-01 Thread Laszlo Ersek
On 01/31/18 23:11, Kinney, Michael D wrote: > Laszlo, > > I agree the Unaligned functions have issues. > We should see if we could change the param type. > It should be a backwards compatible change to > go from a type specific pointer to VOID *. But > need to check with all supported compilers.

[edk2] [PATCH] BaseTools: StructurePcd array Value support flexible format

2018-02-01 Thread Feng, YunhuaX
if StructurePcd set item value is array, support flexible format like as: gEfiStructuredPcdPkgTokenSpaceGuid.Test.Array | {flexible format} {flexible format} = {L"ABC"} | {L'ABC'} | {"ABC"} | {UINT8(0x10)} | {UINT16(0x10)} | {UINT32(0x10)} | {UINT64(0x10)} |

[edk2] [Patch 2/2] MdeModulePkg/PXE: Add warning message for PXE if failed to read system GUID from SMBIOS.

2018-02-01 Thread Fu Siyuan
Current PXE driver uses zero GUID if failed to get the system GUID from smbios table, and some OS PXE boot may fail in such case. This patch is to add a warning message to inform user that smbios table is missed on the platform. Cc: Ye Ting Cc: Wu Jiaxin

[edk2] [Patch 0/2] NetworkPkg: Add warning message for PXE if failed to read system GUID from SMBIOS.

2018-02-01 Thread Fu Siyuan
Current PXE driver uses zero GUID if failed to get the system GUID from smbios table, and some OS PXE boot may fail in such case. This patch is to add a warning message to inform user that smbios table is missed on the platform. Fu Siyuan (2): NetworkPkg: Add warning message for PXE if failed

[edk2] [Patch 1/2] NetworkPkg: Add warning message for PXE if failed to read system GUID from SMBIOS.

2018-02-01 Thread Fu Siyuan
Current PXE driver uses zero GUID if failed to get the system GUID from smbios table, and some OS PXE boot may fail in such case. This patch is to add a warning message to inform user that smbios table is missed on the platform. Cc: Ye Ting Cc: Wu Jiaxin

[edk2] [PATCH edk2/MdePkg v1] MdePkg ACPI: Add some macros for PPTT

2018-02-01 Thread Heyi Guo
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ming Huang Signed-off-by: Heyi Guo --- MdePkg/Include/IndustryStandard/Acpi62.h | 18 ++ 1 file changed, 18 insertions(+) diff --git

[edk2] [PATCH edk2/MdePkg v1] Add some macros for PPTT

2018-02-01 Thread Heyi Guo
Add some macros to Acpi62.h for PPTT as ACPI 6.2 Spec. Heyi Guo (1): MdePkg ACPI: Add some macros for PPTT MdePkg/Include/IndustryStandard/Acpi62.h | 18 ++ 1 file changed, 18 insertions(+) -- 1.9.1 ___ edk2-devel mailing list

Re: [edk2] [Patch 0/2] NetworkPkg: Add warning message for PXE if failed to read system GUID from SMBIOS.

2018-02-01 Thread Yao, Jiewen
Hi Siyuan It is great idea to add such warning message to help debug such PXE issue. Do you think it will be better if we add such info in NetLib - NetLibGetSystemGuid(). As such, we don't need update all consumers. Thank you Yao Jiewen > -Original Message- > From: edk2-devel

Re: [edk2] [Patch 0/2] NetworkPkg: Add warning message for PXE if failed to read system GUID from SMBIOS.

2018-02-01 Thread Fu, Siyuan
Jiewen, NetLibGetSystemGuid is also used by some other drivers like DHCP6, and it's acceptable to not use system GUID as client identifier in DHCP protocol. That's why I only add the warning in PXE driver. BestRegards Fu Siyuan > -Original Message- > From: Yao, Jiewen > Sent: Friday,

[edk2] [PATCH 06/10] MdeModulePkg: Add ResetSystemLib instances that call core services

2018-02-01 Thread Ruiyu Ni
From: Michael D Kinney Add a PEI instance of ResetSystemLib that calls the ResetSystem2() service in the PEI Services Table. Add a DXE instance of ResetSystemLib that calls the ResetSystem() service in the UEFI Runtime Services Table. These 2 library instances

[edk2] [PATCH 09/10] MdeModulePkg: Add ResetSystemPei PEIM

2018-02-01 Thread Ruiyu Ni
This driver implements Reset2, ResetFilter and ResetHandler PPIs. Cc: Liming Gao Cc: Michael D Kinney Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni ---

[edk2] [PATCH 04/10] MdeModulePkg/ResetSystemRuntimeDxe: Add platform filter and handler

2018-02-01 Thread Ruiyu Ni
From: Michael D Kinney Add support for platform specific reset filters and platform specific reset handlers to ResetSystem(). A filter may modify the reset type and reset data and call ResetSystem() with the modified parameters. A handler performs the reset action.

[edk2] [PATCH 05/10] MdeModulePkg/ResetSystemRuntimeDxe: Add more debug message

2018-02-01 Thread Ruiyu Ni
The patch adds more debug message in ResetSystem(). It also removes unnecessary check of mResetNotifyDepth. Cc: Liming Gao Cc: Michael D Kinney Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.1

[edk2] [PATCH 01/10] MdePkg/PeiServicesLib: Add PeiServicesResetSystem2()

2018-02-01 Thread Ruiyu Ni
From: Michael D Kinney Add the PeiServicesResetSytstem2() function to the PeiServiesLib to call the ResetSystem2() services in the PEI Services Table. Cc: Liming Gao Cc: Ruiyu Ni Contributed-under: TianoCore Contribution

[edk2] [PATCH 07/10] MdeModulePkg: Add ResetUtility librray class and BASE instance

2018-02-01 Thread Ruiyu Ni
From: Michael D Kinney The library class that provides services to generate a GUID specific reset, parse the GUID from a GUID specific reset, and build the ResetData buffer for any type of reset that requires extra data. Cc: Liming Gao

[edk2] [PATCH 10/10] MdeModulePkg/ResetSystemPei: Add reset notifications in PEI

2018-02-01 Thread Ruiyu Ni
From: Bret Barkelew The Reset Notification protocol is added in UEFI spec to support reset notification mechanism in the DXE phase. This patch adds similar EDKII specific Reset Notification PPI to PEI phase to provide the same support. Cc: Liming Gao

[edk2] [PATCH 08/10] MdePkg/UefiRuntimeLib: Support more module types.

2018-02-01 Thread Ruiyu Ni
Because DxeResetSystemLib links to this library to provide reset system services, change UefiRuntimeLib to support the same set of module types as what DxeResetSystemLib does. Cc: Liming Gao Cc: Michael D Kinney Cc: Star Zeng

[edk2] [PATCH 00/10] Formalize the reset system core design

2018-02-01 Thread Ruiyu Ni
The patches add/update two core modules that perform the reset action ResetSystemPei and ResetSystemRuntimeDxe With the two core modules, every time a reset action is performed in either PEI phase or DXE phase, the accordingly registerred reset filter/notification/handler will be triggered.

Re: [edk2] [Patch] BaseTools CommonLib: Remove the unnecessary print message in PcdValueCommon

2018-02-01 Thread Ard Biesheuvel
On 31 January 2018 at 10:39, Zhu, Yonghong wrote: > Reviewed-by: Yonghong Zhu > This patch breaks the GCC build. PcdValueCommon.c: In function '__PcdGetPtr': PcdValueCommon.c:315:11: error: variable 'Byte' set but not used

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

2018-02-01 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

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

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

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

2018-02-01 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 ---

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

2018-02-01 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 ---

[edk2] [PATCH v2 14/20] BaseTools: Adjust old python2 idioms

2018-02-01 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 v2 18/20] BaseTools: Move OverrideAttribs to OptRomInfStatement.py

2018-02-01 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

[edk2] [PATCH v2 07/20] BaseTools: Import reduce() from functools

2018-02-01 Thread Gary Lin
In python3, reduce() is not a built-in function anymore. Import it from "functools" to be compatible with python 3. Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu Cc: Liming Gao Signed-off-by: Gary Lin ---

[edk2] [PATCH v2 04/20] BaseTools: Use the python3-range functions

2018-02-01 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

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

2018-02-01 Thread Gary Lin
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 available in

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

2018-02-01 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 +-

[edk2] [PATCH v2 02/20] BaseTools: Refactor python print statements

2018-02-01 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

[edk2] [PATCH v2 05/20] BaseTools: Remove tuple parameter in python scripts

2018-02-01 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 ---

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

2018-02-01 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

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

2018-02-01 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 ---

[edk2] [PATCH v2 01/20] BaseTools: Refactor python except statements

2018-02-01 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 v2 06/20] BaseTools: Remove the deprecated hash_key()

2018-02-01 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 v2 19/20] BaseTools: Move FindExtendTool to GenFdsGlobalVariable.py

2018-02-01 Thread Gary Lin
Importing "FindExtendTool" from GenFds.GenFds could create the following circular imports: * GenFds.FdfParser => GenFds.Capsule => GenFds.GenFds => GenFds.FdfParser * GenFds.FdfParser => GenFds.Fd => GenFds.Fv => GenFds.AprioriSection => GenFds.FfsFileStatement => GenFds.GuidSection =>

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

2018-02-01 Thread Gary Lin
Moving "ImageBinDict" from GenFds.py to GenFdsGlobalVariable.py to 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 => GenFds.Fd

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

2018-02-01 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/Scripts/BinToPcd.py

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

2018-02-01 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:

[edk2] Why the DEBUG can't output the full string?

2018-02-01 Thread krishnaLee
Hi, For example,the follow code: //-code-start ConfigRequestHdr = HiiConstructConfigHdr (, VariableName, PrivateData1->DriverHandle[0]); Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16); ConfigRequest = AllocateZeroPool (Size); ASSERT (ConfigRequest != NULL); AllocatedRequest = TRUE;

[edk2] [PATCH] MdeModulePkg/SmmCore: Fix hang due to already-freed memory deference

2018-02-01 Thread Ruiyu Ni
SmiHandlerUnRegister() validates the DispatchHandle by checking whether the first 32bit matches to a certain signature (SMI_HANDLER_SIGNATURE). But if a caller calls *UnRegister() twice and the memory freed by first call still contains the signature, the second hang may hang. The patch fixes this