Re: [edk2] aarch64-linux-gnu-gcc.exe: error due to loss ‘/’in code path in in Jenkins server

2019-04-03 Thread Gao, Liming
I mean to manually trig build in Jenkins server and see what happen.

Thanks
Liming
From: wang xiaofeng [mailto:winggundu...@163.com]
Sent: Wednesday, April 3, 2019 8:16 PM
To: Gao, Liming 
Cc: edk2-devel@lists.01.org; ard.biesheu...@linaro.org; leif.lindh...@linaro.org
Subject: Re:Re: [edk2] aarch64-linux-gnu-gcc.exe: error due to loss ‘/’in code 
path in in Jenkins server

HI Liming,
   I don;t have direct access to server but  I can ask someone to try.
   How to verify gcc tool enviroment? any command I can run to check the 
difference?
   I just compare the gcc tool binarys , server and my local desktop are same. 
But I am not sure whether other software/enviroment is installed on server may 
affect the tools.




At 2019-04-03 20:00:09, "Gao, Liming" 
mailto:liming@intel.com>> wrote:

>Are your local server the same environment to Jenkins server? Can you login in 
>Jenkins sever and verify gcc tool?

>

>Thanks

>Liming

>From: wang xiaofeng [mailto:winggundu...@163.com]

>Sent: Wednesday, April 3, 2019 3:55 PM

>To: Gao, Liming mailto:liming@intel.com>>; 
>edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>; 
>ard.biesheu...@linaro.org<mailto:ard.biesheu...@linaro.org>; 
>leif.lindh...@linaro.org<mailto:leif.lindh...@linaro.org>

>Subject: aarch64-linux-gnu-gcc.exe: error due to loss ‘/’in code path in in 
>Jenkins server

>

>HI ARM Base tool owners,

>   I meet a strange issue that aarch64 build . The aarch64 build pass on my 
> local server.  But it fails at Jenkins server(a Win10 autobuild system 
> written by Java that will can call edk2 bat in command line)

>

>The build command is 
>"c:\jenkins\workspace\gop2018\udk2018\gnutools\gcc-linaro-7.3.1-2018.05-i686-mingw32_aarch64-linux-gnu\bin\aarch64-linux-gnu-gcc"
> -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror 
>-Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h 
>-fno-common -DSTRING_ARRAY_NAME=UefiDevicePathLibStrings -g -Os -fshort-wchar 
>-fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-missing-braces 
>-Wno-array-bounds -include AutoGen.h -fno-common -mlittle-endian 
>-fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections 
>-fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-pic -fno-pie 
>-ffixed-x18 -flto -Wno-unused-but-set-variable -Wno-unused-const-variable 
>-mcmodel=small -DEDKII -DEFIX64 -DUEFI_BUILD -DFGL_LINUX -DGCC_TOOLCHAIN -c -o 
>c:\jenkins\workspace\gop2018\udk2018\Build\AmdGopPkg\DEBUG_GCC5\AARCH64\MdePkg\Library\UefiDevicePathLib\UefiDevicePathLib\OUTPUT\.\DevicePathUtilities.obj
> -Ic:\jenkins\workspace\gop2018\udk2018\MdePkg\Library\UefiDevicePathLib 
>-Ic:\jenkins\workspace\gop2018\udk2018\Build\AmdGopPkg\DEBUG_GCC5\AARCH64\MdePkg\Library\UefiDevicePathLib\UefiDevicePathLib\DEBUG
> -Ic:\jenkins\workspace\gop2018\udk2018\MdePkg 
>-Ic:\jenkins\workspace\gop2018\udk2018\MdePkg\Include 
>-Ic:\jenkins\workspace\gop2018\udk2018\MdePkg\Include\AArch64 
>c:\jenkins\workspace\gop2018\udk2018\MdePkg\Library\UefiDevicePathLib\DevicePathUtilities.c

>

>But aarch64-linux-gnu-gcc.exe will return error with : 
>c:jenkinsworkspacegop2018udk2018MdePkgLibraryUefiDevicePathLibDevicePathUtilities.c:
> No such file or director

>The failure is due to all \ is missed from view of aarch64-linux-gnu-gcc.exe, 
>while the makefile and build log have '\'

>Another clue is that x86 build is ok on the same Jenkins system

>

>Anyone have advice for this strange issue?

>

>

>

>

>___

>edk2-devel mailing list

>edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>

>https://lists.01.org/mailman/listinfo/edk2-devel



___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] aarch64-linux-gnu-gcc.exe: error due to loss ‘/’in code path in in Jenkins server

2019-04-03 Thread Gao, Liming
Are your local server the same environment to Jenkins server? Can you login in 
Jenkins sever and verify gcc tool?

Thanks
Liming
From: wang xiaofeng [mailto:winggundu...@163.com]
Sent: Wednesday, April 3, 2019 3:55 PM
To: Gao, Liming ; edk2-devel@lists.01.org; 
ard.biesheu...@linaro.org; leif.lindh...@linaro.org
Subject: aarch64-linux-gnu-gcc.exe: error due to loss ‘/’in code path in in 
Jenkins server

HI ARM Base tool owners,
   I meet a strange issue that aarch64 build . The aarch64 build pass on my 
local server.  But it fails at Jenkins server(a Win10 autobuild system written 
by Java that will can call edk2 bat in command line)

The build command is 
"c:\jenkins\workspace\gop2018\udk2018\gnutools\gcc-linaro-7.3.1-2018.05-i686-mingw32_aarch64-linux-gnu\bin\aarch64-linux-gnu-gcc"
 -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror 
-Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h 
-fno-common -DSTRING_ARRAY_NAME=UefiDevicePathLibStrings -g -Os -fshort-wchar 
-fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-missing-braces 
-Wno-array-bounds -include AutoGen.h -fno-common -mlittle-endian 
-fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections 
-fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-pic -fno-pie 
-ffixed-x18 -flto -Wno-unused-but-set-variable -Wno-unused-const-variable 
-mcmodel=small -DEDKII -DEFIX64 -DUEFI_BUILD -DFGL_LINUX -DGCC_TOOLCHAIN -c -o 
c:\jenkins\workspace\gop2018\udk2018\Build\AmdGopPkg\DEBUG_GCC5\AARCH64\MdePkg\Library\UefiDevicePathLib\UefiDevicePathLib\OUTPUT\.\DevicePathUtilities.obj
 -Ic:\jenkins\workspace\gop2018\udk2018\MdePkg\Library\UefiDevicePathLib 
-Ic:\jenkins\workspace\gop2018\udk2018\Build\AmdGopPkg\DEBUG_GCC5\AARCH64\MdePkg\Library\UefiDevicePathLib\UefiDevicePathLib\DEBUG
 -Ic:\jenkins\workspace\gop2018\udk2018\MdePkg 
-Ic:\jenkins\workspace\gop2018\udk2018\MdePkg\Include 
-Ic:\jenkins\workspace\gop2018\udk2018\MdePkg\Include\AArch64 
c:\jenkins\workspace\gop2018\udk2018\MdePkg\Library\UefiDevicePathLib\DevicePathUtilities.c

But aarch64-linux-gnu-gcc.exe will return error with : 
c:jenkinsworkspacegop2018udk2018MdePkgLibraryUefiDevicePathLibDevicePathUtilities.c:
 No such file or director
The failure is due to all \ is missed from view of aarch64-linux-gnu-gcc.exe, 
while the makefile and build log have '\'
Another clue is that x86 build is ok on the same Jenkins system

Anyone have advice for this strange issue?




___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 1/2] MdePkg/BaseIoLibIntrinsic: Remove IoLibIcc.c

2019-04-03 Thread Gao, Liming
Can you also clean up BaseLib to remove the support of INTEL tool chain?

> -Original Message-
> From: Zhang, Shenglei
> Sent: Wednesday, April 3, 2019 4:30 PM
> To: edk2-devel@lists.01.org
> Cc: Kinney, Michael D ; Gao, Liming 
> 
> Subject: [PATCH 1/2] MdePkg/BaseIoLibIntrinsic: Remove IoLibIcc.c
> 
> As ICC tool chain will be removed, IoLibIcc.c should
> also be removed.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1666
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Shenglei Zhang 
> ---
>  .../BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf |   2 -
>  .../BaseIoLibIntrinsicSev.inf |   2 -
>  MdePkg/Library/BaseIoLibIntrinsic/IoLibIcc.c  | 214 --
>  3 files changed, 218 deletions(-)
>  delete mode 100644 MdePkg/Library/BaseIoLibIntrinsic/IoLibIcc.c
> 
> diff --git a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf 
> b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
> index eb81aab2d4..6020fe90da 100644
> --- a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
> +++ b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
> @@ -41,14 +41,12 @@
>  [Sources.IA32]
>IoLibGcc.c| GCC
>IoLibMsc.c| MSFT
> -  IoLibIcc.c| INTEL
>IoLib.c
>Ia32/IoFifo.nasm
> 
>  [Sources.X64]
>IoLibGcc.c| GCC
>IoLibMsc.c| MSFT
> -  IoLibIcc.c| INTEL
>IoLib.c
>X64/IoFifo.nasm
> 
> diff --git a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf 
> b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf
> index da846704d5..e92b5ed94d 100644
> --- a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf
> +++ b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf
> @@ -39,14 +39,12 @@
>  [Sources.IA32]
>IoLibGcc.c| GCC
>IoLibMsc.c| MSFT
> -  IoLibIcc.c| INTEL
>IoLib.c
>Ia32/IoFifoSev.nasm
> 
>  [Sources.X64]
>IoLibGcc.c| GCC
>IoLibMsc.c| MSFT
> -  IoLibIcc.c| INTEL
>IoLib.c
>X64/IoFifoSev.nasm
> 
> diff --git a/MdePkg/Library/BaseIoLibIntrinsic/IoLibIcc.c 
> b/MdePkg/Library/BaseIoLibIntrinsic/IoLibIcc.c
> deleted file mode 100644
> index 3036084f0c..00
> --- a/MdePkg/Library/BaseIoLibIntrinsic/IoLibIcc.c
> +++ /dev/null
> @@ -1,214 +0,0 @@
> -/** @file
> -  I/O Library. This file has compiler specifics for ICC as there
> -  is no ANSI C standard for doing IO.
> -
> -  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> -  This program and the accompanying materials are
> -  licensed and made available under the terms and conditions of the BSD 
> License
> -  which accompanies this distribution.  The full text of the license may be 
> found at
> -  http://opensource.org/licenses/bsd-license.php.
> -
> -  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> -  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> -
> -**/
> -
> -#include "BaseIoLibIntrinsicInternal.h"
> -
> -/**
> -  Reads an 8-bit I/O port.
> -
> -  Reads the 8-bit I/O port specified by Port. The 8-bit read value is 
> returned.
> -  This function must guarantee that all I/O read and write operations are
> -  serialized.
> -
> -  If 8-bit I/O port operations are not supported, then ASSERT().
> -
> -  @param  Port  The I/O port to read.
> -
> -  @return The value read.
> -
> -**/
> -UINT8
> -EFIAPI
> -IoRead8 (
> -  IN  UINTN Port
> -  )
> -{
> -  UINT8   Data;
> -
> -  __asm {
> -mov dx, word ptr [Port]
> -in  al, dx
> -
> -mov Data, al
> -  }
> -  return Data;
> -}
> -
> -/**
> -  Writes an 8-bit I/O port.
> -
> -  Writes the 8-bit I/O port specified by Port with the value specified by 
> Value
> -  and returns Value. This function must guarantee that all I/O read and write
> -  operations are serialized.
> -
> -  If 8-bit I/O port operations are not supported, then ASSERT().
> -
> -  @param  Port  The I/O port to write.
> -  @param  Value The value to write to the I/O port.
> -
> -  @return The value written the I/O port.
> -
> -**/
> -UINT8
> -EFIAPI
> -IoWrite8 (
> -  IN  UINTN Port,
> -  IN  UINT8 Value
> -  )
> -{
> -  __asm {
> -mov al, byte ptr [Value]
> -mov dx, word ptr [Port]
> -out dx, al
> -  }
> -  return Value;
> -}
> -
> -/**
> -  Reads a 16-bit I/O port.
> -
> -  Reads the 16-bit I/O port specified by Port. The 16-bit read value is 

Re: [edk2] [Patch V2] BaseTools: Fixed issue in MultiThread Genfds function

2019-04-02 Thread Gao, Liming
Bob:
  Thanks for your updating. If user only update BaseTools, and don't update 
Conf\build_rule.txt. What problem will happen?

Thanks
Liming
> -Original Message-
> From: Feng, Bob C
> Sent: Wednesday, April 3, 2019 10:17 AM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C ; Gao, Liming 
> Subject: [Patch V2] BaseTools: Fixed issue in MultiThread Genfds function
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1450
> In the Multiple thread Genfds feature, build tool generates
> GenSec, GenFFS command in Makefile.
> 
> The Non-Hii Driver does not generate .offset file for uni string offset,
> but the build tool has not knowledge about this in autogen phase. So
> in this patch, I add a check in Makefile for GenSec command. If the GenSec
> input file does not exist, the GenSec will not be called. And if GenSec
> command is not called, its output file, which is also the input file of
> GenFfs command, will also not exist.So for GenFfs command,
> I add a new command parameter -oi which means
> the input file is an optional input file which would not exist. so
> that I can generate GenFfs command with "-oi" parameter in Makefile.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> ---
>  BaseTools/Conf/build_rule.template  |  8 
>  BaseTools/Source/C/GenFfs/GenFfs.c  | 17 +++--
>  BaseTools/Source/Python/AutoGen/GenMake.py  |  2 +-
>  .../Python/GenFds/GenFdsGlobalVariable.py   | 10 +-
>  .../Source/Python/Workspace/DscBuildData.py |  3 +++
>  BaseTools/Source/Python/build/build.py  | 10 +-
>  6 files changed, 37 insertions(+), 13 deletions(-)
> 
> diff --git a/BaseTools/Conf/build_rule.template 
> b/BaseTools/Conf/build_rule.template
> index e56b1d9c59..17e7353063 100755
> --- a/BaseTools/Conf/build_rule.template
> +++ b/BaseTools/Conf/build_rule.template
> @@ -357,15 +357,15 @@
>  [Dynamic-Library-File]
>  
>  ?.dll
> 
>  
> -$(DEBUG_DIR)(+)$(MODULE_NAME).efi
> +$(OUTPUT_DIR)(+)$(MODULE_NAME).efi
> 
>  
>  "$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS)
> -$(CP) ${dst} $(OUTPUT_DIR)
> +$(CP) ${dst} $(DEBUG_DIR)
>  $(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi
>  -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)
>  -$(CP) $(DEBUG_DIR)(+)*.pdb $(OUTPUT_DIR)
>  
>  $(CP) ${src} $(DEBUG_DIR)(+)$(MODULE_NAME).debug
> @@ -376,21 +376,21 @@
>  #
>  -$(OBJCOPY) $(OBJCOPY_ADDDEBUGFLAG) ${src}
>  -$(CP) $(DEBUG_DIR)(+)$(MODULE_NAME).debug 
> $(BIN_DIR)(+)$(MODULE_NAME_GUID).debug
> 
>  "$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS)
> -$(CP) ${dst} $(OUTPUT_DIR)
> +$(CP) ${dst} $(DEBUG_DIR)
>  $(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi
>  -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)
> 
>  
>  # tool to convert Mach-O to PE/COFF
>  "$(MTOC)" -subsystem $(MODULE_TYPE)  $(MTOC_FLAGS)  ${src}  
> $(DEBUG_DIR)(+)$(MODULE_NAME).pecoff
>  # create symbol file for GDB debug
>  -$(DSYMUTIL) ${src}
>  "$(GENFW)" -e $(MODULE_TYPE) -o ${dst} 
> $(DEBUG_DIR)(+)$(MODULE_NAME).pecoff $(GENFW_FLAGS)
> -$(CP) ${dst} $(OUTPUT_DIR)
> +$(CP) ${dst} $(DEBUG_DIR)
>  $(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi
>  -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)
> 
>  [Dependency-Expression-File]
>  
> diff --git a/BaseTools/Source/C/GenFfs/GenFfs.c 
> b/BaseTools/Source/C/GenFfs/GenFfs.c
> index 02c7ac30f0..ea36b22bef 100644
> --- a/BaseTools/Source/C/GenFfs/GenFfs.c
> +++ b/BaseTools/Source/C/GenFfs/GenFfs.c
> @@ -17,10 +17,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
> EXPRESS OR IMPLIED.
>  #include 
>  #include 
>  #include 
>  #endif
> 
> +#ifdef __GNUC__
> +#include 
> +#endif
> +
>  #include 
>  #include 
>  #include 
> 
>  #include 
> @@ -158,10 +162,12 @@ Returns:
>  FileAlign points to file alignment, which only 
> support\n\
>  the following align: 
> 1,2,4,8,16,128,512,1K,4K,32K,64K\n\
>  128K,256K,512K,1M,2M,4M,8M,16M\n");
>fprintf (stdout, "  -i SectionFile, --sectionfile SectionFile\n\
>  Section file will be contained in this FFS file.\n");
> +  fprintf (stdout, "  -oi SectionFile, --optionalsectionfile SectionFile\n\
> +If the Section file exists, it 

Re: [edk2] [Patch] BaseTools:Enable the /MP option of MSVC compiler

2019-04-02 Thread Gao, Liming
The clean build performance data is good. 

This change updates build rule generation for C source files on MSFT tool 
chain. It is a base tool behavior change. If it doesn't depend on build rule, 
could you drop the change in build rule.txt. MP flag will be moved to 
tools_def.txt. 

Thanks
Liming
> -Original Message-
> From: Feng, Bob C
> Sent: Wednesday, April 3, 2019 10:12 AM
> To: Gao, Liming ; edk2-devel@lists.01.org
> Cc: Fan, ZhijuX 
> Subject: RE: [Patch] BaseTools:Enable the /MP option of MSVC compiler
> 
> Liming,
> 
> I add the performance data on the BZ:
> https://bugzilla.tianocore.org/show_bug.cgi?id=1672
> 
> Thanks,
> Bob
> 
> -Original Message-
> From: Gao, Liming
> Sent: Friday, March 29, 2019 10:20 PM
> To: Feng, Bob C ; edk2-devel@lists.01.org
> Cc: Fan, ZhijuX 
> Subject: RE: [Patch] BaseTools:Enable the /MP option of MSVC compiler
> 
> Bob:
>   How about use /MP option without process number? The compiler will 
> retrieves the number of effective processors on your computer.
>   And, move this option into CC_FLAGS in tools_def.txt. If so, platform can 
> override it in platform DSC file.
> 
>   Last, please provide the performance data with this option.
> 
> Thanks
> Liming
> > -Original Message-
> > From: Feng, Bob C
> > Sent: Friday, March 29, 2019 8:30 PM
> > To: edk2-devel@lists.01.org
> > Cc: Fan, ZhijuX ; Feng, Bob C
> > ; Gao, Liming 
> > Subject: [Patch] BaseTools:Enable the /MP option of MSVC compiler
> >
> > From: Zhiju Fan 
> >
> > https://bugzilla.tianocore.org/show_bug.cgi?id=1672
> > The /MP option of MSVC compiler can reduce the total time to compile
> > the source files on the command line.
> >
> > This patch is going to enable this MSVC option in BaseTools.
> >
> > Cc: Bob Feng 
> > Cc: Liming Gao 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Zhiju.Fan 
> > ---
> >  BaseTools/Conf/build_rule.template |  2 +-
> >  BaseTools/Source/Python/AutoGen/GenMake.py | 81
> > --
> >  2 files changed, 75 insertions(+), 8 deletions(-)
> >
> > diff --git a/BaseTools/Conf/build_rule.template
> > b/BaseTools/Conf/build_rule.template
> > index e56b1d9c59..e7d736740f 100755
> > --- a/BaseTools/Conf/build_rule.template
> > +++ b/BaseTools/Conf/build_rule.template
> > @@ -127,11 +127,11 @@
> >
> >  
> >  $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
> >
> >  
> > -"$(CC)" /Fo${dst} $(CC_FLAGS) $(INC) ${src}
> > +"$(CC)" /MP7 /Fo${d_path}\ $(CC_FLAGS) $(INC) ${src}
> >
> >  
> >  # For RVCTCYGWIN CC_FLAGS must be first to work around pathing 
> > issues
> >  "$(CC)" $(CC_FLAGS) -c -o ${dst} $(INC) ${src}
> >
> > diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py
> > b/BaseTools/Source/Python/AutoGen/GenMake.py
> > index b441817b52..04951346ad 100644
> > --- a/BaseTools/Source/Python/AutoGen/GenMake.py
> > +++ b/BaseTools/Source/Python/AutoGen/GenMake.py
> > @@ -433,11 +433,11 @@ cleanlib:
> >  self.BuildTargetList = []   # [target string]
> >  self.PendingBuildTargetList = []# [FileBuildRule objects]
> >  self.CommonFileDependency = []
> >  self.FileListMacros = {}
> >  self.ListFileMacros = {}
> > -
> > +self.ObjTargetDict = {}
> >  self.FileCache = {}
> >  self.LibraryBuildCommandList = []
> >  self.LibraryFileList = []
> >  self.LibraryMakefileList = []
> >  self.LibraryBuildDirectoryList = [] @@ -616,10 +616,15 @@
> > cleanlib:
> >  ListFileName,
> >  "\n".join(self.ListFileMacros[ListFileMacro]),
> >  False
> >  )
> >
> > +# Generate objlist used to create .obj file
> > +for Type in self.ObjTargetDict:
> > +NewLine = ' '.join(list(self.ObjTargetDict[Type]))
> > +FileMacroList.append("OBJLIST_%s = %s" %
> > + (list(self.ObjTargetDict.keys()).index(Type), NewLine))
> > +
> >  BcTargetList = []
> >
> >  MakefileName = self._FILE_NAME_[self._FileType]
> >  LibraryMakeCommandList = []
> >  for D in self.LibraryBuildDirectoryList:
> > @@ -925,17 +930,22 @@ cleanlib:
> >  # Extract common files list in the dependency files
> >  #
> >  for File in DepSet:

Re: [edk2] [PATCH V7 00/17] Add new APIs DebugVPrint for DebugLib

2019-03-31 Thread Gao, Liming
Reviewed-by: Liming Gao  for this serial.

>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Zhichao Gao
>Sent: Monday, April 01, 2019 9:08 AM
>To: edk2-devel@lists.01.org
>Cc: Bret Barkelew ; Wu, Hao A
>; Justen, Jordan L ;
>Michael Turner ; Gao, Liming
>; Kinney, Michael D ;
>Laszlo Ersek ; Zeng, Star 
>Subject: [edk2] [PATCH V7 00/17] Add new APIs DebugVPrint for DebugLib
>
>Add a new API DebugVPrint to all the instances of DebugLib.
>This API is added to provide a function who want to implement
>special debug function with '...' parameter.
>Add a PEIM to install gEdkiiDebugPpiGuid, and implement a PEI
>debug library instance base on it. All PEIMs except pei core
>type can use the PeiDebugLibDebugPpi to reduce its image size.
>
>V2:
>Remove redundant code in DebugPrint.
>Fix some coding sytle issues.
>Remove some unenforced descirption in the comments of DebugVPrint.
>
>V3:
>Add the new API DebugBPrint, it is more useful for consumers which
>are care of compatible issue.
>Change the interface in gEdkiiDebugPpiGuid. VA_LIST is inappropriate
>to appeared in protocol or ppi because different compilers compile
>it to different type. It may be a pointer or a structure.
>
>V4:
>Sync the implement on MdeModulePkg/PeiDxeDebugLibReportStatusCode
>to
>IntelFramworkModulePkg/PeiDxeDebugLibReportStatusCode. While the
>format
>string is too long just truncate it instead of return.
>Fix and update some functions' comments.
>
>V5:
>Correct some comments of inf file.
>Put all implement into one C file for DebugServicePei.
>Use the directly return instead of CpuDeadLoop in PeiDebugLibDebugPpi.
>Rename the mDebugPpi to mEdkiiDebugPpi because it has a same name in
>DeubServicePpi.
>
>V6: Changed patch 16/17
>Remove the global variable and use the local variable insteaded.
>Because PEIM may run in the flash which is read only. The global variable
>cannot
>be changed at this situation.
>Update the description of PeiDebugLibDebugPpi.inf.
>
>V7: Changed patch 16/17
>Generate a Breakpoint, DeadLoop, or NOP based on
>PCD(PcdDebugPropertyMask) settings
>while do not locate the gEdkiiDebugPpiGuid.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Zhichao Gao 
>Cc: Michael D Kinney 
>Cc: Leif Lindholm 
>Cc: Ard Biesheuvel 
>Cc: Jordan Justen 
>Cc: Laszlo Ersek 
>Cc: Chasel Chiu 
>Cc: Nate DeSimone 
>Cc: Star Zeng 
>Cc: Nate DeSimone 
>Cc: Jian J Wang 
>Cc: Hao Wu 
>Cc: Ray Ni 
>Cc: Liming Gao 
>Cc: Sean Brogan 
>Cc: Michael Turner 
>Cc: Bret Barkelew 
>
>Bret Barkelew (13):
>  MdePkg/DebugLib.h: Add new APIs for DebugLib
>  MdePkg/BaseDebugLibNull: Add new APIs for DebugLib
>  MdePkg/BaseDebugLibSerialPort: Add new APIs
>  MdePkg/UefidebugLibConOut: Add new APIs
>  MdePkg/UefiDebugLibStdErr: Add new APIs
>  MdePkg/DxeRuntimeDebugLibSerialPort: Add new APIs
>  MdePkg/UefiDebuglibDebugPortProtocol: Add new APIs
>  ArmPkg/SemiHostingDebugLib: Add new APIs
>  OvmfPkg/PlatformDebugLibIoPort: Add new APIs
>  IntelFsp2Pkg/BaseFspDebugLibSerialPort: Add new APIs
>  IntelFspPkg/BaseFspDebugLibSerialPort: Add new APIs
>  IntelFramworkModulePkg/PeiDxeDebugLibReportStatusCode: Add new APIs
>  MdeModulePkg/PeiDxeDebugLibReportStatusCode: Add new APIs
>
>Liming Gao (1):
>  MdeModulePkg/PeiDebugLibDebugPpi: Add PEI debug lib
>
>Zhichao Gao (3):
>  MdeModulePkg: Add definitions for EDKII DEBUG PPI
>  MdeModulePkg: Add a PEIM to install Debug PPI
>  MdeModulePkg: Add PEIM and lib to dsc file
>
> ArmPkg/Library/SemiHostingDebugLib/DebugLib.c | 106 +++-
> .../PeiDxeDebugLibReportStatusCode/DebugLib.c | 179 +--
> .../BaseFspDebugLibSerialPort/DebugLib.c  | 103 +++-
> .../BaseFspDebugLibSerialPort/DebugLib.c  | 103 +++-
> MdeModulePkg/Include/Ppi/Debug.h  |  82 
> .../Library/PeiDebugLibDebugPpi/DebugLib.c| 460 ++
> .../PeiDebugLibDebugPpi.inf   |  64 +++
> .../PeiDxeDebugLibReportStatusCode/DebugLib.c | 177 +--
> MdeModulePkg/MdeModulePkg.dec |   3 +
> MdeModulePkg/MdeModulePkg.dsc |   3 +
> .../Universal/DebugServicePei/DebugService.h  |  56 +++
> .../DebugServicePei/DebugServicePei.c | 100 
> .../DebugServicePei/DebugServicePei.inf   |  51 ++
> .../DebugServicePei/DebugServicePei.uni   |  20 +
> MdePkg/Include/Library/DebugLib.h |  52 +-
> MdePkg/Library/BaseDebugLibNull/DebugLib.c|  56 ++-
> .../Library/BaseDebugLibSerialPort/DebugLib.c | 106 +++-
> .../DxeRuntimeDebugLibSerialPort/DebugLib.c   | 106 +++-
> MdePkg/Library/UefiDebugLibConOut/DebugLib.c  | 106 +++-
> .../UefiDebugLibDebu

Re: [edk2] [PATCH V6 16/17] MdeModulePkg/PeiDebugLibDebugPpi: Add PEI debug lib

2019-03-31 Thread Gao, Liming
Zhichao:
  DebugAssert() implementation should be DeadLoop() or Break() bases on PCD 
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask when PPI is not loaded. 

Thanks
Liming
>-Original Message-
>From: Gao, Zhichao
>Sent: Monday, April 01, 2019 7:50 AM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming ; Wang, Jian J
>; Wu, Hao A ; Ni, Ray
>; Zeng, Star ; Sean Brogan
>; Michael Turner
>; Bret Barkelew
>
>Subject: [PATCH V6 16/17] MdeModulePkg/PeiDebugLibDebugPpi: Add PEI
>debug lib
>
>From: Liming Gao 
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1549
>
>Add a PEI debug library instance PeiDebugLibDebugPpi base on
>DebugPpi. Using the combination of the DebugServicePei and
>this lib instance can reduce the image size of PEI drivers.
>
>Notes: this library instance can be used only the PEIM
>DebugSerivicePei is runed and install the gEdkiiDebugPpiGuid.
>And this library contian the depx of gEfiPeiPcdPpiGuid, that
>means the PcdPei.inf cannot use this library instance. The
>PcdPei.inf should use the same library instance that the
>PEIM DebugServicePei consumes.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Zhichao Gao 
>Cc: Jian J Wang 
>Cc: Hao Wu 
>Cc: Ray Ni 
>Cc: Star Zeng 
>Cc: Liming Gao 
>Cc: Sean Brogan 
>Cc: Michael Turner 
>Cc: Bret Barkelew 
>---
> .../Library/PeiDebugLibDebugPpi/DebugLib.c| 452 ++
> .../PeiDebugLibDebugPpi.inf   |  63 +++
> 2 files changed, 515 insertions(+)
> create mode 100644
>MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c
> create mode 100644
>MdeModulePkg/Library/PeiDebugLibDebugPpi/PeiDebugLibDebugPpi.inf
>
>diff --git a/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c
>b/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c
>new file mode 100644
>index 00..84ba896b53
>--- /dev/null
>+++ b/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c
>@@ -0,0 +1,452 @@
>+/** @file
>+  PEI debug lib instance base on gEdkiiDebugPpiGuid to save PEIM size.
>+
>+  Copyright (c) 2019, Intel Corporation. All rights reserved.
>+
>+  This program and the accompanying materials
>+  are licensed and made available under the terms and conditions of the BSD
>License
>+  which accompanies this distribution.  The full text of the license may be
>found at
>+  http://opensource.org/licenses/bsd-license.php
>+
>+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
>BASIS,
>+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
>EXPRESS OR IMPLIED.
>+
>+**/
>+
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+
>+/**
>+  Prints a debug message to the debug output device if the specified
>+  error level is enabled.
>+
>+  If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
>+  GetDebugPrintErrorLevel (), then print the message specified by Format
>and
>+  the associated variable argument list to the debug output device.
>+
>+  If Format is NULL, then ASSERT().
>+
>+  @param  ErrorLevelThe error level of the debug message.
>+  @param  FormatFormat string for the debug message to print.
>+  @param  ...   Variable argument list whose contents are accessed
>+based on the format string specified by Format.
>+
>+**/
>+VOID
>+EFIAPI
>+DebugPrint (
>+  IN  UINTNErrorLevel,
>+  IN  CONST CHAR8  *Format,
>+  ...
>+  )
>+{
>+  VA_LIST Marker;
>+
>+  VA_START (Marker, Format);
>+  DebugVPrint (ErrorLevel, Format, Marker);
>+  VA_END (Marker);
>+}
>+
>+
>+/**
>+  Prints a debug message to the debug output device if the specified
>+  error level is enabled.
>+  This function use BASE_LIST which would provide a more compatible
>+  service than VA_LIST.
>+
>+  If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
>+  GetDebugPrintErrorLevel (), then print the message specified by Format
>and
>+  the associated variable argument list to the debug output device.
>+
>+  If Format is NULL, then ASSERT().
>+
>+  @param  ErrorLevel  The error level of the debug message.
>+  @param  Format  Format string for the debug message to print.
>+  @param  BaseListMarker  BASE_LIST marker for the variable argument list.
>+
>+**/
>+VOID
>+EFIAPI
>+DebugBPrint (
>+  IN  UINTN ErrorLevel,
>+  IN  CONST CHAR8   *Format,
>+  IN  BASE_LIST BaseListMarker
>+  )
>+{
>+  EFI_STATUS  Status;
>+  EDKII_DEBUG_PPI *DebugPpi;
>+
>+  //
>+  // If Format is NULL, then ASSERT().
>+  //
>+  ASSERT (Format != NULL);
>+
>+

Re: [edk2] [Patch] BaseTools:Enable the /MP option of MSVC compiler

2019-03-29 Thread Gao, Liming
Bob:
  How about use /MP option without process number? The compiler will retrieves 
the number of effective processors on your computer. 
  And, move this option into CC_FLAGS in tools_def.txt. If so, platform can 
override it in platform DSC file. 

  Last, please provide the performance data with this option. 

Thanks
Liming
> -Original Message-
> From: Feng, Bob C
> Sent: Friday, March 29, 2019 8:30 PM
> To: edk2-devel@lists.01.org
> Cc: Fan, ZhijuX ; Feng, Bob C ; 
> Gao, Liming 
> Subject: [Patch] BaseTools:Enable the /MP option of MSVC compiler
> 
> From: Zhiju Fan 
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1672
> The /MP option of MSVC compiler can reduce the total
> time to compile the source files on the command line.
> 
> This patch is going to enable this MSVC option in BaseTools.
> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhiju.Fan 
> ---
>  BaseTools/Conf/build_rule.template |  2 +-
>  BaseTools/Source/Python/AutoGen/GenMake.py | 81 --
>  2 files changed, 75 insertions(+), 8 deletions(-)
> 
> diff --git a/BaseTools/Conf/build_rule.template 
> b/BaseTools/Conf/build_rule.template
> index e56b1d9c59..e7d736740f 100755
> --- a/BaseTools/Conf/build_rule.template
> +++ b/BaseTools/Conf/build_rule.template
> @@ -127,11 +127,11 @@
> 
>  
>  $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
> 
>  
> -"$(CC)" /Fo${dst} $(CC_FLAGS) $(INC) ${src}
> +"$(CC)" /MP7 /Fo${d_path}\ $(CC_FLAGS) $(INC) ${src}
> 
>  
>  # For RVCTCYGWIN CC_FLAGS must be first to work around pathing issues
>  "$(CC)" $(CC_FLAGS) -c -o ${dst} $(INC) ${src}
> 
> diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py 
> b/BaseTools/Source/Python/AutoGen/GenMake.py
> index b441817b52..04951346ad 100644
> --- a/BaseTools/Source/Python/AutoGen/GenMake.py
> +++ b/BaseTools/Source/Python/AutoGen/GenMake.py
> @@ -433,11 +433,11 @@ cleanlib:
>  self.BuildTargetList = []   # [target string]
>  self.PendingBuildTargetList = []# [FileBuildRule objects]
>  self.CommonFileDependency = []
>  self.FileListMacros = {}
>  self.ListFileMacros = {}
> -
> +self.ObjTargetDict = {}
>  self.FileCache = {}
>  self.LibraryBuildCommandList = []
>  self.LibraryFileList = []
>  self.LibraryMakefileList = []
>  self.LibraryBuildDirectoryList = []
> @@ -616,10 +616,15 @@ cleanlib:
>  ListFileName,
>  "\n".join(self.ListFileMacros[ListFileMacro]),
>  False
>  )
> 
> +# Generate objlist used to create .obj file
> +for Type in self.ObjTargetDict:
> +NewLine = ' '.join(list(self.ObjTargetDict[Type]))
> +FileMacroList.append("OBJLIST_%s = %s" % 
> (list(self.ObjTargetDict.keys()).index(Type), NewLine))
> +
>  BcTargetList = []
> 
>  MakefileName = self._FILE_NAME_[self._FileType]
>  LibraryMakeCommandList = []
>  for D in self.LibraryBuildDirectoryList:
> @@ -925,17 +930,22 @@ cleanlib:
>  # Extract common files list in the dependency files
>  #
>  for File in DepSet:
>  self.CommonFileDependency.append(self.PlaceMacro(File.Path, 
> self.Macros))
> 
> +CmdSumDict = {}
> +CmdTargetDict = {}
> +CmdCppDict = {}
> +DependencyDict = FileDependencyDict.copy()
>  for File in FileDependencyDict:
>  # skip non-C files
>  if File.Ext not in [".c", ".C"] or File.Name == "AutoGen.c":
>  continue
>  NewDepSet = set(FileDependencyDict[File])
>  NewDepSet -= DepSet
>  FileDependencyDict[File] = ["$(COMMON_DEPS)"] + list(NewDepSet)
> +DependencyDict[File] = list(NewDepSet)
> 
>  # Convert target description object to target string in makefile
>  for Type in self._AutoGenObject.Targets:
>  for T in self._AutoGenObject.Targets[Type]:
>  # Generate related macros if needed
> @@ -943,15 +953,25 @@ cleanlib:
>  self.FileListMacros[T.FileListMacro] = []
>  if T.GenListFile and T.ListFileMacro not in 
> self.ListFileMacros:
>  self.ListFileMacros[T.ListFileMacro] = []
>  if T.GenIncListFile and T.IncListFileMacro not in 
> self.ListFileMacros:
>  self.ListFileMacros[T.IncListFileMacro] = []
&

Re: [edk2] [Patch] BaseTools: Fixed issue in MultiThread Genfds function

2019-03-29 Thread Gao, Liming
Yes. Please submit one BZ for it. 

> -Original Message-
> From: Feng, Bob C
> Sent: Friday, March 29, 2019 8:40 PM
> To: Gao, Liming ; edk2-devel@lists.01.org
> Subject: RE: [Patch] BaseTools: Fixed issue in MultiThread Genfds function
> 
> That will impact the original GenFds since the command is generate by reusing 
> the GenFds functions. What about enter a new BZ to do
> that change?
> 
> Thanks,
> Bob
> 
> -Original Message-
> From: Gao, Liming
> Sent: Friday, March 29, 2019 8:33 PM
> To: Feng, Bob C ; edk2-devel@lists.01.org
> Subject: RE: [Patch] BaseTools: Fixed issue in MultiThread Genfds function
> 
> Bob:
>   Could you update the rule to depend on EFI image from DEBUG_DIR? I would 
> like to remove the additional copy from DEBUG dir to
> OUTPUT dir and save the disk and performance.
> 
> $(FFS_OUTPUT_DIR)\$(MODULE_GUID)SEC2.1.1.1.pe32 : $(DEBUG_DIR)\LogoDxe.efi
>   GenSec -s EFI_SECTION_PE32 -o 
> $(FFS_OUTPUT_DIR)\$(MODULE_GUID)SEC2.1.1.1.pe32 $(DEBUG_DIR)\LogoDxe.efi
> 
> Thanks
> Liming
> > -----Original Message-
> > From: Feng, Bob C
> > Sent: Friday, March 29, 2019 8:00 PM
> > To: Gao, Liming ; edk2-devel@lists.01.org
> > Subject: RE: [Patch] BaseTools: Fixed issue in MultiThread Genfds
> > function
> >
> > That's to fix the issue that make will fail if enable multiple thread 
> > genfds.
> >
> > For example, If enable Multiple thread Genfds, there will be GenSec command 
> > in the Makefile like below.
> >
> > $(FFS_OUTPUT_DIR)\$(MODULE_GUID)SEC2.1.1.1.pe32 : $(OUTPUT_DIR)\LogoDxe.efi
> > GenSec -s EFI_SECTION_PE32 -o
> > $(FFS_OUTPUT_DIR)\$(MODULE_GUID)SEC2.1.1.1.pe32
> > $(OUTPUT_DIR)\LogoDxe.efi
> >
> >
> > The $(OUTPUT_DIR)\LogoDxe.efi is the dependency, but there is no make rule 
> > for $(OUTPUT_DIR)\LogoDxe.efi generated in the Makefile.
> > Make program does not know how to make $(OUTPUT_DIR)\LogoDxe.efi.  Make 
> > fails for this case.
> >
> > In the build_rule.txt, the $(OUTPUT_DIR)\ )(+)$(MODULE_NAME).efi   is 
> > generated by the command $(CP)
> > $(DEBUG_DIR)(+)$(MODULE_NAME).efi $(OUTPUT_DIR) under
> > Dynamic-Library-File section, so $(OUTPUT_DIR)\ )(+)$(MODULE_NAME).efi
> > should also be a output for Dynamic-Library-File
> >
> > Thanks,
> > Bob
> >
> > -Original Message-
> > From: Gao, Liming
> > Sent: Friday, March 29, 2019 7:42 PM
> > To: Feng, Bob C ; edk2-devel@lists.01.org
> > Subject: RE: [Patch] BaseTools: Fixed issue in MultiThread Genfds
> > function
> >
> > Bob:
> >   Could you list the more information on why update build_rule.txt?
> >
> > > -Original Message-
> > > From: Feng, Bob C
> > > Sent: Friday, March 29, 2019 7:07 PM
> > > To: edk2-devel@lists.01.org
> > > Cc: Feng, Bob C ; Gao, Liming
> > > 
> > > Subject: [Patch] BaseTools: Fixed issue in MultiThread Genfds
> > > function
> > >
> > > https://bugzilla.tianocore.org/show_bug.cgi?id=1450
> > > In the Multiple thread Genfds feature, build tool generates GenSec,
> > > GenFFS command in Makefile.
> > >
> > > The Non-Hii Driver does not generate .offset file for uni string
> > > offset, but the build tool has not knowledge about this in autogen
> > > phase. So in this patch, I add a check in Makefile for GenSec command.
> > > If the GenSec input file does not exist, the GenSec will not be
> > > called. And if GenSec command is not called, its output file, which
> > > is also the input file of GenFfs command, will also not exist.So for
> > > GenFfs command, I add a new command parameter -oi which means the
> > > input file is an optional input file which would not exist. so that
> > > I can generate GenFfs command with "-oi" parameter in Makefile.
> > >
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: Bob Feng 
> > > Cc: Liming Gao 
> > > ---
> > >  BaseTools/Conf/build_rule.template  | 14 +++---
> > >  BaseTools/Source/C/GenFfs/GenFfs.c  | 17 +++--
> > >  BaseTools/Source/Python/AutoGen/GenMake.py  |  2 +-
> > >  .../Python/GenFds/GenFdsGlobalVariable.py   | 10 +-
> > >  .../Source/Python/Workspace/DscBuildData.py |  3 +++
> > >  BaseTools/Source/Python/build/build.py  | 10 +-
> > >  6 files changed, 40 insertions(+), 16 deletions(-)
> > >
> > > diff --git a/BaseTools/Conf/

Re: [edk2] [Patch] BaseTools: Fixed issue in MultiThread Genfds function

2019-03-29 Thread Gao, Liming
Bob:
  Could you update the rule to depend on EFI image from DEBUG_DIR? I would like 
to remove the additional copy from DEBUG dir to OUTPUT dir and save the disk 
and performance. 

$(FFS_OUTPUT_DIR)\$(MODULE_GUID)SEC2.1.1.1.pe32 : $(DEBUG_DIR)\LogoDxe.efi
GenSec -s EFI_SECTION_PE32 -o 
$(FFS_OUTPUT_DIR)\$(MODULE_GUID)SEC2.1.1.1.pe32 $(DEBUG_DIR)\LogoDxe.efi

Thanks
Liming
> -Original Message-
> From: Feng, Bob C
> Sent: Friday, March 29, 2019 8:00 PM
> To: Gao, Liming ; edk2-devel@lists.01.org
> Subject: RE: [Patch] BaseTools: Fixed issue in MultiThread Genfds function
> 
> That's to fix the issue that make will fail if enable multiple thread genfds.
> 
> For example, If enable Multiple thread Genfds, there will be GenSec command 
> in the Makefile like below.
> 
> $(FFS_OUTPUT_DIR)\$(MODULE_GUID)SEC2.1.1.1.pe32 : $(OUTPUT_DIR)\LogoDxe.efi
>   GenSec -s EFI_SECTION_PE32 -o 
> $(FFS_OUTPUT_DIR)\$(MODULE_GUID)SEC2.1.1.1.pe32 $(OUTPUT_DIR)\LogoDxe.efi
> 
> 
> The $(OUTPUT_DIR)\LogoDxe.efi is the dependency, but there is no make rule 
> for $(OUTPUT_DIR)\LogoDxe.efi generated in the Makefile.
> Make program does not know how to make $(OUTPUT_DIR)\LogoDxe.efi.  Make fails 
> for this case.
> 
> In the build_rule.txt, the $(OUTPUT_DIR)\ )(+)$(MODULE_NAME).efi   is 
> generated by the command $(CP)
> $(DEBUG_DIR)(+)$(MODULE_NAME).efi $(OUTPUT_DIR) under Dynamic-Library-File 
> section, so $(OUTPUT_DIR)\ )(+)$(MODULE_NAME).efi
> should also be a output for Dynamic-Library-File
> 
> Thanks,
> Bob
> 
> -Original Message-
> From: Gao, Liming
> Sent: Friday, March 29, 2019 7:42 PM
> To: Feng, Bob C ; edk2-devel@lists.01.org
> Subject: RE: [Patch] BaseTools: Fixed issue in MultiThread Genfds function
> 
> Bob:
>   Could you list the more information on why update build_rule.txt?
> 
> > -Original Message-----
> > From: Feng, Bob C
> > Sent: Friday, March 29, 2019 7:07 PM
> > To: edk2-devel@lists.01.org
> > Cc: Feng, Bob C ; Gao, Liming
> > 
> > Subject: [Patch] BaseTools: Fixed issue in MultiThread Genfds function
> >
> > https://bugzilla.tianocore.org/show_bug.cgi?id=1450
> > In the Multiple thread Genfds feature, build tool generates GenSec,
> > GenFFS command in Makefile.
> >
> > The Non-Hii Driver does not generate .offset file for uni string
> > offset, but the build tool has not knowledge about this in autogen
> > phase. So in this patch, I add a check in Makefile for GenSec command.
> > If the GenSec input file does not exist, the GenSec will not be
> > called. And if GenSec command is not called, its output file, which is
> > also the input file of GenFfs command, will also not exist.So for
> > GenFfs command, I add a new command parameter -oi which means the
> > input file is an optional input file which would not exist. so that I
> > can generate GenFfs command with "-oi" parameter in Makefile.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Bob Feng 
> > Cc: Liming Gao 
> > ---
> >  BaseTools/Conf/build_rule.template  | 14 +++---
> >  BaseTools/Source/C/GenFfs/GenFfs.c  | 17 +++--
> >  BaseTools/Source/Python/AutoGen/GenMake.py  |  2 +-
> >  .../Python/GenFds/GenFdsGlobalVariable.py   | 10 +-
> >  .../Source/Python/Workspace/DscBuildData.py |  3 +++
> >  BaseTools/Source/Python/build/build.py  | 10 +-
> >  6 files changed, 40 insertions(+), 16 deletions(-)
> >
> > diff --git a/BaseTools/Conf/build_rule.template
> > b/BaseTools/Conf/build_rule.template
> > index e56b1d9c59..8cd7d0e445 100755
> > --- a/BaseTools/Conf/build_rule.template
> > +++ b/BaseTools/Conf/build_rule.template
> > @@ -357,16 +357,16 @@
> >  [Dynamic-Library-File]
> >  
> >  ?.dll
> >
> >  
> > -$(DEBUG_DIR)(+)$(MODULE_NAME).efi
> > +$(DEBUG_DIR)(+)$(MODULE_NAME).efi
> > + $(OUTPUT_DIR)(+)$(MODULE_NAME).efi
> >
> >  
> >  "$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS)
> > -$(CP) ${dst} $(OUTPUT_DIR)
> > -$(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi
> > +$(CP) $(DEBUG_DIR)(+)$(MODULE_NAME).efi $(OUTPUT_DIR)
> > +$(CP) $(DEBUG_DIR)(+)$(MODULE_NAME).efi
> > + $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi
> >  -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)
> >  -$(CP) $(DEBUG_DIR)(+)*.pdb $(OUTPUT_DIR)
> >  
> >  $(CP) ${src} $(DEBUG_DIR)(+)$(MODULE_NAME).debug
> >  $(OBJCOPY) --strip-

Re: [edk2] [PATCH V3] BaseTools:Trim will trig exception when input asl UTF8 format file

2019-03-29 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: Fan, ZhijuX
> Sent: Thursday, March 28, 2019 11:21 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming ; Feng, Bob C 
> Subject: [edk2][PATCH V3] BaseTools:Trim will trig exception when input asl 
> UTF8 format file
> 
> BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1641
> 
> The command trim --asl-file -o test.i UTF8.asl will trig the exception.
> There's a problem with the encoding of the file,it only appears in python3.
> I changed the way I opened it to support reading this file
> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhiju.Fan 
> ---
>  BaseTools/Source/Python/Trim/Trim.py | 44 
> +---
>  1 file changed, 21 insertions(+), 23 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Trim/Trim.py 
> b/BaseTools/Source/Python/Trim/Trim.py
> index 228779b5a9..05feab6abe 100644
> --- a/BaseTools/Source/Python/Trim/Trim.py
> +++ b/BaseTools/Source/Python/Trim/Trim.py
> @@ -18,7 +18,7 @@ import Common.LongFilePathOs as os
>  import sys
>  import re
>  from io import BytesIO
> -
> +import codecs
>  from optparse import OptionParser
>  from optparse import make_option
>  from Common.BuildToolError import *
> @@ -77,14 +77,11 @@ gIncludedAslFile = []
>  def TrimPreprocessedFile(Source, Target, ConvertHex, TrimLong):
>  CreateDirectory(os.path.dirname(Target))
>  try:
> -f = open (Source, 'r')
> +with open(Source, "r") as File:
> +Lines = File.readlines()
>  except:
>  EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
> 
> -# read whole file
> -Lines = f.readlines()
> -f.close()
> -
>  PreprocessedFile = ""
>  InjectedFile = ""
>  LineIndexOfOriginalFile = None
> @@ -181,11 +178,10 @@ def TrimPreprocessedFile(Source, Target, ConvertHex, 
> TrimLong):
> 
>  # save to file
>  try:
> -f = open (Target, 'w')
> +with open(Target, 'w') as File:
> +File.writelines(NewLines)
>  except:
>  EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
> -f.writelines(NewLines)
> -f.close()
> 
>  ## Trim preprocessed VFR file
>  #
> @@ -199,12 +195,11 @@ def TrimPreprocessedVfr(Source, Target):
>  CreateDirectory(os.path.dirname(Target))
> 
>  try:
> -f = open (Source, 'r')
> +with open(Source, "r") as File:
> +Lines = File.readlines()
>  except:
>  EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
>  # read whole file
> -Lines = f.readlines()
> -f.close()
> 
>  FoundTypedef = False
>  Brace = 0
> @@ -248,11 +243,10 @@ def TrimPreprocessedVfr(Source, Target):
> 
>  # save all lines trimmed
>  try:
> -f = open (Target, 'w')
> +with open(Target, 'w') as File:
> +File.writelines(Lines)
>  except:
>  EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
> -f.writelines(Lines)
> -f.close()
> 
>  ## Read the content  ASL file, including ASL included, recursively
>  #
> @@ -278,7 +272,12 @@ def DoInclude(Source, Indent='', IncludePathList=[], 
> LocalSearchPath=None):
>  for IncludePath in SearchPathList:
>  IncludeFile = os.path.join(IncludePath, Source)
>  if os.path.isfile(IncludeFile):
> -F = open(IncludeFile, "r")
> +try:
> +with open(IncludeFile, "r") as File:
> +F = File.readlines()
> +except:
> +with codecs.open(IncludeFile, "r", encoding='utf-8') as 
> File:
> +F = File.readlines()
>  break
>  else:
>  EdkLogger.error("Trim", "Failed to find include file %s" % 
> Source)
> @@ -313,7 +312,6 @@ def DoInclude(Source, Indent='', IncludePathList=[], 
> LocalSearchPath=None):
>  NewFileContent.append("\n")
> 
>  gIncludedAslFile.pop()
> -F.close()
> 
>  return NewFileContent
> 
> @@ -345,7 +343,9 @@ def TrimAslFile(Source, Target, IncludePathFile):
>  if IncludePathFile:
>  try:
>  LineNum = 0
> -for Line in open(IncludePathFile, 'r'):
> +with open(IncludePathFile, 'r') as File:
> +FileLines = File.readlines()
> +for Line in FileLines:
>  LineNum

Re: [edk2] [PATCH V2 0/2] Change reset logic related on capsule

2019-03-29 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: Gao, Zhichao
> Sent: Friday, March 22, 2019 11:07 AM
> To: edk2-devel@lists.01.org
> Cc: Wang, Jian J ; Wu, Hao A ; Ni, 
> Ray ; Zeng, Star
> ; Gao, Liming ; Ard Biesheuvel 
> 
> Subject: [PATCH V2 0/2] Change reset logic related on capsule
> 
> Add CapsuleCacheWriteBack for IA ARCH before runtime.
> Remove DoS3 in ResetSystemRuntimeDxe.
> 
> V2:
> Adjust the code that would not change the logic of arm ARCH.
> Fix some build errors because of type convertion.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhichao Gao 
> Cc: Jian J Wang 
> Cc: Hao Wu 
> Cc: Ray Ni 
> Cc: Star Zeng 
> Cc: Liming Gao 
> Cc: Ard Biesheuvel 
> 
> Zhichao Gao (2):
>   MdeModulePkg/CapsuleRuntimeDxe: IA32 add cache flush function
>   MdeModulePkg/ResetSystemRuntimeDxe: Remove DoS3 in warm reset
> 
>  .../Universal/CapsuleRuntimeDxe/Arm/CapsuleReset.c | 35 +---
>  .../Universal/CapsuleRuntimeDxe/CapsuleCache.c | 63 
> ++
>  .../Universal/CapsuleRuntimeDxe/CapsuleCacheNull.c | 38 +
>  .../Universal/CapsuleRuntimeDxe/CapsuleReset.c | 16 +-
>  .../CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf| 20 ---
>  .../Universal/ResetSystemRuntimeDxe/ResetSystem.c  | 38 -
>  6 files changed, 115 insertions(+), 95 deletions(-)
>  create mode 100644 MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleCache.c
>  create mode 100644 
> MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleCacheNull.c
> 
> --
> 2.16.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v3 00/12] Remove .S files for IA32 and X64 arch in MdePkg and UefiCpuPkg

2019-03-29 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: Zhang, Shenglei
> Sent: Friday, March 29, 2019 3:28 PM
> To: edk2-devel@lists.01.org
> Cc: Kinney, Michael D ; Gao, Liming 
> ; Dong, Eric ; Ni, Ray
> 
> Subject: [PATCH v3 00/12] Remove .S files for IA32 and X64 arch in MdePkg and 
> UefiCpuPkg
> 
> .nasm file has been added for X86 arch. .S assembly code
> is not required any more.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1594
> 
> v2: Remove some description in 04/10.
> 
> v3: Add 11/12 and 12/12.
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Eric Dong 
> Cc: Ray Ni 
> Shenglei Zhang (12):
>   UefiCpuPkg/SmmCpuFeaturesLib: Remove .S files for IA32 and X64 arch
>   UefiCpuPkg/BaseUefiCpuLib: Remove .S files for IA32 and X64 arch
>   UefiCpuPkg/CpuExceptionHandlerLib:Remove.S files for IA32 and X64 arch
>   MdePkg/BaseCpuLib: Remove .S files for IA32 and X64 arch
>   MdePkg/BaseLib: Remove .S files for IA32 and X64 arch
>   MdePkg/BaseMemoryLibMmx: Remove .S files for IA32 and X64 arch
>   MdePkg/BaseMemoryLibOptDxe: Remove .S files for IA32 and X64 arch
>   MdePkg/BaseMemoryLibOptPei: Remove .S files for IA32 and X64 arch
>   MdePkg/BaseMemoryLibRepStr: Remove .S files for IA32 and X64 arch
>   MdePkg/BaseMemoryLibSse2: Remove .S files for IA32 and X64 arch
>   CryptoPkg/IntrinsicLib: Remove .S files for IA32 arch
>   SourceLevelDebugPkg/DebugAgentCommon: Remove .S files
> 
>  .../Library/IntrinsicLib/Ia32/MathLShiftS64.S |  62 --
>  .../Library/IntrinsicLib/Ia32/MathRShiftU64.S |  66 --
>  .../Library/IntrinsicLib/IntrinsicLib.inf |   2 -
>  MdePkg/Library/BaseCpuLib/BaseCpuLib.inf  |   4 -
>  MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.S   |  35 -
>  MdePkg/Library/BaseCpuLib/X64/CpuSleep.S  |  34 -
>  MdePkg/Library/BaseLib/BaseLib.inf|  38 -
>  MdePkg/Library/BaseLib/Ia32/ARShiftU64.S  |  43 --
>  MdePkg/Library/BaseLib/Ia32/CpuId.S   |  63 --
>  MdePkg/Library/BaseLib/Ia32/CpuIdEx.S |  67 --
>  MdePkg/Library/BaseLib/Ia32/DisableCache.S|  39 -
>  MdePkg/Library/BaseLib/Ia32/DisablePaging32.S |  52 --
>  MdePkg/Library/BaseLib/Ia32/DivU64x32.S   |  41 --
>  .../Library/BaseLib/Ia32/DivU64x32Remainder.S |  46 --
>  .../Library/BaseLib/Ia32/DivU64x64Remainder.S |  89 ---
>  MdePkg/Library/BaseLib/Ia32/EnableCache.S |  39 -
>  .../BaseLib/Ia32/EnableDisableInterrupts.S|  36 -
>  MdePkg/Library/BaseLib/Ia32/EnablePaging32.S  |  52 --
>  MdePkg/Library/BaseLib/Ia32/EnablePaging64.S  |  63 --
>  .../BaseLib/Ia32/InternalSwitchStack.S|  48 --
>  MdePkg/Library/BaseLib/Ia32/LRotU64.S |  48 --
>  MdePkg/Library/BaseLib/Ia32/LShiftU64.S   |  43 --
>  MdePkg/Library/BaseLib/Ia32/LongJump.S|  41 --
>  MdePkg/Library/BaseLib/Ia32/ModU64x32.S   |  40 --
>  MdePkg/Library/BaseLib/Ia32/Monitor.S |  40 --
>  MdePkg/Library/BaseLib/Ia32/MultU64x32.S  |  41 --
>  MdePkg/Library/BaseLib/Ia32/MultU64x64.S  |  44 --
>  MdePkg/Library/BaseLib/Ia32/Mwait.S   |  38 -
>  MdePkg/Library/BaseLib/Ia32/RRotU64.S |  48 --
>  MdePkg/Library/BaseLib/Ia32/RShiftU64.S   |  46 --
>  MdePkg/Library/BaseLib/Ia32/RdRand.S  |  80 ---
>  MdePkg/Library/BaseLib/Ia32/SetJump.S |  44 --
>  MdePkg/Library/BaseLib/Ia32/SwapBytes64.S |  38 -
>  MdePkg/Library/BaseLib/Ia32/Thunk16.S | 222 --
>  MdePkg/Library/BaseLib/X64/CpuId.S|  60 --
>  MdePkg/Library/BaseLib/X64/CpuIdEx.S  |  62 --
>  MdePkg/Library/BaseLib/X64/DisableCache.S |  39 -
>  MdePkg/Library/BaseLib/X64/DisablePaging64.S  |  82 ---
>  MdePkg/Library/BaseLib/X64/EnableCache.S  |  39 -
>  .../BaseLib/X64/EnableDisableInterrupts.S |  36 -
>  MdePkg/Library/BaseLib/X64/LongJump.S |  54 --
>  MdePkg/Library/BaseLib/X64/RdRand.S   |  72 --
>  MdePkg/Library/BaseLib/X64/SetJump.S  |  53 --
>  MdePkg/Library/BaseLib/X64/SwitchStack.S  |  52 --
>  MdePkg/Library/BaseLib/X64/Thunk16.S  | 334 -
>  .../BaseMemoryLibMmx/BaseMemoryLibMmx.inf |  22 -
>  .../BaseMemoryLibMmx/Ia32/CompareMem.S|  55 --
>  .../Library/BaseMemoryLibMmx/Ia32/CopyMem.S   |  86 ---
>  .../Library/BaseMemoryLibMmx/Ia32/ScanMem16.S |  52 --
>  .../Library/BaseMemoryLibMmx/Ia32/ScanMem32.S |  52 --
>  .../Library/BaseMemoryLibMmx/Ia32/ScanMem64.S |  61 --
>  .../Library/BaseMemoryLibMmx/Ia32/ScanMem8.S  |  52 --
>  MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem.S |  66 --
>  .../Library/BaseMemoryLibMmx/Ia32/SetMem16.S  |  59 --
>  .../Library/BaseMemoryLibMmx/Ia32/SetMem32.S  |  52 --
>  .../Library/BaseMemoryLibMmx/Ia32/SetMem64.S  |  43 --
>  .../Library/BaseMemoryLibMmx/Ia32/ZeroMem.S

Re: [edk2] [Patch] BaseTools: Fixed issue in MultiThread Genfds function

2019-03-29 Thread Gao, Liming
Bob:
  Could you list the more information on why update build_rule.txt?

> -Original Message-
> From: Feng, Bob C
> Sent: Friday, March 29, 2019 7:07 PM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C ; Gao, Liming 
> Subject: [Patch] BaseTools: Fixed issue in MultiThread Genfds function
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1450
> In the Multiple thread Genfds feature, build tool generates
> GenSec, GenFFS command in Makefile.
> 
> The Non-Hii Driver does not generate .offset file for uni string offset,
> but the build tool has not knowledge about this in autogen phase. So
> in this patch, I add a check in Makefile for GenSec command. If the GenSec
> input file does not exist, the GenSec will not be called. And if GenSec
> command is not called, its output file, which is also the input file of
> GenFfs command, will also not exist.So for GenFfs command,
> I add a new command parameter -oi which means
> the input file is an optional input file which would not exist. so
> that I can generate GenFfs command with "-oi" parameter in Makefile.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> ---
>  BaseTools/Conf/build_rule.template  | 14 +++---
>  BaseTools/Source/C/GenFfs/GenFfs.c  | 17 +++--
>  BaseTools/Source/Python/AutoGen/GenMake.py  |  2 +-
>  .../Python/GenFds/GenFdsGlobalVariable.py   | 10 +-
>  .../Source/Python/Workspace/DscBuildData.py |  3 +++
>  BaseTools/Source/Python/build/build.py  | 10 +-
>  6 files changed, 40 insertions(+), 16 deletions(-)
> 
> diff --git a/BaseTools/Conf/build_rule.template 
> b/BaseTools/Conf/build_rule.template
> index e56b1d9c59..8cd7d0e445 100755
> --- a/BaseTools/Conf/build_rule.template
> +++ b/BaseTools/Conf/build_rule.template
> @@ -357,16 +357,16 @@
>  [Dynamic-Library-File]
>  
>  ?.dll
> 
>  
> -$(DEBUG_DIR)(+)$(MODULE_NAME).efi
> +$(DEBUG_DIR)(+)$(MODULE_NAME).efi $(OUTPUT_DIR)(+)$(MODULE_NAME).efi
> 
>  
>  "$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS)
> -$(CP) ${dst} $(OUTPUT_DIR)
> -$(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi
> +$(CP) $(DEBUG_DIR)(+)$(MODULE_NAME).efi $(OUTPUT_DIR)
> +$(CP) $(DEBUG_DIR)(+)$(MODULE_NAME).efi 
> $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi
>  -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)
>  -$(CP) $(DEBUG_DIR)(+)*.pdb $(OUTPUT_DIR)
>  
>  $(CP) ${src} $(DEBUG_DIR)(+)$(MODULE_NAME).debug
>  $(OBJCOPY) --strip-unneeded -R .eh_frame ${src}
> @@ -376,22 +376,22 @@
>  #
>  -$(OBJCOPY) $(OBJCOPY_ADDDEBUGFLAG) ${src}
>  -$(CP) $(DEBUG_DIR)(+)$(MODULE_NAME).debug 
> $(BIN_DIR)(+)$(MODULE_NAME_GUID).debug
> 
>  "$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS)
> -$(CP) ${dst} $(OUTPUT_DIR)
> -$(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi
> +$(CP) $(DEBUG_DIR)(+)$(MODULE_NAME).efi $(OUTPUT_DIR)
> +$(CP) $(DEBUG_DIR)(+)$(MODULE_NAME).efi 
> $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi
>  -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)
> 
>  
>  # tool to convert Mach-O to PE/COFF
>  "$(MTOC)" -subsystem $(MODULE_TYPE)  $(MTOC_FLAGS)  ${src}  
> $(DEBUG_DIR)(+)$(MODULE_NAME).pecoff
>  # create symbol file for GDB debug
>  -$(DSYMUTIL) ${src}
>  "$(GENFW)" -e $(MODULE_TYPE) -o ${dst} 
> $(DEBUG_DIR)(+)$(MODULE_NAME).pecoff $(GENFW_FLAGS)
> -$(CP) ${dst} $(OUTPUT_DIR)
> -$(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi
> +$(CP) $(DEBUG_DIR)(+)$(MODULE_NAME).efi $(OUTPUT_DIR)
> +$(CP) $(DEBUG_DIR)(+)$(MODULE_NAME).efi 
> $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi
>  -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)
> 
>  [Dependency-Expression-File]
>  
>  ?.dxs, ?.Dxs, ?.DXS
> diff --git a/BaseTools/Source/C/GenFfs/GenFfs.c 
> b/BaseTools/Source/C/GenFfs/GenFfs.c
> index 02c7ac30f0..ea36b22bef 100644
> --- a/BaseTools/Source/C/GenFfs/GenFfs.c
> +++ b/BaseTools/Source/C/GenFfs/GenFfs.c
> @@ -17,10 +17,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
> EXPRESS OR IMPLIED.
>  #include 
>  #include 
>  #include 
>  #endif
> 
> +#ifdef __GNUC__
> +#include 
> +#endif
> +
>  #include 
>  #include 
>  #include 
> 
>  #include 
> @@ -158,10 +162,12 @@ Returns:
>  FileAlign points to file alignment, which only 
> support\n\
>  the following align: 
> 1,2

Re: [edk2] [PATCH 00/10] Remove .S files for IA32 and X64 arch in MdePkg and UefiCpuPkg

2019-03-28 Thread Gao, Liming
Shenglei:
  There are still .S files in SourceLevelDebugPkg\Library\ and 
CryptoPkg\Library\IntrinsicLib directory. Please remove them.

  After remove them, please take 
https://bugzilla.tianocore.org/show_bug.cgi?id=881 to update nasm source code 
for XCODE optimization. 

Thanks
Liming
>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Shenglei Zhang
>Sent: Thursday, March 07, 2019 10:30 AM
>To: edk2-devel@lists.01.org
>Cc: Kinney, Michael D ; Laszlo Ersek
>; Dong, Eric ; Gao, Liming
>
>Subject: [edk2] [PATCH 00/10] Remove .S files for IA32 and X64 arch in
>MdePkg and UefiCpuPkg
>
>.nasm file has been added for X86 arch. .S assembly code
>is not required any more.
>https://bugzilla.tianocore.org/show_bug.cgi?id=1594
>
>Cc: Michael D Kinney 
>Cc: Liming Gao 
>Cc: Eric Dong 
>Cc: Ray Ni 
>Cc: Laszlo Ersek 
>Shenglei Zhang (10):
>  UefiCpuPkg/SmmCpuFeaturesLib: Remove .S files for IA32 and X64 arch
>  UefiCpuPkg/BaseUefiCpuLib: Remove .S files for IA32 and X64 arch
>  UefiCpuPkg/CpuExceptionHandlerLib:Remove.S files for IA32 and X64 arch
>  MdePkg/BaseCpuLib: Remove .S files for IA32 and X64 arch
>  MdePkg/BaseLib: Remove .S files for IA32 and X64 arch
>  MdePkg/BaseMemoryLibMmx: Remove .S files for IA32 and X64 arch
>  MdePkg/BaseMemoryLibOptDxe: Remove .S files for IA32 and X64 arch
>  MdePkg/BaseMemoryLibOptPei: Remove .S files for IA32 and X64 arch
>  MdePkg/BaseMemoryLibRepStr: Remove .S files for IA32 and X64 arch
>  MdePkg/BaseMemoryLibSse2: Remove .S files for IA32 and X64 arch
>
> MdePkg/Library/BaseCpuLib/BaseCpuLib.inf  |   2 -
> MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.S   |  35 -
> MdePkg/Library/BaseCpuLib/X64/CpuSleep.S  |  34 -
> MdePkg/Library/BaseLib/BaseLib.inf|  38 -
> MdePkg/Library/BaseLib/Ia32/ARShiftU64.S  |  43 --
> MdePkg/Library/BaseLib/Ia32/CpuId.S   |  63 --
> MdePkg/Library/BaseLib/Ia32/CpuIdEx.S |  67 --
> MdePkg/Library/BaseLib/Ia32/DisableCache.S|  39 -
> MdePkg/Library/BaseLib/Ia32/DisablePaging32.S |  52 --
> MdePkg/Library/BaseLib/Ia32/DivU64x32.S   |  41 --
> .../Library/BaseLib/Ia32/DivU64x32Remainder.S |  46 --
> .../Library/BaseLib/Ia32/DivU64x64Remainder.S |  89 ---
> MdePkg/Library/BaseLib/Ia32/EnableCache.S |  39 -
> .../BaseLib/Ia32/EnableDisableInterrupts.S|  36 -
> MdePkg/Library/BaseLib/Ia32/EnablePaging32.S  |  52 --
> MdePkg/Library/BaseLib/Ia32/EnablePaging64.S  |  63 --
> .../BaseLib/Ia32/InternalSwitchStack.S|  48 --
> MdePkg/Library/BaseLib/Ia32/LRotU64.S |  48 --
> MdePkg/Library/BaseLib/Ia32/LShiftU64.S   |  43 --
> MdePkg/Library/BaseLib/Ia32/LongJump.S|  41 --
> MdePkg/Library/BaseLib/Ia32/ModU64x32.S   |  40 --
> MdePkg/Library/BaseLib/Ia32/Monitor.S |  40 --
> MdePkg/Library/BaseLib/Ia32/MultU64x32.S  |  41 --
> MdePkg/Library/BaseLib/Ia32/MultU64x64.S  |  44 --
> MdePkg/Library/BaseLib/Ia32/Mwait.S   |  38 -
> MdePkg/Library/BaseLib/Ia32/RRotU64.S |  48 --
> MdePkg/Library/BaseLib/Ia32/RShiftU64.S   |  46 --
> MdePkg/Library/BaseLib/Ia32/RdRand.S  |  80 ---
> MdePkg/Library/BaseLib/Ia32/SetJump.S |  44 --
> MdePkg/Library/BaseLib/Ia32/SwapBytes64.S |  38 -
> MdePkg/Library/BaseLib/Ia32/Thunk16.S | 222 --
> MdePkg/Library/BaseLib/X64/CpuId.S|  60 --
> MdePkg/Library/BaseLib/X64/CpuIdEx.S  |  62 --
> MdePkg/Library/BaseLib/X64/DisableCache.S |  39 -
> MdePkg/Library/BaseLib/X64/DisablePaging64.S  |  82 ---
> MdePkg/Library/BaseLib/X64/EnableCache.S  |  39 -
> .../BaseLib/X64/EnableDisableInterrupts.S |  36 -
> MdePkg/Library/BaseLib/X64/LongJump.S |  54 --
> MdePkg/Library/BaseLib/X64/RdRand.S   |  72 --
> MdePkg/Library/BaseLib/X64/SetJump.S  |  53 --
> MdePkg/Library/BaseLib/X64/SwitchStack.S  |  52 --
> MdePkg/Library/BaseLib/X64/Thunk16.S  | 334 -
> .../BaseMemoryLibMmx/BaseMemoryLibMmx.inf |  22 -
> .../BaseMemoryLibMmx/Ia32/CompareMem.S|  55 --
> .../Library/BaseMemoryLibMmx/Ia32/CopyMem.S   |  86 ---
> .../Library/BaseMemoryLibMmx/Ia32/ScanMem16.S |  52 --
> .../Library/BaseMemoryLibMmx/Ia32/ScanMem32.S |  52 --
> .../Library/BaseMemoryLibMmx/Ia32/ScanMem64.S |  61 --
> .../Library/BaseMemoryLibMmx/Ia32/ScanMem8.S  |  52 --
> MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem.S |  66 --
> .../Library/BaseMemoryLibMmx/Ia32/SetMem16.S  |  59 --
> .../Library/BaseMemoryLibMmx/Ia32/SetMem32.S  |  52 --
> .../Library/BaseMemoryLibMmx/Ia32/SetMem64.S  |  43 --
> .../Library/BaseMemoryLibMmx/Ia32/ZeroMem.S   |  54 --
> .../Library/BaseMemoryLibMmx/X64/CompareMem.S |  59 --
> MdePkg/Library/BaseMemoryLi

Re: [edk2] [PATCH V2] BaseTools:Trim will trig exception when input asl UTF8 format file

2019-03-27 Thread Gao, Liming
What error message is reported?

>-Original Message-
>From: Fan, ZhijuX
>Sent: Thursday, March 28, 2019 10:13 AM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming ; Feng, Bob C 
>Subject: [edk2][PATCH V2] BaseTools:Trim will trig exception when input asl
>UTF8 format file
>
>BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1641
>
>The command trim --asl-file -o test.i UTF8.asl will trig the exception.
>Trim tool should report error message for unsupported UTF8 file instead
>of the exception.
>
>Cc: Bob Feng 
>Cc: Liming Gao 
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Zhiju.Fan 
>---
> BaseTools/Source/Python/Trim/Trim.py | 44 +
>---
> 1 file changed, 21 insertions(+), 23 deletions(-)
>
>diff --git a/BaseTools/Source/Python/Trim/Trim.py
>b/BaseTools/Source/Python/Trim/Trim.py
>index 228779b5a9..05feab6abe 100644
>--- a/BaseTools/Source/Python/Trim/Trim.py
>+++ b/BaseTools/Source/Python/Trim/Trim.py
>@@ -18,7 +18,7 @@ import Common.LongFilePathOs as os
> import sys
> import re
> from io import BytesIO
>-
>+import codecs
> from optparse import OptionParser
> from optparse import make_option
> from Common.BuildToolError import *
>@@ -77,14 +77,11 @@ gIncludedAslFile = []
> def TrimPreprocessedFile(Source, Target, ConvertHex, TrimLong):
> CreateDirectory(os.path.dirname(Target))
> try:
>-f = open (Source, 'r')
>+with open(Source, "r") as File:
>+Lines = File.readlines()
> except:
> EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
>
>-# read whole file
>-Lines = f.readlines()
>-f.close()
>-
> PreprocessedFile = ""
> InjectedFile = ""
> LineIndexOfOriginalFile = None
>@@ -181,11 +178,10 @@ def TrimPreprocessedFile(Source, Target,
>ConvertHex, TrimLong):
>
> # save to file
> try:
>-f = open (Target, 'w')
>+with open(Target, 'w') as File:
>+File.writelines(NewLines)
> except:
> EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
>-f.writelines(NewLines)
>-f.close()
>
> ## Trim preprocessed VFR file
> #
>@@ -199,12 +195,11 @@ def TrimPreprocessedVfr(Source, Target):
> CreateDirectory(os.path.dirname(Target))
>
> try:
>-f = open (Source, 'r')
>+with open(Source, "r") as File:
>+Lines = File.readlines()
> except:
> EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
> # read whole file
>-Lines = f.readlines()
>-f.close()
>
> FoundTypedef = False
> Brace = 0
>@@ -248,11 +243,10 @@ def TrimPreprocessedVfr(Source, Target):
>
> # save all lines trimmed
> try:
>-f = open (Target, 'w')
>+with open(Target, 'w') as File:
>+File.writelines(Lines)
> except:
> EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
>-f.writelines(Lines)
>-f.close()
>
> ## Read the content  ASL file, including ASL included, recursively
> #
>@@ -278,7 +272,12 @@ def DoInclude(Source, Indent='', IncludePathList=[],
>LocalSearchPath=None):
> for IncludePath in SearchPathList:
> IncludeFile = os.path.join(IncludePath, Source)
> if os.path.isfile(IncludeFile):
>-F = open(IncludeFile, "r")
>+try:
>+with open(IncludeFile, "r") as File:
>+F = File.readlines()
>+except:
>+with codecs.open(IncludeFile, "r", encoding='utf-8') as 
>File:
>+F = File.readlines()
> break
> else:
> EdkLogger.error("Trim", "Failed to find include file %s" % Source)
>@@ -313,7 +312,6 @@ def DoInclude(Source, Indent='', IncludePathList=[],
>LocalSearchPath=None):
> NewFileContent.append("\n")
>
> gIncludedAslFile.pop()
>-F.close()
>
> return NewFileContent
>
>@@ -345,7 +343,9 @@ def TrimAslFile(Source, Target, IncludePathFile):
> if IncludePathFile:
> try:
> LineNum = 0
>-for Line in open(IncludePathFile, 'r'):
>+with open(IncludePathFile, 'r') as File:
>+FileLines = File.readlines()
>+for Line in FileLines:
> LineNum += 1
> if Line.startswith("/I") or Line.startswith ("-I"):
> IncludePathList.append(Line[2:].strip())
>@@ -36

Re: [edk2] [PATCH V4 12/17] IntelFramworkModulePkg/PeiDxeDebugLibReportStatusCode: Add new APIs

2019-03-27 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: Gao, Zhichao
>Sent: Thursday, March 21, 2019 10:05 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming ; Sean Brogan
>; Michael Turner
>; Bret Barkelew
>
>Subject: [PATCH V4 12/17]
>IntelFramworkModulePkg/PeiDxeDebugLibReportStatusCode: Add new APIs
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1395
>
>Add new APIs' implementation (DebugVPrint, DebugBPrint)
>in the DebugLib instance. These APIs would expose print
>routines with VaList parameter and BaseList parameter.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Zhichao Gao 
>Cc: Liming Gao 
>Cc: Sean Brogan 
>Cc: Michael Turner 
>Cc: Bret Barkelew 
>---
> .../PeiDxeDebugLibReportStatusCode/DebugLib.c  | 173
>+
> 1 file changed, 145 insertions(+), 28 deletions(-)
>
>diff --git
>a/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/De
>bugLib.c
>b/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/De
>bugLib.c
>index b0445115a9..7ae4edb40d 100644
>---
>a/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/De
>bugLib.c
>+++
>b/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/De
>bugLib.c
>@@ -4,7 +4,7 @@
>   Note that if the debug message length is larger than the maximum allowable
>   record length, then the debug message will be ignored directly.
>
>-  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
>+  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
>   This program and the accompanying materials
>   are licensed and made available under the terms and conditions of the BSD
>License
>   which accompanies this distribution.  The full text of the license may be
>found at
>@@ -27,6 +27,12 @@
> #include 
> #include 
>
>+//
>+// VA_LIST can not initialize to NULL for all compiler, so we use this to
>+// indicate a null VA_LIST
>+//
>+VA_LIST mVaListNull;
>+
> /**
>   Prints a debug message to the debug output device if the specified error
>level is enabled.
>
>@@ -52,13 +58,49 @@ DebugPrint (
>   IN  CONST CHAR8  *Format,
>   ...
>   )
>+{
>+  VA_LIST Marker;
>+
>+  VA_START (Marker, Format);
>+  DebugVPrint (ErrorLevel, Format, Marker);
>+  VA_END (Marker);
>+}
>+
>+/**
>+  Prints a debug message to the debug output device if the specified
>+  error level is enabled base on Null-terminated format string and a
>+  VA_LIST argument list or a BASE_LIST argument list.
>+
>+  If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
>+  GetDebugPrintErrorLevel (), then print the message specified by Format
>and
>+  the associated variable argument list to the debug output device.
>+
>+  Only one list type is used.
>+  If BaseListMarker == NULL, then use VaListMarker.
>+  Otherwise use BaseListMarker and the VaListMarker should be initilized as
>+  mVaListNull.
>+
>+  If Format is NULL, then ASSERT().
>+
>+  @param  ErrorLevel  The error level of the debug message.
>+  @param  Format  Format string for the debug message to print.
>+  @param  VaListMarkerVA_LIST marker for the variable argument list.
>+  @param  BaseListMarker  BASE_LIST marker for the variable argument list.
>+
>+**/
>+VOID
>+DebugPrintMarker (
>+  IN  UINTN ErrorLevel,
>+  IN  CONST CHAR8   *Format,
>+  IN  VA_LIST   VaListMarker,
>+  IN  BASE_LIST BaseListMarker
>+  )
> {
>   UINT64  Buffer[(EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof (UINT64))
>+ 1];
>   EFI_DEBUG_INFO  *DebugInfo;
>   UINTN   TotalSize;
>   UINTN   DestBufferSize;
>-  VA_LIST VaListMarker;
>-  BASE_LIST   BaseListMarker;
>+  BASE_LIST   BaseListMarkerPointer;
>   CHAR8   *FormatString;
>   BOOLEAN Long;
>
>@@ -79,25 +121,25 @@ DebugPrint (
>   // Note that the passing-in format string and variable parameters will be
>constructed to
>   // the following layout:
>   //
>-  // Buffer->||
>-  // | Padding| 4 bytes
>-  //  DebugInfo->||
>-  // |  EFI_DEBUG_INFO| sizeof(EFI_DEBUG_INFO)
>-  // BaseListMarker->||
>-  // |   ...  |
>-  // |   variable arguments   | 12 * sizeof (UINT64)
>-  // |   ...  |
>-  // ||
>-  // |   Format String|
>-  // ||<- (UINT8 *)Buffer + 
>sizeof(Buffer)
>+

Re: [edk2] [PATCH V4 15/17] MdeModulePkg: Add a PEIM to install Debug PPI

2019-03-27 Thread Gao, Liming
Zhichao:
  One .c file is enough for this PEIM. You can implement all in one C file. 

Thanks
Liming
>-Original Message-
>From: Gao, Zhichao
>Sent: Thursday, March 21, 2019 10:05 PM
>To: edk2-devel@lists.01.org
>Cc: Wang, Jian J ; Wu, Hao A ;
>Ni, Ray ; Zeng, Star ; Gao, Liming
>; Sean Brogan ;
>Michael Turner ; Bret Barkelew
>
>Subject: [PATCH V4 15/17] MdeModulePkg: Add a PEIM to install Debug PPI
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1395
>
>Add a PEIM to install Debug PPI so that PEI debug library
>instance can locate gEdkiiDebugPpiGuid to implement the
>debug functions. Using this PPI can reduce the size of
>PEIMs which consume the debug library.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Zhichao Gao 
>Cc: Jian J Wang 
>Cc: Hao Wu 
>Cc: Ray Ni 
>Cc: Star Zeng 
>Cc: Liming Gao 
>Cc: Sean Brogan 
>Cc: Michael Turner 
>Cc: Bret Barkelew 
>---
> .../Universal/DebugServicePei/DebugService.c   | 60
>++
> .../Universal/DebugServicePei/DebugService.h   | 56
>
> .../Universal/DebugServicePei/DebugServicePei.c| 54
>+++
> .../Universal/DebugServicePei/DebugServicePei.inf  | 52
>+++
> .../Universal/DebugServicePei/DebugServicePei.uni  | 20 
> 5 files changed, 242 insertions(+)
> create mode 100644
>MdeModulePkg/Universal/DebugServicePei/DebugService.c
> create mode 100644
>MdeModulePkg/Universal/DebugServicePei/DebugService.h
> create mode 100644
>MdeModulePkg/Universal/DebugServicePei/DebugServicePei.c
> create mode 100644
>MdeModulePkg/Universal/DebugServicePei/DebugServicePei.inf
> create mode 100644
>MdeModulePkg/Universal/DebugServicePei/DebugServicePei.uni
>
>diff --git a/MdeModulePkg/Universal/DebugServicePei/DebugService.c
>b/MdeModulePkg/Universal/DebugServicePei/DebugService.c
>new file mode 100644
>index 00..a9ea14db81
>--- /dev/null
>+++ b/MdeModulePkg/Universal/DebugServicePei/DebugService.c
>@@ -0,0 +1,60 @@
>+/** @file
>+  Debug services instances for PEI phase.
>+
>+  Copyright (c) 2019, Intel Corporation. All rights reserved.
>+
>+  This program and the accompanying materials
>+  are licensed and made available under the terms and conditions of the BSD
>License
>+  which accompanies this distribution.  The full text of the license may be
>found at
>+  http://opensource.org/licenses/bsd-license.php
>+
>+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
>BASIS,
>+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
>EXPRESS OR IMPLIED.
>+
>+**/
>+
>+#include 
>+#include 
>+
>+/**
>+  Print a debug message to debug output device if the specified error level
>+  is enabled.
>+
>+  @param[in] ErrorLevel   The error level of the debug message.
>+  @param[in] Format   Format string for the debug message to 
>print.
>+  @param[in] Marker   BASE_LIST marker for the variable 
>argument
>list.
>+
>+**/
>+VOID
>+EFIAPI
>+PeiDebugBPrint(
>+  IN UINTN  ErrorLevel,
>+  IN CONST CHAR8*Format,
>+  IN BASE_LIST  Marker
>+  )
>+{
>+  DebugBPrint(ErrorLevel, Format, Marker);
>+}
>+
>+/**
>+  Print an assert message containing a filename, line number, and description.
>+  This may be followed by a breakpoint or a dead loop.
>+
>+  @param[in] FileName The pointer to the name of the source 
>file
>that
>+  generated the assert condition.
>+  @param[in] LineNumber   The line number in the source file that
>generated
>+  the assert condition
>+  @param[in] Description  The pointer to the description of the 
>assert
>condition.
>+
>+**/
>+VOID
>+EFIAPI
>+PeiDebugAssert(
>+  IN CONST CHAR8*FileName,
>+  IN UINTN  LineNumber,
>+  IN CONST CHAR8*Description
>+  )
>+{
>+  DebugAssert(FileName, LineNumber, Description);
>+}
>+
>diff --git a/MdeModulePkg/Universal/DebugServicePei/DebugService.h
>b/MdeModulePkg/Universal/DebugServicePei/DebugService.h
>new file mode 100644
>index 00..3e234f76b6
>--- /dev/null
>+++ b/MdeModulePkg/Universal/DebugServicePei/DebugService.h
>@@ -0,0 +1,56 @@
>+/** @file
>+  Header file of Debug services instances.
>+
>+  Copyright (c) 2019, Intel Corporation. All rights reserved.
>+
>+  This program and the accompanying materials
>+  are licensed and made available under the terms and conditions of the B

Re: [edk2] [PATCH V4 16/17] MdeModulePkg/PeiDebugLibDebugPpi: Add PEI debug lib

2019-03-27 Thread Gao, Liming
Zhichao:
   For new library instance, I have some comments. 

1) DebugPrint(). If DebugPpi is not found, directly return instead of 
CpuDeadLoop().
2) DebugAssert(). If DebugPpi is not found, bases on PcdDebugPropertyMask value 
to trig CpuDeadLoop() or CpuBreakPoint(). 
3) Please rename mDebugPpi as the specific prefix name to avoid the name 
confliction. 
4) What test is done for this library instance? 

Thanks
Liming
>-Original Message-
>From: Gao, Zhichao
>Sent: Thursday, March 21, 2019 10:05 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming ; Wang, Jian J
>; Wu, Hao A ; Ni, Ray
>; Zeng, Star ; Sean Brogan
>; Michael Turner
>; Bret Barkelew
>
>Subject: [PATCH V4 16/17] MdeModulePkg/PeiDebugLibDebugPpi: Add PEI
>debug lib
>
>From: Liming Gao 
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1395
>
>Add a PEI debug library instance PeiDebugLibDebugPpi base on
>DebugPpi. Using the combination of the DebugServicePei and
>this lib instance can reduce the image size of PEI drivers.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Zhichao Gao 
>Cc: Jian J Wang 
>Cc: Hao Wu 
>Cc: Ray Ni 
>Cc: Star Zeng 
>Cc: Liming Gao 
>Cc: Sean Brogan 
>Cc: Michael Turner 
>Cc: Bret Barkelew 
>---
> .../Library/PeiDebugLibDebugPpi/DebugLib.c | 456
>+
> .../PeiDebugLibDebugPpi/PeiDebugLibDebugPpi.inf|  55 +++
> 2 files changed, 511 insertions(+)
> create mode 100644
>MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c
> create mode 100644
>MdeModulePkg/Library/PeiDebugLibDebugPpi/PeiDebugLibDebugPpi.inf
>
>diff --git a/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c
>b/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c
>new file mode 100644
>index 00..75859163ae
>--- /dev/null
>+++ b/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c
>@@ -0,0 +1,456 @@
>+/** @file
>+  PEI debug lib instance base on DebugPpi to save size
>+
>+  Copyright (c) 2019, Intel Corporation. All rights reserved.
>+
>+  This program and the accompanying materials
>+  are licensed and made available under the terms and conditions of the BSD
>License
>+  which accompanies this distribution.  The full text of the license may be
>found at
>+  http://opensource.org/licenses/bsd-license.php
>+
>+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
>BASIS,
>+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
>EXPRESS OR IMPLIED.
>+
>+**/
>+
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+#include 
>+
>+EDKII_DEBUG_PPI *mDebugPpi = NULL;
>+
>+/**
>+  Prints a debug message to the debug output device if the specified
>+  error level is enabled.
>+
>+  If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
>+  GetDebugPrintErrorLevel (), then print the message specified by Format
>and
>+  the associated variable argument list to the debug output device.
>+
>+  If Format is NULL, then ASSERT().
>+
>+  @param  ErrorLevelThe error level of the debug message.
>+  @param  FormatFormat string for the debug message to print.
>+  @param  ...   Variable argument list whose contents are accessed
>+based on the format string specified by Format.
>+
>+**/
>+VOID
>+EFIAPI
>+DebugPrint (
>+  IN  UINTNErrorLevel,
>+  IN  CONST CHAR8  *Format,
>+  ...
>+  )
>+{
>+  VA_LIST Marker;
>+
>+  VA_START (Marker, Format);
>+  DebugVPrint (ErrorLevel, Format, Marker);
>+  VA_END (Marker);
>+}
>+
>+
>+/**
>+  Prints a debug message to the debug output device if the specified
>+  error level is enabled.
>+  This function use BASE_LIST which would provide a more compatible
>+  service than VA_LIST.
>+
>+  If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
>+  GetDebugPrintErrorLevel (), then print the message specified by Format
>and
>+  the associated variable argument list to the debug output device.
>+
>+  If Format is NULL, then ASSERT().
>+
>+  @param  ErrorLevel  The error level of the debug message.
>+  @param  Format  Format string for the debug message to print.
>+  @param  BaseListMarker  BASE_LIST marker for the variable argument list.
>+
>+**/
>+VOID
>+EFIAPI
>+DebugBPrint (
>+  IN  UINTN ErrorLevel,
>+  IN  CONST CHAR8   *Format,
>+  IN  BASE_LIST BaseListMarker
>+  )
>+{
>+  EFI_STATUS  Status;
>+
>+  //
>+  // If Format is NULL, then ASSERT().
>+  //
>+  ASSERT (Format != NULL);
>+
>+  //
>+  // Check driver Debug Level value and global debug level
>+  

Re: [edk2] [Patch] BaseTool: Fixed an issue of Structure PCD

2019-03-26 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: Feng, Bob C
> Sent: Tuesday, March 26, 2019 5:34 PM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C ; Gao, Liming 
> Subject: [Patch] BaseTool: Fixed an issue of Structure PCD
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1665
> 
> Build fail when the structure pcd has
> member of flexible size array
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> ---
>  BaseTools/Source/Python/Workspace/DscBuildData.py | 14 +++---
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
> b/BaseTools/Source/Python/Workspace/DscBuildData.py
> index 58286159db..129c0c950b 100644
> --- a/BaseTools/Source/Python/Workspace/DscBuildData.py
> +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
> @@ -1777,21 +1777,21 @@ class DscBuildData(PlatformBuildClassObject):
>  Value = 
> ValueExpressionEx(FieldList[FieldName.strip(".")][0], TAB_VOID, 
> self._GuidDict)(True)
>  except BadExpression:
>  EdkLogger.error('Build', FORMAT_INVALID, "Invalid 
> value format for %s. From %s Line %d " %
>  (".".join((Pcd.TokenSpaceGuidCName, 
> Pcd.TokenCName, FieldName.strip('.'))),
> FieldList[FieldName.strip(".")][1], FieldList[FieldName.strip(".")][2]))
>  Value, ValueSize = ParseFieldValue(Value)
> -if not Pcd.IsArray:
> +if not Pcd.IsArray():
>  CApp = CApp + '  __FLEXIBLE_SIZE(*Size, %s, %s, %d / 
> __ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %%
> __ARRAY_ELEMENT_SIZE(%s, %s)) ? 1 : 0));  // From %s Line %d Value %s \n' % 
> (Pcd.DatumType, FieldName.strip("."), ValueSize,
> Pcd.DatumType, FieldName.strip("."), ValueSize, Pcd.DatumType, 
> FieldName.strip("."), FieldList[FieldName.strip(".")][1],
> FieldList[FieldName.strip(".")][2], FieldList[FieldName.strip(".")][0]);
>  else:
>  NewFieldName = ''
>  FieldName_ori = FieldName.strip('.')
>  while '[' in  FieldName:
>  NewFieldName = NewFieldName + FieldName.split('[', 
> 1)[0] + '[0]'
>  ArrayIndex = int(FieldName.split('[', 
> 1)[1].split(']', 1)[0])
>  FieldName = FieldName.split(']', 1)[1]
>  FieldName = NewFieldName + FieldName
> -while '[' in FieldName and not Pcd.IsArray:
> +while '[' in FieldName and not Pcd.IsArray():
>  FieldName = FieldName.rsplit('[', 1)[0]
>  CApp = CApp + '  __FLEXIBLE_SIZE(*Size, %s, %s, %d); 
> // From %s Line %d Value %s\n' % (Pcd.DatumType,
> FieldName.strip("."), ArrayIndex + 1, FieldList[FieldName_ori][1], 
> FieldList[FieldName_ori][2], FieldList[FieldName_ori][0])
>  for skuname in Pcd.SkuOverrideValues:
>  if skuname == TAB_COMMON:
>  continue
> @@ -1809,21 +1809,21 @@ class DscBuildData(PlatformBuildClassObject):
>  Value = 
> ValueExpressionEx(FieldList[FieldName.strip(".")][0], TAB_VOID, 
> self._GuidDict)(True)
>  except BadExpression:
>  EdkLogger.error('Build', FORMAT_INVALID, 
> "Invalid value format for %s. From %s Line %d " %
>  
> (".".join((Pcd.TokenSpaceGuidCName, Pcd.TokenCName, FieldName.strip('.'))),
> FieldList[FieldName.strip(".")][1], FieldList[FieldName.strip(".")][2]))
>  Value, ValueSize = ParseFieldValue(Value)
> -if not Pcd.IsArray:
> +if not Pcd.IsArray():
>  CApp = CApp + '  __FLEXIBLE_SIZE(*Size, 
> %s, %s, %d / __ARRAY_ELEMENT_SIZE(%s, %s) +
> ((%d %% __ARRAY_ELEMENT_SIZE(%s, %s)) ? 1 : 0)); // From %s Line %d Value 
> %s\n' % (Pcd.DatumType, FieldName.strip("."), ValueSize,
> Pcd.DatumType, FieldName.strip("."), ValueSize, Pcd.DatumType, 
> FieldName.strip("."), FieldList[FieldName.strip(".")][1],
> FieldList[FieldName.strip(".")][2], FieldList[FieldName.strip(".")][0]);
>  else:
>  NewFieldName = ''
>

Re: [edk2] [edk2-announce] [RFC] TianoCore Design Meetings

2019-03-25 Thread Gao, Liming
Stephano:
  April 5th (Friday in PRC) is Chinese public holiday. Could we place one day 
ahead, how about April 3th (PST)?

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 
> stephano
> Sent: Saturday, March 23, 2019 8:29 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [edk2-announce] [RFC] TianoCore Design Meetings
> 
> We would like to start holding code design meetings every 2 weeks
> starting on April 4th. I'm proposing the times of these meetings as
> 16:00 GMT (8am PST) and at 2:30 GMT (9:30am Friday in PRC).
> 
> I have chosen the APAC day / time based on feedback from those community
> members and maintainers. For our members in EMEA, this is your chance to
> propose a new day / time. Specifically, I'd like to hear from
> maintainers and technical leads in the EMEA region as their
> participation is vital to these meeting's goals.
> 
> This meeting is a chance for the TianoCore community to bring any
> initial design ideas and communicate those ideas to tech leaders and
> fellow developers. I will be collecting ideas for discussion, and will
> be sure that those ideas are shared in both sessions so as to get
> feedback across all our community members.
> 
> Content related to designs (including documentation, slides, and links
> to code) can be shared on Groups.io:
> 
> https://edk2.groups.io/g/devel/files/Designs/2019
> 
> I will also post meeting minutes here, so that those that miss the
> meeting can review the design files and notes together.
> 
> I've added the events to the calendar:
> 
> https://edk2.groups.io/g/devel/calendar
> 
> And will update the wiki with each session's topics:
> 
> https://www.tianocore.org/design-meeting/
> 
> As always, please feel free to contact me with questions or comments.
> 
> Cheers,
> Stephano
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] Fix links in Maintainers.txt and remove slow outdated sourceforge git mirror

2019-03-25 Thread Gao, Liming
This change is good. Reviewed-by: Liming Gao 

> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Monday, March 25, 2019 7:50 PM
> To: Rebecca Cran ; edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: Re: [edk2] [PATCH] Fix links in Maintainers.txt and remove slow 
> outdated sourceforge git mirror
> 
> (+Liming)
> 
> OK, so the last comment on this patch was at:
> 
> 6800a51b-fa21-f325-bbc1-d17e3c8b62e2@redhat.com">http://mid.mail-archive.com/6800a51b-fa21-f325-bbc1-d17e3c8b62e2@redhat.com
> 
> Let's see the changes:
> 
> 
> On 03/24/19 03:00, Rebecca Cran via edk2-devel wrote:
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Rebecca Cran 
> 
> This looks good. (The contributed-under line will soon become
> unnecessary, but for now it's still required & correct, AIUI.)
> 
> > ---
> >  Maintainers.txt | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/Maintainers.txt b/Maintainers.txt
> > index be77898ee2..4c9adf802b 100644
> > --- a/Maintainers.txt
> > +++ b/Maintainers.txt
> > @@ -40,10 +40,9 @@ Descriptions of section entries:
> >  EDK II
> >  --
> >  W: http://www.tianocore.org/edk2/
> 
> Any particular reason for dropping the website URL update?
> <http://www.tianocore.org/edk2/> still redirects to
> <https://github.com/tianocore/tianocore.github.io/wiki/EDK-II>, and your
> previous patch (correctly) included that new URL.
> 
> > -L: https://lists.sourceforge.net/lists/listinfo/edk2-devel
> > +L: https://lists.01.org/mailman/listinfo/edk2-devel
> 
> This is the same as before, and it's good (we'll change this soon to
> groups.io, I reckon, but for now it's good).
> 
> >  T: git - https://github.com/tianocore/edk2.git
> >  T: git (mirror) - https://bitbucket.org/tianocore/edk2.git
> > -T: git (mirror) - http://git.code.sf.net/p/tianocore/edk2
> 
> Same as before, and also good.
> 
> >  T: svn (read-only, deprecated) - 
> > https://svn.code.sf.net/p/edk2/code/trunk/edk2
> >
> >  Tianocore Stewards
> >
> 
> So, if you dropped the "W:" change intentionally, I don't mind. After
> all, the original link still works, and the patch is still a pure
> improvement.
> 
> Reviewed-by: Laszlo Ersek 
> 
> If Liming too is OK with this patch (and you don't intend to update it),
> I can help push it.
> 
> Thanks
> Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH V2 1/2] MdeModulePkg/CapsuleRuntimeDxe: IA32 add cache flush function

2019-03-25 Thread Gao, Liming
Zhichao:
  Could you help clarify the commit message? Does IA32 and X64 Arch 
implementation need flush function or not? 

>The IA32 ARCH need cache flush function during capsule update.
>Both arm ARCH and IA32 do not need flush cache function,

Thanks
Liming
>-Original Message-
>From: Gao, Zhichao
>Sent: Friday, March 22, 2019 11:07 AM
>To: edk2-devel@lists.01.org
>Cc: Wang, Jian J ; Wu, Hao A ;
>Ni, Ray ; Zeng, Star ; Gao, Liming
>; Ard Biesheuvel 
>Subject: [PATCH V2 1/2] MdeModulePkg/CapsuleRuntimeDxe: IA32 add cache
>flush function
>
>BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1462
>
>The IA32 ARCH need cache flush function during capsule update.
>Both arm ARCH and IA32 do not need flush cache function, so
>merge the CapsuleCacheWriteBack() to one file. And add a null
>version for EBC.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Zhichao Gao 
>Cc: Jian J Wang 
>Cc: Hao Wu 
>Cc: Ray Ni 
>Cc: Star Zeng 
>Cc: Liming Gao 
>Cc: Ard Biesheuvel 
>---
> .../Universal/CapsuleRuntimeDxe/Arm/CapsuleReset.c | 35 +---
> .../Universal/CapsuleRuntimeDxe/CapsuleCache.c | 63
>++
> .../Universal/CapsuleRuntimeDxe/CapsuleCacheNull.c | 38 +
> .../Universal/CapsuleRuntimeDxe/CapsuleReset.c | 16 +-
> .../CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf| 20 ---
> 5 files changed, 115 insertions(+), 57 deletions(-)
> create mode 100644
>MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleCache.c
> create mode 100644
>MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleCacheNull.c
>
>diff --git
>a/MdeModulePkg/Universal/CapsuleRuntimeDxe/Arm/CapsuleReset.c
>b/MdeModulePkg/Universal/CapsuleRuntimeDxe/Arm/CapsuleReset.c
>index d79d2fc693..ec630ab7a8 100644
>--- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/Arm/CapsuleReset.c
>+++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/Arm/CapsuleReset.c
>@@ -3,6 +3,7 @@
>   PersistAcrossReset capsules
>
>   Copyright (c) 2018, Linaro, Ltd. All rights reserved.
>+  Copyright (c) 2019, Intel Corporation. All rights reserved.
>
>   This program and the accompanying materials are licensed and made
>available
>   under the terms and conditions of the BSD License which accompanies this
>@@ -16,8 +17,6 @@
>
> #include "CapsuleService.h"
>
>-#include 
>-
> /**
>   Whether the platform supports capsules that persist across reset. Note that
>   some platforms only support such capsules at boot time.
>@@ -41,35 +40,3 @@ IsPersistAcrossResetCapsuleSupported (
>   return FeaturePcdGet (PcdSupportUpdateCapsuleReset) && !EfiAtRuntime
>();
> }
>
>-/**
>-  Writes Back a range of data cache lines covering a set of capsules in 
>memory.
>-
>-  Writes Back the data cache lines specified by ScatterGatherList.
>-
>-  @param  ScatterGatherList Physical address of the data structure that
>-describes a set of capsules in memory
>-
>-**/
>-VOID
>-CapsuleCacheWriteBack (
>-  IN  EFI_PHYSICAL_ADDRESSScatterGatherList
>-  )
>-{
>-  EFI_CAPSULE_BLOCK_DESCRIPTOR*Desc;
>-
>-  Desc = (EFI_CAPSULE_BLOCK_DESCRIPTOR *)(UINTN)ScatterGatherList;
>-  do {
>-WriteBackDataCacheRange (Desc, sizeof *Desc);
>-
>-if (Desc->Length > 0) {
>-  WriteBackDataCacheRange ((VOID *)(UINTN)Desc->Union.DataBlock,
>-   Desc->Length
>-   );
>-  Desc++;
>-} else if (Desc->Union.ContinuationPointer > 0) {
>-  Desc = (EFI_CAPSULE_BLOCK_DESCRIPTOR *)(UINTN)Desc-
>>Union.ContinuationPointer;
>-}
>-  } while (Desc->Length > 0 || Desc->Union.ContinuationPointer > 0);
>-
>-  WriteBackDataCacheRange (Desc, sizeof *Desc);
>-}
>diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleCache.c
>b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleCache.c
>new file mode 100644
>index 00..ab81296a65
>--- /dev/null
>+++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleCache.c
>@@ -0,0 +1,63 @@
>+/** @file
>+  Flush the cache is required for most architectures while do capsule
>+  update. It is not support at Runtime.
>+
>+  Copyright (c) 2018, Linaro, Ltd. All rights reserved.
>+  Copyright (c) 2019, Intel Corporation. All rights reserved.
>+
>+  This program and the accompanying materials are licensed and made
>available
>+  under the terms and conditions of the BSD License which accompanies this
>+  distribution.  The full text of the license may be found at
>+  http://opensource.org/licenses/bsd-license.php
>+
>+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
>BASIS,
>+  WITHOUT WARRANTIES OR 

Re: [edk2] [PATCH] PcAtChipsetPkg/PcatChipsetPkg.dsc: Add a driver to build

2019-03-24 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Zhichao Gao
>Sent: Thursday, March 21, 2019 10:45 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming 
>Subject: [edk2] [PATCH] PcAtChipsetPkg/PcatChipsetPkg.dsc: Add a driver to
>build
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1646
>
>Add the IdeControllerDxe driver to the [Components] section
>to make sure it would build correctly.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Zhichao Gao 
>Cc: Ray Ni 
>Cc: Liming Gao 
>---
> PcAtChipsetPkg/PcAtChipsetPkg.dsc | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/PcAtChipsetPkg/PcAtChipsetPkg.dsc
>b/PcAtChipsetPkg/PcAtChipsetPkg.dsc
>index d357aa28d0..e58ca81864 100644
>--- a/PcAtChipsetPkg/PcAtChipsetPkg.dsc
>+++ b/PcAtChipsetPkg/PcAtChipsetPkg.dsc
>@@ -52,6 +52,7 @@
>   PcAtChipsetPkg/8254TimerDxe/8254Timer.inf
>   PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf
>   PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf
>+  PcAtChipsetPkg/Bus/Pci/IdeControllerDxe/IdeControllerDxe.inf
>   PcAtChipsetPkg/IsaAcpiDxe/IsaAcpi.inf
>   PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf
>   PcAtChipsetPkg/Library/ResetSystemLib/ResetSystemLib.inf
>--
>2.16.2.windows.1
>
>___
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] IntelSiliconPkg/IntelSiliconPkg.dsc: Add a driver to build

2019-03-24 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: Gao, Zhichao
>Sent: Thursday, March 21, 2019 10:44 PM
>To: edk2-devel@lists.01.org
>Cc: Ni, Ray ; Chaganty, Rangasai V
>; Gao, Liming 
>Subject: [PATCH] IntelSiliconPkg/IntelSiliconPkg.dsc: Add a driver to build
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1647
>
>Add a driver MicrocodeFlashAccessLibNull.inf to the
>[Components] section to make sure it would build correctly.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Zhichao Gao 
>Cc: Ray Ni 
>Cc: Rangasai V Chaganty 
>Cc: Liming Gao 
>---
> IntelSiliconPkg/IntelSiliconPkg.dsc | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/IntelSiliconPkg/IntelSiliconPkg.dsc
>b/IntelSiliconPkg/IntelSiliconPkg.dsc
>index 790870e2f1..a00fef6010 100644
>--- a/IntelSiliconPkg/IntelSiliconPkg.dsc
>+++ b/IntelSiliconPkg/IntelSiliconPkg.dsc
>@@ -85,6 +85,7 @@
>
>IntelSiliconPkg/Feature/VTd/PlatformVTdSampleDxe/PlatformVTdSampleDxe
>.inf
>
>IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSamplePei/PlatformVTdInfoSa
>mplePei.inf
>
>IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdateDx
>e.inf
>+
>IntelSiliconPkg/Feature/Capsule/Library/MicrocodeFlashAccessLibNull/Microc
>odeFlashAccessLibNull.inf
>
> [BuildOptions]
>   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
>--
>2.16.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 0/3] Improve performance of boundary validation in MakeTable()

2019-03-22 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>shenglei
>Sent: Thursday, March 21, 2019 2:32 PM
>To: edk2-devel@lists.01.org
>Cc: Kinney, Michael D ; Gao, Liming
>
>Subject: [edk2] [PATCH v2 0/3] Improve performance of boundary validation
>in MakeTable()
>
>The boundary validation checking in MakeTable() performs on
>every loop iteration. This could be improved by checking
>just once before the loop.
>https://bugzilla.tianocore.org/show_bug.cgi?id=1329
>
>v2:1.Change the the algorithm implementation of the judgement in all
>patches.
>   2.Remove previous 3/4 in v1.
>
>Cc: Bob Feng 
>Cc: Liming Gao 
>Cc: Yonghong Zhu 
>Cc: Michael D Kinney 
>Shenglei Zhang (3):
>  BaseTools/TianoCompress: Improve performance of boundary validation
>  BaseTools/C/Common: Improve performance of boundary validation
>  MdePkg/BaseUefiDecompressLib: Improve performance of boundary
>validation
>
> BaseTools/Source/C/Common/Decompress.c | 7 ---
> BaseTools/Source/C/TianoCompress/TianoCompress.c   | 7 ---
> .../Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c  | 7 ---
> 3 files changed, 12 insertions(+), 9 deletions(-)
>
>--
>2.18.0.windows.1
>
>___
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 2/3] Maintainers.txt: Remove EdkCompatibilityPkg information

2019-03-22 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Shenglei Zhang
>Sent: Friday, March 22, 2019 10:35 AM
>To: edk2-devel@lists.01.org
>Cc: Kinney, Michael D ; Laszlo Ersek
>
>Subject: [edk2] [PATCH 2/3] Maintainers.txt: Remove EdkCompatibilityPkg
>information
>
>EdkCompatibilityPkg will be deleted from edk2/master.
>So update the maintainer information of EdkCompatibilityPkg.
>https://bugzilla.tianocore.org/show_bug.cgi?id=1103
>
>Cc: Andrew Fish 
>Cc: Laszlo Ersek 
>Cc: Leif Lindholm 
>Cc: Michael D Kinney 
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Shenglei Zhang 
>---
> Maintainers.txt | 4 
> 1 file changed, 4 deletions(-)
>
>diff --git a/Maintainers.txt b/Maintainers.txt
>index be77898ee2..e090df7c17 100644
>--- a/Maintainers.txt
>+++ b/Maintainers.txt
>@@ -115,10 +115,6 @@ W:
>https://github.com/tianocore/tianocore.github.io/wiki/DynamicTablesPkg
> M: Sami Mujawar 
> M: Alexei Fedorov 
>
>-EdkCompatibilityPkg
>-W:
>https://github.com/tianocore/tianocore.github.io/wiki/EdkCompatibilityPkg
>-M: Liming Gao 
>-
> EmbeddedPkg
> W: https://github.com/tianocore/tianocore.github.io/wiki/EmbeddedPkg
> M: Leif Lindholm 
>--
>2.18.0.windows.1
>
>___
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 3/3] EdkCompatibilityPkg: Remove EdkCompatibilityPkg

2019-03-22 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: Zhang, Shenglei
>Sent: Friday, March 22, 2019 10:35 AM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming 
>Subject: [PATCH 3/3] EdkCompatibilityPkg: Remove EdkCompatibilityPkg
>
>If this patch contains all changes of removing EdkCompatibilityPkg, it will
>be too big to send. So this patch only contains one operation, deleting
>EdkCompatibilityPkg.
>https://bugzilla.tianocore.org/show_bug.cgi?id=1103
>
>Cc: Liming Gao 
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Shenglei Zhang 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Debugging why Build Rebuilds Something

2019-03-21 Thread Gao, Liming
  Could you help check the timestamp of AutoGen files in OpenSslLib output 
directory? 

  After the first build, copy OpenSslLib output directory to another directory
  After the second build, compare the output directory between two builds, 
please check whether there is the difference for AutoGen.h and Makefile. If no 
difference, please directly trig Makefile to see whether rebuild happen. If 
rebuild happen, it may be the issue in Makefile. Then, further check Makefile.

Thanks
Liming
>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Cohen, Eugene
>Sent: Thursday, March 21, 2019 5:50 PM
>To: edk2-devel@lists.01.org
>Subject: [edk2] Debugging why Build Rebuilds Something
>
>I'm experiencing an annoying problem where OpenSslLib is constantly being
>rebuilt.  I don't think I've done anything unusual or different to it but
>nevertheless it gets built almost every time I rebuild the same platform.
>
>I don't believe any source file timestamps are changing so I think this may be
>the build.py tool deciding to re-generate stuff.  (As a side note: does the
>Autogen process only run when changes are detected on dependencies?  I
>assume this must be the case otherwise everything would get rebuilt, right?)
>
>Is there a debug flag that can be turned on to see why build might choose to
>rebuild something?  The normal build report and debug flags don't see to
>provide the information for "why" something is being rebuilt.
>
>Thanks,
>
>Eugene
>
>___
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH V3 01/17] MdePkg/DebugLib.h: Add new APIs for DebugLib

2019-03-21 Thread Gao, Liming
Reviewed-by: Liming Gao  for MdePkg.

>-Original Message-
>From: Gao, Zhichao
>Sent: Tuesday, March 19, 2019 11:26 PM
>To: edk2-devel@lists.01.org
>Cc: Kinney, Michael D ; Gao, Liming
>; Sean Brogan ;
>Michael Turner ; Bret Barkelew
>
>Subject: [PATCH V3 01/17] MdePkg/DebugLib.h: Add new APIs for DebugLib
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1395
>
>Add new APIs DebugVPrint and DebugBPrint prototype
>definition in the DebugLib header file. These APIs
>would expose a print routine with VaList parameter
>and BaseList parameter.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Zhichao Gao 
>Cc: Michael D Kinney 
>Cc: Liming Gao 
>Cc: Sean Brogan 
>Cc: Michael Turner 
>Cc: Bret Barkelew 
>---
> MdePkg/Include/Library/DebugLib.h | 52
>++-
> 1 file changed, 51 insertions(+), 1 deletion(-)
>
>diff --git a/MdePkg/Include/Library/DebugLib.h
>b/MdePkg/Include/Library/DebugLib.h
>index e6a7a357b2..77fb1ee259 100644
>--- a/MdePkg/Include/Library/DebugLib.h
>+++ b/MdePkg/Include/Library/DebugLib.h
>@@ -8,7 +8,7 @@
>   of size reduction when compiler optimization is disabled. If
>MDEPKG_NDEBUG is
>   defined, then debug and assert related macros wrapped by it are the NULL
>implementations.
>
>-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
>+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
> This program and the accompanying materials are licensed and made
>available under
> the terms and conditions of the BSD License that accompanies this
>distribution.
> The full text of the license may be found at
>@@ -101,6 +101,56 @@ DebugPrint (
>   );
>
>
>+/**
>+  Prints a debug message to the debug output device if the specified
>+  error level is enabled.
>+
>+  If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
>+  GetDebugPrintErrorLevel (), then print the message specified by Format
>and
>+  the associated variable argument list to the debug output device.
>+
>+  If Format is NULL, then ASSERT().
>+
>+  @param  ErrorLevelThe error level of the debug message.
>+  @param  FormatFormat string for the debug message to print.
>+  @param  VaListMarker  VA_LIST marker for the variable argument list.
>+
>+**/
>+VOID
>+EFIAPI
>+DebugVPrint (
>+  IN  UINTN ErrorLevel,
>+  IN  CONST CHAR8   *Format,
>+  IN  VA_LIST   VaListMarker
>+  );
>+
>+
>+/**
>+  Prints a debug message to the debug output device if the specified
>+  error level is enabled.
>+  This function use BASE_LIST which would provide a more compatible
>+  service than VA_LIST.
>+
>+  If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
>+  GetDebugPrintErrorLevel (), then print the message specified by Format
>and
>+  the associated variable argument list to the debug output device.
>+
>+  If Format is NULL, then ASSERT().
>+
>+  @param  ErrorLevel  The error level of the debug message.
>+  @param  Format  Format string for the debug message to print.
>+  @param  BaseListMarker  BASE_LIST marker for the variable argument list.
>+
>+**/
>+VOID
>+EFIAPI
>+DebugBPrint (
>+  IN  UINTN ErrorLevel,
>+  IN  CONST CHAR8   *Format,
>+  IN  BASE_LIST BaseListMarker
>+  );
>+
>+
> /**
>   Prints an assert message containing a filename, line number, and 
> description.
>   This may be followed by a breakpoint or a dead loop.
>--
>2.16.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH V3 13/17] MdeModulePkg/PeiDxeDebugLibReportStatusCode: Add new APIs

2019-03-21 Thread Gao, Liming
Zhichao:
  Why do below change? Seemly, this change is not related to add new APIs. In 
fact, current log is added as the purpose by commit 
137ed15511e2045a7333e33ae7f1e873ce1961dd. 

  if (TotalSize > sizeof (Buffer)) {
TotalSize = sizeof (Buffer);  ==> return;
  }

Thanks
Liming
>-Original Message-
>From: Gao, Zhichao
>Sent: Tuesday, March 19, 2019 11:26 PM
>To: edk2-devel@lists.01.org
>Cc: Wang, Jian J ; Wu, Hao A ;
>Ni, Ray ; Zeng, Star ; Gao, Liming
>; Sean Brogan ;
>Michael Turner ; Bret Barkelew
>
>Subject: [PATCH V3 13/17]
>MdeModulePkg/PeiDxeDebugLibReportStatusCode: Add new APIs
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1395
>
>Add new APIs' implementation (DebugVPrint, DebugBPrint)
>in the DebugLib instance. These APIs would expose print
>routines with VaList parameter and BaseList parameter.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Zhichao Gao 
>Cc: Jian J Wang 
>Cc: Hao Wu 
>Cc: Ray Ni 
>Cc: Star Zeng 
>Cc: Liming Gao 
>Cc: Sean Brogan 
>Cc: Michael Turner 
>Cc: Bret Barkelew 
>---
> .../PeiDxeDebugLibReportStatusCode/DebugLib.c  | 144
>++---
> 1 file changed, 128 insertions(+), 16 deletions(-)
>
>diff --git
>a/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
>b/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
>index 6f0f416273..f1d31cb619 100644
>--- a/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
>+++
>b/MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
>@@ -4,7 +4,7 @@
>   Note that if the debug message length is larger than the maximum allowable
>   record length, then the debug message will be ignored directly.
>
>-  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
>+  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
>   This program and the accompanying materials
>   are licensed and made available under the terms and conditions of the BSD
>License
>   which accompanies this distribution.  The full text of the license may be
>found at
>@@ -27,6 +27,12 @@
> #include 
> #include 
>
>+//
>+// VA_LIST can not initialize to NULL for all compiler, so we use this to
>+// indicate a null VA_LIST
>+//
>+VA_LIST mVaListNull;
>+
> /**
>   Prints a debug message to the debug output device if the specified error
>level is enabled.
>
>@@ -52,12 +58,43 @@ DebugPrint (
>   IN  CONST CHAR8  *Format,
>   ...
>   )
>+{
>+  VA_LIST Marker;
>+
>+  VA_START (Marker, Format);
>+  DebugVPrint (ErrorLevel, Format, Marker);
>+  VA_END (Marker);
>+}
>+
>+/**
>+  Prints a debug message to the debug output device if the specified
>+  error level is enabled base on Null-terminated format string and a
>+  VA_LIST argument list or a BASE_LIST argument list.
>+
>+  If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
>+  GetDebugPrintErrorLevel (), then print the message specified by Format
>and
>+  the associated variable argument list to the debug output device.
>+
>+  If Format is NULL, then ASSERT().
>+
>+  @param  ErrorLevel  The error level of the debug message.
>+  @param  Format  Format string for the debug message to print.
>+  @param  VaListMarkerVA_LIST marker for the variable argument list.
>+  @param  BaseListMarker  BASE_LIST marker for the variable argument list.
>+
>+**/
>+VOID
>+DebugPrintMarker (
>+  IN  UINTN ErrorLevel,
>+  IN  CONST CHAR8   *Format,
>+  IN  VA_LIST   VaListMarker,
>+  IN  BASE_LIST BaseListMarker
>+  )
> {
>   UINT64  Buffer[(EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof (UINT64))
>+ 1];
>   EFI_DEBUG_INFO  *DebugInfo;
>   UINTN   TotalSize;
>-  VA_LIST VaListMarker;
>-  BASE_LIST   BaseListMarker;
>+  BASE_LIST   BaseListMarkerPointer;
>   CHAR8   *FormatString;
>   BOOLEAN Long;
>
>@@ -96,7 +133,7 @@ DebugPrint (
>   // If the TotalSize is larger than the maximum record size, then return
>   //
>   if (TotalSize > sizeof (Buffer)) {
>-TotalSize = sizeof (Buffer);
>+return;
>   }
>
>   //
>@@ -109,7 +146,7 @@ DebugPrint (
>   //
>   DebugInfo = (EFI_DEBUG_INFO *)(Buffer) + 1;
>   DebugInfo->ErrorLevel = (UINT32)ErrorLevel;
>-  BaseListMarker= (BASE_LIST)(DebugInfo + 1);
>+  BaseListMarkerPointer = (BASE_LIST)(DebugInfo + 1);
>   FormatString  = (CHAR8 *)((UINT64 *)(DebugInfo + 1) + 12);
>
>   //
>@@ -125,7 +162,6 @@ DebugPrint (
>   // of format in DEBUG string, which is followed by the DEBUG format string.
>   // Here we will process the variable arguments 

Re: [edk2] [PATCH V2 01/17] MdePkg/DebugLib.h: Add a new api DebugVPrint for DebugLib

2019-03-19 Thread Gao, Liming
Jordan:
  I suggest to add the line length discussion in edk2 community meeting. Which 
length is better, 80 or 120? If we expect every patch follows this rule, do we 
need update PatchCheck to add the checker, and notify the developer know this 
requirement?

  For now, I suggest that the developer bases on current process, pass 
PatchCheck and code review. 

Thanks
Liming
>-Original Message-
>From: Justen, Jordan L
>Sent: Tuesday, March 19, 2019 2:34 AM
>To: Gao, Liming ; Gao, Zhichao
>; edk2-devel@lists.01.org
>Cc: Kinney, Michael D ; Bret Barkelew
>; Michael Turner
>; Gao, Liming 
>Subject: RE: [edk2] [PATCH V2 01/17] MdePkg/DebugLib.h: Add a new api
>DebugVPrint for DebugLib
>
>On 2019-03-18 08:09:36, Gao, Liming wrote:
>> Jordan:
>>   Coding style document CCS_2_1_Draft.pdf 5.1 General Rules, 5.1.1
>>   Lines shall be 120 columns, or less. Preferably, limit line
>>   lengths to 80 columns or less. So, I don't think the line length
>>   bigger than 80 and less than 120 violates coding style documents.
>
>I think this is clarified as an "exception" base: "When this doesn’t
>leave sufficient space for a good postfix style comment, extend the
>line to a total of 120 columns."
>
>That doesn't apply to this case.
>
>I have never seen a case where I thought this exception was useful in
>EDK II. I think the exception should be removed, because if a true
>exceptional case ever did arise, it would be so obvious, no one would
>need to question it.
>
>The only case I've seen (not in EDK II) where going beyond 80 columns
>seemed to make some sense was a table processed by a build tool. In
>that case the table has so many columns that line went beyond 80
>columns.
>
>There a good code-readability reasons for this limit. For one, we can
>be almost certain that everyone will have 80 columns visible in their
>editor. But, just as importantly, as the line gets too long, it
>becomes more challenging to track back to the start of the next line.
>(Think of newspaper columns, and imagine if they ran all the way
>across the page.) I'm not sure 80 columns is the "perfect" number, but
>it does seem that most agree it is probably close.
>
>>   We should update wiki
>>   https://github.com/tianocore/tianocore.github.io/wiki/Code-Style-C
>>   to match the documentation. Limit line length to 120 characters
>>   instead of 80 characters.
>
>Since this is an "exception", and not normally helpful, I don't think
>we should add it do the wiki. It will only add confusion and lead to
>more code that doesn't follow the preferred limit.
>
>-Jordan
>
>>
>> > -Original Message-
>> > From: Justen, Jordan L
>> > Sent: Monday, March 18, 2019 2:21 PM
>> > To: Gao, Zhichao ; edk2-devel@lists.01.org
>> > Cc: Kinney, Michael D ; Bret Barkelew
>; Michael Turner
>> > ; Gao, Liming 
>> > Subject: RE: [edk2] [PATCH V2 01/17] MdePkg/DebugLib.h: Add a new api
>DebugVPrint for DebugLib
>> >
>> > On 2019-03-17 17:14:40, Gao, Zhichao wrote:
>> > > > -Original Message-
>> > > > From: Justen, Jordan L
>> > > > Sent: Friday, March 15, 2019 2:16 PM
>> > > >
>> > > > On 2019-03-14 22:17:33, Zhichao Gao wrote:
>> > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1395
>> > > > >
>> > > > > Add a new api DebugVPrint prototype definition in the
>> > > > > DebugLib header file. This api would expose a print
>> > > > > routine with VaList parameter.
>> > > >
>> > > > These lines seem to be fairly short, with the longest be 54 chars. I
>guess not a
>> > > > problem, but by the recommendation says they could be up to 75 in
>length.
>> > > >
>> > > > https://github.com/tianocore/tianocore.github.io/wiki/Commit-
>Message-
>> > > > Format
>> > > >
>> > >
>> > > It is hard for someone to control the characters in a line.
>> >
>> > I guess that depends on your editor. :)
>> >
>> > > Making the text massage readable base on the rules make more sense.
>> > > It is easier to control the chars number within 75. Line length less
>> > > than 76 characters is legal.
>> >
>> > Yes, I mentioned it is legal, but it is noticably short. I don't think
>> > it is so short that it is really a problem, so feel free to leave it
>> > if you prefer.
>> >
>> > > >
>> > > > According to the style guide:
>>

Re: [edk2] [Patch 1/1] Document: Update FDF spec to remove EDK and IPF related contents

2019-03-19 Thread Gao, Liming
Bob:
  There is one typo in commit message. Remove EDK and IPF related contents inf 
Fdf spec ==> Remove EDK and IPF related contents from Fdf spec.

With this change, Reviewed-by: Liming Gao 

>-Original Message-
>From: Feng, Bob C
>Sent: Wednesday, March 06, 2019 5:53 PM
>To: edk2-devel@lists.01.org
>Cc: Feng, Bob C ; Gao, Liming
>; Carsey, Jaben 
>Subject: [Patch 1/1] Document: Update FDF spec to remove EDK and IPF
>related contents
>
>BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1453
>
>Remove EDK and IPF related contents inf Fdf spec.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Bob Feng 
>Cc: Liming Gao 
>Cc: Jaben Carsey 
>---
> 1_introduction/11_overview.md 
>   |  22 +++
>---
> 1_introduction/12_terms.md
>   |   8 +---
> 1_introduction/README.md  
>   |   9 ++---
> 2_fdf_design_discussion/22_flash_description_file_format.md
>|  34 --
> 2_fdf_design_discussion/24_[fd]_sections.md   
>   |   9 ++--
>-
> 2_fdf_design_discussion/25_[fv]_sections.md   
>   |   9 +++-
>-
> 2_fdf_design_discussion/{28_[rule]_sections.md => 27_[rule]_sections.md}
>| 232
>+++
>+
>---
>-
> 2_fdf_design_discussion/27_[vtf]_sections.md  
>   |  82 
>--
> 2_fdf_design_discussion/{29_[optionrom]_sections.md =>
>28_[optionrom]_sections.md}  | 112
>-
>---
> 2_fdf_design_discussion/README.md 
>   |   2 --
> 3_edk_ii_fdf_file_format/310_[vtf]_section.md 
>   | 203 ---
>---
>---
>--
> 3_edk_ii_fdf_file_format/{311_pci_optionrom_section.md =>
>310_pci_optionrom_section.md} | 228
>+++
>+++---
>---
>
> 3_edk_ii_fdf_file_format/31_general_rules.md  
>   |  13 +--
>--
> 3_edk_ii_fdf_file_format/32_fdf_definition.md 
>   |  67
>+--
> README.md 
>   |   1 +
> SUMMARY.md
>   |   8 +++-
> appendix_a_nt32pkg_flash_description_file.md  
>   |   4 ++-
>-
> 17 files changed, 321 insertions(+), 722 deletions(-)
>
>diff --git a/1_introduction/11_overview.md
>b/1_introduction/11_overview.md
>index 6db8a26..d7dbb20 100644
>--- a/1_introduction/11_overview.md
>+++ b/1_introduction/11_overview.md
>@@ -1,9 +1,9 @@
> ---
> |
> | `$(WORKSPACE)`| System Environment Variable.
>|
> | `PACKAGES_PATH`   | System Environment Variable that cannot be used
>in EDK II meta-data Files. The build system will automatically detect if this
>variable is present and use directories listed in this variable as if they were
>listed in $(WORKSPACE) |
>-| `$(EDK_SOURCE)`   | System Environment Variable.
>|
>-| `$(EFI_SOURCE)`   | System Environment Variable.
>|
> | `$(EDK_TOOLS_PATH)`   | System Environment Variable
>|
> | `EDK_TOOLS_BIN`   | System Environment Variable that cannot be used in
>EDK II meta-data Files.
>|
>-| `$(ECP_SOURCE)`   | System Environment Variable
>|
> | `$(OUTPUT_DIRECTORY)` | Tool parsing from either the DSC file or via a
>command line option. This is typically the Build/Platform name directory
>created by the build sys

Re: [edk2] [Patch V2 1/1] Document: Update Inf spec to remove EDK and IPF related contents

2019-03-19 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: Feng, Bob C
>Sent: Wednesday, March 06, 2019 4:54 PM
>To: edk2-devel@lists.01.org
>Cc: Feng, Bob C ; Gao, Liming
>; Carsey, Jaben 
>Subject: [Patch V2 1/1] Document: Update Inf spec to remove EDK and IPF
>related contents
>
>BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1453
>
>Remove EDK and IPF related contents
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Bob Feng 
>Cc: Liming Gao 
>Cc: Jaben Carsey 
>---
> 1_introduction/11_overview.md 
>|   4 ++--
> 2_inf_overview/210_[ppis]_section.md  
>|   3 +--
> 2_inf_overview/211_[guids]_section.md 
>|   3 +--
> 2_inf_overview/212_[libraryclasses]_section.md
>|   3
>+--
> 2_inf_overview/213_[packages]_section.md  
>|   3
>+--
> 2_inf_overview/214_pcd_sections.md
>|  16
>+---
> 2_inf_overview/215_[depex]_section.md 
>|   6
>+-
> 2_inf_overview/21_processing_overview.md  
>|
>21 +
> 2_inf_overview/22_information_file_general_rules.md
>|  32 +++-
> 2_inf_overview/24_[defines]_section.md
>|   6
>+++---
> 2_inf_overview/25_[sources]_section.md
>|   6 +-
>
> 2_inf_overview/26_[buildoptions]_section.md   
>|
>11 ++-
> 2_inf_overview/27_[binaries]_section.md   
>|   7 +-
>-
> 2_inf_overview/29_[protocols]_section.md  
>|   3
>+--
> 2_inf_overview/README.md  
>|  13 +---
>-
> 3_edk_ii_inf_file_format/314_[depex]_sections.md  
>|
>8 +++-
> 3_edk_ii_inf_file_format/315_[binaries]_section.md
>|
>7 +--
> 3_edk_ii_inf_file_format/32_component_inf_definition.md
>|   6 +++---
> 3_edk_ii_inf_file_format/34_[defines]_section.md  
>|
>8 ++--
> 3_edk_ii_inf_file_format/35_[buildoptions]_sections.md
>|   7 +++
> 3_edk_ii_inf_file_format/39_[sources]_sections.md 
>|
>9 ++---
> 3_edk_ii_inf_file_format/README.md
>|   6 +--
>---
> README.md 
>|   3 ++-
> SUMMARY.md
>|  37
>+
> appendix_b_build_changes_and_customizations.md =>
>appendix_a_build_changes_and_customizations.md |  10 +-
> appendix_a_edk_inf_file_specification/README.md
>|  40 
> appendix_a_edk_inf_file_specification/a1_design_discussion.md
>| 317 
>
>---
>---
>---
> appendix_a_edk_inf_file_specification/a2_edk_file_specification.md
>| 461 
>
>---
>---
>---
>
> appendix_c_symbols.md => appendix_b_symbols.md
>|   4 ++--
> appendix_d_sample_driver_inf_files.md =>
>appendix_c_sample_driver_inf_files.md   |   8 
> appendix_e_sample_library_inf_files.md =>
>appendix_d_sample_library_inf_files.md

Re: [edk2] [Patch] BaseTools: Remove EDK_GLOBAL related logic

2019-03-19 Thread Gao, Liming
Bob:
  Some platform still specifies EDK_GLOBAL, such as 
https://github.com/tianocore/edk2-platforms/blob/devel-MinPlatform/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/PlatformPkg.dsc.
 Please update them first. 

Thanks
Liming
>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Feng, Bob C
>Sent: Saturday, March 16, 2019 10:35 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming 
>Subject: [edk2] [Patch] BaseTools: Remove EDK_GLOBAL related logic
>
>BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1350
>
>Macros defined using EDK_GLOBAL are only valid when processing
>EDK libraries and components.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Bob Feng 
>Cc: Liming Gao 
>---
> BaseTools/Source/Python/Common/DataType.py|  1 -
> BaseTools/Source/Python/Common/GlobalData.py  |  3 +--
> .../Python/CommonDataClass/DataClass.py   |  1 -
> .../Ecc/MetaFileWorkspace/MetaFileParser.py   | 19 ++
> .../Source/Python/UPT/Library/Parsing.py  |  2 +-
> .../Source/Python/UPT/Logger/StringTable.py   |  2 --
> .../Source/Python/Workspace/InfBuildData.py   |  1 -
> .../Source/Python/Workspace/MetaFileParser.py | 20 ++-
> 8 files changed, 6 insertions(+), 43 deletions(-)
>
>diff --git a/BaseTools/Source/Python/Common/DataType.py
>b/BaseTools/Source/Python/Common/DataType.py
>index 798c0e353d..99bb60c852 100644
>--- a/BaseTools/Source/Python/Common/DataType.py
>+++ b/BaseTools/Source/Python/Common/DataType.py
>@@ -415,11 +415,10 @@ TAB_DSC_DEFINES_RT_BASE_ADDRESS =
>'RtBaseAddress'
> TAB_DSC_DEFINES_RFC_LANGUAGES = 'RFC_LANGUAGES'
> TAB_DSC_DEFINES_ISO_LANGUAGES = 'ISO_LANGUAGES'
> TAB_DSC_DEFINES_DEFINE = 'DEFINE'
> TAB_DSC_DEFINES_VPD_TOOL_GUID = 'VPD_TOOL_GUID'
> TAB_FIX_LOAD_TOP_MEMORY_ADDRESS =
>'FIX_LOAD_TOP_MEMORY_ADDRESS'
>-TAB_DSC_DEFINES_EDKGLOBAL = 'EDK_GLOBAL'
> TAB_DSC_PREBUILD = 'PREBUILD'
> TAB_DSC_POSTBUILD = 'POSTBUILD'
> #
> # TargetTxt Definitions
> #
>diff --git a/BaseTools/Source/Python/Common/GlobalData.py
>b/BaseTools/Source/Python/Common/GlobalData.py
>index f117998b0b..9f42484dc1 100644
>--- a/BaseTools/Source/Python/Common/GlobalData.py
>+++ b/BaseTools/Source/Python/Common/GlobalData.py
>@@ -26,11 +26,10 @@ gPlatformDefines = {}
> gPlatformPcds = {}
> # PCDs with type that are not fixed at build and feature flag
> gPlatformOtherPcds = {}
> gActivePlatform = None
> gCommandLineDefines = {}
>-gEdkGlobal = {}
> gOverrideDir = {}
> gCommandMaxLength = 4096
> # for debug trace purpose when problem occurs
> gProcessingFile = ''
> gBuildingModule = ''
>@@ -40,11 +39,11 @@ gDefaultStores = []
> # definition for a MACRO name.  used to create regular expressions below.
> _MacroNamePattern = "[A-Z][A-Z0-9_]*"
>
> ## Regular expression for matching macro used in DSC/DEC/INF file inclusion
> gMacroRefPattern = re.compile("\$\(({})\)".format(_MacroNamePattern),
>re.UNICODE)
>-gMacroDefPattern = re.compile("^(DEFINE|EDK_GLOBAL)[ \t]+")
>+gMacroDefPattern = re.compile("^(DEFINE)[ \t]+")
> gMacroNamePattern = re.compile("^{}$".format(_MacroNamePattern))
>
> # definition for a GUID.  used to create regular expressions below.
> _HexChar = r"[0-9a-fA-F]"
> _GuidPattern = r"{Hex}{{8}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{4}}-
>{Hex}{{12}}".format(Hex=_HexChar)
>diff --git a/BaseTools/Source/Python/CommonDataClass/DataClass.py
>b/BaseTools/Source/Python/CommonDataClass/DataClass.py
>index 2d93f79b09..ec5bb194f4 100644
>--- a/BaseTools/Source/Python/CommonDataClass/DataClass.py
>+++ b/BaseTools/Source/Python/CommonDataClass/DataClass.py
>@@ -105,11 +105,10 @@ MODEL_META_DATA_PACKAGE = 5011
> MODEL_META_DATA_NMAKE = 5012
> MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF = 5013
> MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF = 5014
> MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH = 5015
> MODEL_META_DATA_COMMENT = 5016
>-MODEL_META_DATA_GLOBAL_DEFINE = 5017
> MODEL_META_DATA_SECTION_HEADER = 5100
> MODEL_META_DATA_SUBSECTION_HEADER = 5200
> MODEL_META_DATA_TAIL_COMMENT = 5300
>
> MODEL_EXTERNAL_DEPENDENCY = 1
>diff --git
>a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
>b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
>index 862974894a..cba1f40837 100644
>--- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
>+++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
>@@ -40,11 +40,11 @@ from Common.LongFilePathSupport import
>CodecOpenLongFilePath
> ## A decorator used to parse macro definition
> def ParseMacro(Parser):
> def MacroParser(self):
>   

Re: [edk2] [Patch] BaseTools: Remove the logic SourceOverridePath

2019-03-19 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: Feng, Bob C
>Sent: Friday, March 15, 2019 11:18 PM
>To: edk2-devel@lists.01.org
>Cc: Feng, Bob C ; Gao, Liming 
>Subject: [Patch] BaseTools: Remove the logic SourceOverridePath
>
>BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1350
>SOURCE_OVERRIDE_PATH is for EDK component INF files.
>The corresponding logic should be removed.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Bob Feng 
>Cc: Liming Gao 
>---
> BaseTools/Source/Python/AutoGen/AutoGen.py| 13 +
> BaseTools/Source/Python/Common/DataType.py|  2 --
> BaseTools/Source/Python/Common/GlobalData.py  |  1 -
> .../Python/CommonDataClass/DataClass.py   |  2 --
> .../Ecc/MetaFileWorkspace/MetaFileParser.py   |  8 
> BaseTools/Source/Python/Eot/EotMain.py|  2 +-
> BaseTools/Source/Python/Eot/InfParserLite.py  |  6 +-
> .../Source/Python/UPT/Library/DataType.py |  3 ---
> .../Python/Workspace/BuildClassObject.py  |  1 -
> .../Source/Python/Workspace/DscBuildData.py   | 19 ---
> .../Source/Python/Workspace/InfBuildData.py   | 11 +--
> .../Source/Python/Workspace/MetaFileParser.py |  8 
> 12 files changed, 4 insertions(+), 72 deletions(-)
>
>diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
>b/BaseTools/Source/Python/AutoGen/AutoGen.py
>index 568d535754..8c7c20a386 100644
>--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
>+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
>@@ -1139,11 +1139,10 @@ class PlatformAutoGen(AutoGen):
> self.WorkspaceDir = Workspace.WorkspaceDir
> self.ToolChain = Toolchain
> self.BuildTarget = Target
> self.Arch = Arch
> self.SourceDir = PlatformFile.SubDir
>-self.SourceOverrideDir = None
> self.FdTargetList = self.Workspace.FdTargetList
> self.FvTargetList = self.Workspace.FvTargetList
> # get the original module/package/platform objects
> self.BuildDatabase = Workspace.BuildDatabase
> self.DscBuildDataObj = Workspace.Platform
>@@ -2557,15 +2556,10 @@ class ModuleAutoGen(AutoGen):
> self.PlatformInfo = PlatformAutoGen(Workspace, PlatformFile, Target,
>Toolchain, Arch)
>
> self.SourceDir = self.MetaFile.SubDir
> self.SourceDir = mws.relpath(self.SourceDir, self.WorkspaceDir)
>
>-self.SourceOverrideDir = None
>-# use overridden path defined in DSC file
>-if self.MetaFile.Key in GlobalData.gOverrideDir:
>-self.SourceOverrideDir = 
>GlobalData.gOverrideDir[self.MetaFile.Key]
>-
> self.ToolChain = Toolchain
> self.BuildTarget = Target
> self.Arch = Arch
> self.ToolChainFamily = self.PlatformInfo.ToolChainFamily
> self.BuildRuleFamily = self.PlatformInfo.BuildRuleFamily
>@@ -2766,16 +2760,11 @@ class ModuleAutoGen(AutoGen):
> @cached_property
> def CustomMakefile(self):
> RetVal = {}
> for Type in self.Module.CustomMakefile:
> MakeType = gMakeTypeMap[Type] if Type in gMakeTypeMap else
>'nmake'
>-if self.SourceOverrideDir is not None:
>-File = os.path.join(self.SourceOverrideDir,
>self.Module.CustomMakefile[Type])
>-if not os.path.exists(File):
>-File = os.path.join(self.SourceDir,
>self.Module.CustomMakefile[Type])
>-else:
>-File = os.path.join(self.SourceDir,
>self.Module.CustomMakefile[Type])
>+File = os.path.join(self.SourceDir, 
>self.Module.CustomMakefile[Type])
> RetVal[MakeType] = File
> return RetVal
>
> ## Return the directory of the makefile
> #
>diff --git a/BaseTools/Source/Python/Common/DataType.py
>b/BaseTools/Source/Python/Common/DataType.py
>index 798c0e353d..685f428862 100644
>--- a/BaseTools/Source/Python/Common/DataType.py
>+++ b/BaseTools/Source/Python/Common/DataType.py
>@@ -304,12 +304,10 @@ TAB_COMPONENTS_IA32 = TAB_COMPONENTS +
>TAB_SPLIT + TAB_ARCH_IA32
> TAB_COMPONENTS_X64 = TAB_COMPONENTS + TAB_SPLIT +
>TAB_ARCH_X64
> TAB_COMPONENTS_ARM = TAB_COMPONENTS + TAB_SPLIT +
>TAB_ARCH_ARM
> TAB_COMPONENTS_EBC = TAB_COMPONENTS + TAB_SPLIT +
>TAB_ARCH_EBC
> TAB_COMPONENTS_AARCH64 = TAB_COMPONENTS + TAB_SPLIT +
>TAB_ARCH_AARCH64
>
>-TAB_COMPONENTS_SOURCE_OVERRIDE_PATH =
>'SOURCE_OVERRIDE_PATH'
>-
> TAB_BUILD_OPTIONS = 'BuildOptions'
>
> TAB_DEFINE = 'DEFINE'
> TAB_NMAKE = 'Nmake'
> TAB_USER_EXTENSIONS = 'UserExtensions'
>diff --git a/BaseTools/Source/Python/Common/GlobalData.py
>b/BaseTools/Source/Python/Common/GlobalData.py
>index f11799

Re: [edk2] [Patch] BaseTools: Remove EDKI related logic from Trim tool

2019-03-19 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: Feng, Bob C
>Sent: Friday, March 15, 2019 11:22 PM
>To: edk2-devel@lists.01.org
>Cc: Feng, Bob C ; Gao, Liming 
>Subject: [Patch] BaseTools: Remove EDKI related logic from Trim tool
>
>BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1350
>
>Remove EDKI related logic from Trim tool.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Bob Feng 
>Cc: Liming Gao 
>---
> BaseTools/Source/Python/Trim/Trim.py | 160 ---
> 1 file changed, 160 deletions(-)
>
>diff --git a/BaseTools/Source/Python/Trim/Trim.py
>b/BaseTools/Source/Python/Trim/Trim.py
>index 825ed3e5d5..228779b5a9 100644
>--- a/BaseTools/Source/Python/Trim/Trim.py
>+++ b/BaseTools/Source/Python/Trim/Trim.py
>@@ -59,74 +59,10 @@ gLongNumberPattern = re.compile("(?<=[^a-zA-Z0-
>9_])(0[xX][0-9a-fA-F]+|[0-9]+)U?L
> ## Regular expression for matching "Include ()" in asl file
> gAslIncludePattern = re.compile("^(\s*)[iI]nclude\s*\(\"?([^\"\(\)]+)\"\)",
>re.MULTILINE)
> ## Regular expression for matching C style #include "XXX.asl" in asl file
> gAslCIncludePattern = re.compile(r'^(\s*)#include\s*[<"]\s*([-
>\\/\w.]+)\s*([>"])', re.MULTILINE)
> ## Patterns used to convert EDK conventions to EDK2 ECP conventions
>-gImportCodePatterns = [
>-[
>-re.compile('^(\s*)\(\*\*PeiServices\)\.PciCfg\s*=\s*([^;\s]+);',
>re.MULTILINE),
>-'''\\1{
>-\\1  STATIC EFI_PEI_PPI_DESCRIPTOR gEcpPeiPciCfgPpiList = {
>-\\1(EFI_PEI_PPI_DESCRIPTOR_PPI |
>EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
>-\\1,
>-\\1\\2
>-\\1  };
>-\\1  (**PeiServices).InstallPpi (PeiServices, );
>-\\1}'''
>-],
>-
>-[
>-re.compile('^(\s*)\(\*PeiServices\)->PciCfg\s*=\s*([^;\s]+);',
>re.MULTILINE),
>-'''\\1{
>-\\1  STATIC EFI_PEI_PPI_DESCRIPTOR gEcpPeiPciCfgPpiList = {
>-\\1(EFI_PEI_PPI_DESCRIPTOR_PPI |
>EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
>-\\1,
>-\\1\\2
>-\\1  };
>-\\1  (**PeiServices).InstallPpi (PeiServices, );
>-\\1}'''
>-],
>-
>-[
>-re.compile("(\s*).+->Modify[\s\n]*\(", re.MULTILINE),
>-'\\1PeiLibPciCfgModify ('
>-],
>-
>-[
>-re.compile("(\W*)gRT->ReportStatusCode[\s\n]*\(", re.MULTILINE),
>-'\\1EfiLibReportStatusCode ('
>-],
>-
>-[
>-
>re.compile('#include\s+EFI_GUID_DEFINITION\s*\(FirmwareFileSystem\)',
>re.MULTILINE),
>-'#include EFI_GUID_DEFINITION (FirmwareFileSystem)\n#include
>EFI_GUID_DEFINITION (FirmwareFileSystem2)'
>-],
>-
>-[
>-re.compile('gEfiFirmwareFileSystemGuid', re.MULTILINE),
>-'gEfiFirmwareFileSystem2Guid'
>-],
>-
>-[
>-re.compile('EFI_FVH_REVISION', re.MULTILINE),
>-'EFI_FVH_PI_REVISION'
>-],
>-
>-[
>-
>re.compile("(\s*)\S*CreateEvent\s*\([\s\n]*EFI_EVENT_SIGNAL_READY_TO
>_BOOT[^,]*,((?:[^;]+\n)+)(\s*\));", re.MULTILINE),
>-'\\1EfiCreateEventReadyToBoot (\\2\\3;'
>-],
>-
>-[
>-
>re.compile("(\s*)\S*CreateEvent\s*\([\s\n]*EFI_EVENT_SIGNAL_LEGACY_B
>OOT[^,]*,((?:[^;]+\n)+)(\s*\));", re.MULTILINE),
>-'\\1EfiCreateEventLegacyBoot (\\2\\3;'
>-],
>-#[
>-#re.compile("(\W)(PEI_PCI_CFG_PPI)(\W)", re.MULTILINE),
>-#'\\1ECP_\\2\\3'
>-#]
>-]
>
> ## file cache to avoid circular include in ASL file
> gIncludedAslFile = []
>
> ## Trim preprocessed source code
>@@ -492,101 +428,10 @@ def GenerateVfrBinSec(ModuleName, DebugDir,
>OutputFile):
> EdkLogger.error("Trim", FILE_WRITE_FAILURE, "Write data to file %s
>failed, please check whether the file been locked or using by other
>applications." %OutputFile, None)
>
> fStringIO.close ()
> fInputfile.close ()
>
>-## Trim EDK source code file(s)
>-#
>-#
>-# @param  SourceFile or directory to be trimmed
>-# @param  TargetFile or directory to store the trimmed content
>-#
>-def TrimEdkSources(Source, Target):
>-if os.path.isdir(Source):
>-for CurrentDir, Dirs, Files in os.walk(Source):
>-if '.svn' in Dirs:
>-Dirs.remove('.svn')
>-elif "CVS" in Dirs:
>-Dirs.remove("CVS")
>-
>-for FileName in Files:
>-Dummy, Ext = os.path.splitext(FileName)
>-if Ext.upper() not in ['.C', '.H']: continue
>-if Target is None or Target == '':
>-TrimEdkSourceCode(
>

Re: [edk2] [PATCH V2 01/17] MdePkg/DebugLib.h: Add a new api DebugVPrint for DebugLib

2019-03-18 Thread Gao, Liming
Jordan:
  Coding style document CCS_2_1_Draft.pdf 5.1 General Rules, 5.1.1 Lines shall 
be 120 columns, or less. Preferably, limit line lengths to 80 columns or less. 
So, I don't think the line length bigger than 80 and less than 120 violates 
coding style documents. We should update wiki 
https://github.com/tianocore/tianocore.github.io/wiki/Code-Style-C to match the 
documentation. Limit line length to 120 characters instead of 80 characters. 

Thanks
Liming
> -Original Message-
> From: Justen, Jordan L
> Sent: Monday, March 18, 2019 2:21 PM
> To: Gao, Zhichao ; edk2-devel@lists.01.org
> Cc: Kinney, Michael D ; Bret Barkelew 
> ; Michael Turner
> ; Gao, Liming 
> Subject: RE: [edk2] [PATCH V2 01/17] MdePkg/DebugLib.h: Add a new api 
> DebugVPrint for DebugLib
> 
> On 2019-03-17 17:14:40, Gao, Zhichao wrote:
> > > -Original Message-
> > > From: Justen, Jordan L
> > > Sent: Friday, March 15, 2019 2:16 PM
> > >
> > > On 2019-03-14 22:17:33, Zhichao Gao wrote:
> > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1395
> > > >
> > > > Add a new api DebugVPrint prototype definition in the
> > > > DebugLib header file. This api would expose a print
> > > > routine with VaList parameter.
> > >
> > > These lines seem to be fairly short, with the longest be 54 chars. I 
> > > guess not a
> > > problem, but by the recommendation says they could be up to 75 in length.
> > >
> > > https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-
> > > Format
> > >
> >
> > It is hard for someone to control the characters in a line.
> 
> I guess that depends on your editor. :)
> 
> > Making the text massage readable base on the rules make more sense.
> > It is easier to control the chars number within 75. Line length less
> > than 76 characters is legal.
> 
> Yes, I mentioned it is legal, but it is noticably short. I don't think
> it is so short that it is really a problem, so feel free to leave it
> if you prefer.
> 
> > >
> > > According to the style guide:
> > >
> > >   "Preferably, limit line lengths to 80 columns or less."
> > >
> > > https://github.com/tianocore/tianocore.github.io/wiki/Code-Style-C
> > >
> > > https://github.com/tianocore-
> > > docs/Docs/raw/master/Specifications/CCS_2_1_Draft.pdf
> > >
> > > But, this line uses 92 columns.
> > >
> > > I think there are similar cases in other patches.
> >
> > Right. This sentence I copied from the comment of DebugPrint
> > function which might be designed for a long time. The CCS might not
> > be designed as such style at that time. For this, it's better to
> > change both of the two sentences.
> > By the way, the whole edk2 repo may contain a lot of lines violated
> > this rule. It takes effort to fix them all.
> 
> I agree there are many violations of this in edk2.
> 
> Usually, it's not too important to go around fixing the issues that
> already happened, but if you are changing or adding some code, then
> you can try to make sure the new lines you add are good.
> 
> -Jordan
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] BaseTools: Add missing license and copyright info

2019-03-17 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: Bi, Dandan
> Sent: Friday, March 15, 2019 1:23 AM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C ; Gao, Liming ; 
> Kinney, Michael D 
> Subject: [patch] BaseTools: Add missing license and copyright info
> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Michael D Kinney 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Dandan Bi 
> ---
>  .../Conf/Empty_Package_Information_Data_File.ini | 12 
>  1 file changed, 12 insertions(+)
> 
> diff --git a/BaseTools/Conf/Empty_Package_Information_Data_File.ini 
> b/BaseTools/Conf/Empty_Package_Information_Data_File.ini
> index fe162568c4..230d858ef9 100644
> --- a/BaseTools/Conf/Empty_Package_Information_Data_File.ini
> +++ b/BaseTools/Conf/Empty_Package_Information_Data_File.ini
> @@ -1,5 +1,17 @@
> +;@file
> +; Example ini file used for UPT.
> +;
> +; Copyright (c) 2011 - 2019, Intel Corporation. All rights reserved.
> +; This program and the accompanying materials
> +; are licensed and made available under the terms and conditions of the BSD 
> License
> +; which accompanies this distribution.  The full text of the license may be 
> found at
> +; http://opensource.org/licenses/bsd-license.php
> +;
> +; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +;
>  [DistributionHeader]
>  Name =
>  GUID =
>  Version =
>  Vendor =
> --
> 2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] SecurityPkg/OpalPassword: Fix incorrect line ending issue.

2019-03-17 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Eric
>Dong
>Sent: Friday, March 01, 2019 10:34 AM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming 
>Subject: [edk2] [Patch] SecurityPkg/OpalPassword: Fix incorrect line ending
>issue.
>
>Cc: Liming Gao 
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Eric Dong 
>---
> SecurityPkg/Tcg/Opal/OpalPassword/OpalHiiCallbacks.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalHiiCallbacks.c
>b/SecurityPkg/Tcg/Opal/OpalPassword/OpalHiiCallbacks.c
>index 6d1a3a9b25..a1802313c3 100644
>--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalHiiCallbacks.c
>+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalHiiCallbacks.c
>@@ -115,4 +115,4 @@ HiiDiskGetNameCB(
> return Ctx->NameZ;
>   }
>   return NULL;
>-}
>\ No newline at end of file
>+}
>\ No newline at end of file
>--
>2.15.0.windows.1
>
>___
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 3/3] MdePkg/BaseSynchronizationLib: Remove inline X86 assembly code

2019-03-14 Thread Gao, Liming
Andrew:
  I don’t know who still uses Intel compiler. I propose to remove INTEL tool 
chain (ICC9 and ICC11) from tools_def.txt if no one rejects it. After INTEL 
tool chain is removed, if all compilers (VS, GCC, XCODE, and CLANG) supports 
the inline X86 assembly code, I will propose to remove those nasm files only 
for INTEL compiler.

Thanks
Liming
From: af...@apple.com [mailto:af...@apple.com]
Sent: Friday, March 8, 2019 4:15 PM
To: Kinney, Michael D 
Cc: Yao, Jiewen ; Gao, Liming ; 
edk2-devel-01 
Subject: Re: [edk2] [PATCH 3/3] MdePkg/BaseSynchronizationLib: Remove inline 
X86 assembly code




On Mar 8, 2019, at 4:07 PM, Kinney, Michael D 
mailto:michael.d.kin...@intel.com>> wrote:

Jiewen,

There are not many of those functions and they can be on speed paths.

I do not recommend converting them to only NASM.

I do recommend we add comments to NASM files and C files with include assembly 
that state that updates to one require updates to the others.


Mike,

It looks like NASM files only exist to support the INTEL compiler. Could that 
be an outdated assumption? Overtime has the INTEL compiler added more 
compatibility with GCC inline assembly, or VC++ intrinsics? I assume people are 
still using the INTEL compiler?

Thanks,

Andrew Fish



Mike

From: Yao, Jiewen
Sent: Wednesday, March 6, 2019 11:25 PM
To: Gao, Liming mailto:liming@intel.com>>; 
af...@apple.com<mailto:af...@apple.com>
Cc: Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>; edk2-devel-01 
mailto:edk2-devel@lists.01.org>>
Subject: RE: [edk2] [PATCH 3/3] MdePkg/BaseSynchronizationLib: Remove inline 
X86 assembly code

Thanks.

I also recommend to take a look at MdePkg\Library\BaseSynchronizationLib.

That is also complicated and not so readable for me.

And we have 8 patches to *fix* the real problem in 2018.

Thank you
Yao Jiewen


From: Gao, Liming
Sent: Wednesday, March 6, 2019 11:15 PM
To: af...@apple.com<mailto:af...@apple.com>; Yao, Jiewen 
mailto:jiewen@intel.com>>
Cc: Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>; edk2-devel-01 
mailto:edk2-devel@lists.01.org>>
Subject: RE: [edk2] [PATCH 3/3] MdePkg/BaseSynchronizationLib: Remove inline 
X86 assembly code

Thanks for your clarification. Now, we will focus on SetJump/LongJump() first.

Thanks
Liming
From: af...@apple.com<mailto:af...@apple.com> [mailto:af...@apple.com]
Sent: Wednesday, March 6, 2019 10:45 PM
To: Yao, Jiewen mailto:jiewen@intel.com>>
Cc: Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>; Gao, Liming 
mailto:liming@intel.com>>; edk2-devel-01 
mailto:edk2-devel@lists.01.org>>
Subject: Re: [edk2] [PATCH 3/3] MdePkg/BaseSynchronizationLib: Remove inline 
X86 assembly code



On Mar 6, 2019, at 10:09 PM, Yao, Jiewen 
mailto:jiewen@intel.com>> wrote:

Thanks Andrew.
Now I 100% agree with you - I think it is fine to restrict new C inline 
assembler, or at least have a very high bar to add anything new. Any new inline 
assembler *should also be simple and just be a function abstracting a CPU 
op-code* that is not available to C. This is how we prevent the maintenance 
issues you are worrying about.

And I also agree with your case.

Let’s discuss another case. Below 2 functions SetJump/LongJump are updated 
recently, by me unfortunately.

It is unclear to me what is the size optimization we can get by inline 
SetJump/LongJump.
But obviously, it brings the maintenance issue to me.
And I don’t believe it meets the criteria you mentioned above.


Jiewen,

I agree it seems like given the rules we agree on this code should be written 
in NASM.

Thanks,

Andrew Fish

_declspec (naked)
RETURNS_TWICE
UINTN
EFIAPI
SetJump (
  OUT BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer
  )
{
  _asm {
push[esp + 4]
callInternalAssertJumpBuffer
pop ecx
pop ecx
mov edx, [esp]

xor eax, eax
mov [edx + 24], eax; save 0 to SSP

mov eax, [PcdGet32 (PcdControlFlowEnforcementPropertyMask)]
testeax, eax
jz  CetDone
_emit  0x0F
_emit  0x20
_emit  0xE0; mov eax, cr4
bt  eax, 23; check if CET is enabled
jnc CetDone

mov eax, 1
_emit  0xF3
_emit  0x0F
_emit  0xAE
_emit  0xE8; INCSSP EAX to read original SSP
_emit  0xF3
_emit  0x0F
_emit  0x1E
_emit  0xC8; READSSP EAX
mov [edx + 0x24], eax  ; save SSP

CetDone:

mov [edx], ebx
mov [edx + 4], esi
mov [edx + 8], edi
mov [edx + 12], ebp
mov [edx + 16], esp
mov [edx + 20], ecx
xor eax, eax
jmp ecx
  }
}

__declspec (naked)
VOID
EFIAPI
InternalLongJump (
  IN  BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer,
  IN  UINTN Value
  )
{
  _asm {
mov eax, [PcdGet32 (PcdControl

Re: [edk2] [PATCH] MdePkg/PciSegmentLibSegmentInfo: Change parameters type

2019-03-14 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: Zhang, Shenglei
> Sent: Tuesday, March 12, 2019 8:45 PM
> To: edk2-devel@lists.01.org
> Cc: Kinney, Michael D ; Gao, Liming 
> 
> Subject: [PATCH] MdePkg/PciSegmentLibSegmentInfo: Change parameters type
> 
> The current structure can lead to dependency on VC++ compiler support
> functions when build for "IA32" with "/Od" switch, such as _aullshr().
> So change the type of parameters in structure
> PCI_SEGMENT_LIB_ADDRESS_STRUCTURE from UINT64 to UINT32.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1532
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Shenglei Zhang 
> ---
>  .../PciSegmentLibSegmentInfo/PciSegmentLibCommon.c | 14 +++---
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/MdePkg/Library/PciSegmentLibSegmentInfo/PciSegmentLibCommon.c
> b/MdePkg/Library/PciSegmentLibSegmentInfo/PciSegmentLibCommon.c
> index e0bdb16911..1cac6488cc 100644
> --- a/MdePkg/Library/PciSegmentLibSegmentInfo/PciSegmentLibCommon.c
> +++ b/MdePkg/Library/PciSegmentLibSegmentInfo/PciSegmentLibCommon.c
> @@ -17,13 +17,13 @@
>  #include "PciSegmentLibCommon.h"
> 
>  typedef struct {
> -  UINT64  Register : 12;
> -  UINT64  Function : 3;
> -  UINT64  Device : 5;
> -  UINT64  Bus : 8;
> -  UINT64  Reserved1 : 4;
> -  UINT64  Segment : 16;
> -  UINT64  Reserved2 : 16;
> +  UINT32  Register : 12;
> +  UINT32  Function : 3;
> +  UINT32  Device : 5;
> +  UINT32  Bus : 8;
> +  UINT32  Reserved1 : 4;
> +  UINT32  Segment : 16;
> +  UINT32  Reserved2 : 16;
>  } PCI_SEGMENT_LIB_ADDRESS_STRUCTURE;
> 
>  /**
> --
> 2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] F29 Build Issue.

2019-03-14 Thread Gao, Liming
This is seemly deprecated https://github.com/tianocore/buildtools-BaseTools. We 
should use BaseTools in https://github.com/tianocore/edk2.

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Laszlo 
> Ersek
> Sent: Thursday, March 14, 2019 2:34 AM
> To: Andrew J. Hutton ; edk2-devel@lists.01.org
> Subject: Re: [edk2] F29 Build Issue.
> 
> On 03/13/19 14:27, Andrew J. Hutton wrote:
> > Unsure if this is a missing build dependency (since there doesn't appear
> > to be a check for this) am I missing a make dep or configure step
> > somewhere?
> >
> > This is stock F29, following the website instructions; the make -C
> > BaseTools/Source/C results in the following errror:
> >
> > make[1]: Entering directory
> > '/home/ajh/KVM/Clover/edk2/BaseTools/Source/C/GenVtf'
> > cc  -c -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror
> > -Wno-deprecated-declarations -nostdlib -c -g  -I .. -I ../Include/Common
> > -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I .
> > -I ../Include/X64/  GenVtf.c -o GenVtf.o
> > GenVtf.c: In function ‘CreateFitTableAndInitialize’:
> > GenVtf.c:1473:3: error: ‘strncpy’ output truncated before terminating
> > nul copying 8 bytes from a string of the same length
> > [-Werror=stringop-truncation]
> >    strncpy ((CHAR8 *) >CompAddress, FIT_SIGNATURE, 8);  //
> > "_FIT_ "
> >    ^~~
> > cc1: all warnings being treated as errors
> > make[1]: *** [../Makefiles/footer.makefile:27: GenVtf.o] Error 1
> > make[1]: Leaving directory
> > '/home/ajh/KVM/Clover/edk2/BaseTools/Source/C/GenVtf'
> > make: *** [GNUmakefile:73: GenVtf] Error 2
> > make: Leaving directory '/home/ajh/KVM/Clover/edk2/BaseTools/Source/C'
> 
> The edk2 codebase that you are consuming is too old. The above symptom
> should not be present since commit 1d212a83df0e
> ("BaseTools/header.makefile: add "-Wno-stringop-truncation"", 2018-03-05).
> 
> The command line you quoted also misses "-Wno-unused-result", so I think
> you must be missing commit 202726b3ceb3 ("BaseTools Makefile: Enable O2
> option for GCC tool chain", 2016-10-08) as well.
> 
> I assume clover still uses an edk2 checkout that's 2.5+ years old at
> this point.
> 
> Thanks,
> Laszlo
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] BaseTools: Enable compiler cache support in edk2 build

2019-03-10 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: Shi, Steven
>Sent: Wednesday, January 30, 2019 12:18 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming 
>Subject: [PATCH] BaseTools: Enable compiler cache support in edk2 build
>
>https://bugzilla.tianocore.org/show_bug.cgi?id=1499
>Compiler cache can greatly improve the build performance and
>guarantee the build result safe. In our testing, the compiler
>cache can improve the overall clean build time usually by 30+%
>in linux and 10+% in windows. The compiler cache are very fit
>to improve the Continuous Integration (CI) build performance.
>
>For linux compiler cache (ccache) enabling, there is no need
>to update edk2 code.
>Below link has the ccache enabling referencd steps:
>https://github.com/shijunjing/edk2/wiki/
>Edk2-compiler-cache-enabling-steps-on-Linux
>
>For windows compiler cache (clcache) enabling, we need update
>the .PDB debugging file producing option from /Zi to /Z7,
>which is to let the C object file contain its full symbolic
>debugging information rather than produces a separated PDB file
>for all obj files per folder. "PDB files are generated by a different
>process (mspdbsrv). They arrive or are updated on disk after
>cl completes a compilation or linking operation. One huge problem
>with caching them is that the pdb files are input files as well as
>outputs. mspdbsrv updates the file with new debug information if
>the file exists beforehand. If there are several compilations going
>on at once targetting the same pdb then the order the pdb gets
>updated is unpredictable. All this makes caching very hard."
>The /Zi issue more detail disccusion can be found:
>https://github.com/frerich/clcache/issues/30
>Please be aware that this change has no any impact to edk2 module
>level PDB file generation, and we still can get the PDB debug file
>for a .efi module. The /Z7 only impact intermediate obj files level
>PDB file, which is current one PDB file (vc140.pdb) per obj folder.
>
>Below link has the clcache enabling referencd steps:
>https://github.com/shijunjing/edk2/wiki/
>Edk2-compiler-cache-enabling-steps-on-Windows
>
>Have tested below tools which consume the .PDB file:
>*Edk2 source code debugger
>*Various hardware and software debuggers
>*Uefi code coverage tools
>
>Only update and test below most commonly used four msvc toolchains:
>VS2012x86 VS2013x86 VS2015x86 VS2017
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Steven Shi 
>Cc: Liming Gao 
>---
> BaseTools/Conf/tools_def.template | 32 
> 1 file changed, 16 insertions(+), 16 deletions(-)
>
>diff --git a/BaseTools/Conf/tools_def.template
>b/BaseTools/Conf/tools_def.template
>index 2bd0982872..7d04b3efd2 100755
>--- a/BaseTools/Conf/tools_def.template
>+++ b/BaseTools/Conf/tools_def.template
>@@ -2589,9 +2589,9 @@ NOOPT_VS2012xASL_X64_DLINK_FLAGS=
>/NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:RE
> *_VS2012x86_IA32_ASM_PATH = DEF(VS2012x86_BIN)\ml.exe
>
>   *_VS2012x86_IA32_MAKE_FLAGS  = /nologo
>-  DEBUG_VS2012x86_IA32_CC_FLAGS= /nologo /arch:IA32 /c /WX /GS- /W4
>/Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
>+  DEBUG_VS2012x86_IA32_CC_FLAGS= /nologo /arch:IA32 /c /WX /GS-
>/W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7
> RELEASE_VS2012x86_IA32_CC_FLAGS= /nologo /arch:IA32 /c /WX /GS- /W4
>/Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF
>-NOOPT_VS2012x86_IA32_CC_FLAGS  = /nologo /arch:IA32 /c /WX /GS-
>/W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od
>+NOOPT_VS2012x86_IA32_CC_FLAGS  = /nologo /arch:IA32 /c /WX /GS-
>/W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od
>
>   DEBUG_VS2012x86_IA32_ASM_FLAGS   = /nologo /c /WX /W3 /Cx /coff /Zd
>/Zi
> RELEASE_VS2012x86_IA32_ASM_FLAGS   = /nologo /c /WX /W3 /Cx /coff /Zd
>@@ -2621,9 +2621,9 @@ NOOPT_VS2012x86_IA32_DLINK_FLAGS   =
>/NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
> *_VS2012x86_X64_DLINK_PATH= DEF(VS2012x86_BINX64)\link.exe
> *_VS2012x86_X64_ASLDLINK_PATH = DEF(VS2012x86_BINX64)\link.exe
>
>-  DEBUG_VS2012x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768
>/D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
>+  DEBUG_VS2012x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768
>/D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7
> RELEASE_VS2012x86_X64_CC_FLAGS = /nologo /c /WX /GS- /W4 /Gs32768
>/D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF
>-NOOPT_VS2012x86_X64_CC_FLAGS   = /nologo /c /WX /GS- /W4 /Gs32768
>/D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od
>+NOOPT_VS2012x86_X64_CC_FLAGS 

[edk2] [edk2-announce] EDK II Stable Tag release edk2-stable201903 completed

2019-03-08 Thread Gao, Liming
Hi, all

The tag edk2-stable201903 has been created. 
https://github.com/tianocore/edk2/releases/tag/edk2-stable201903
  git clone -b edk2-stable201903 https://github.com/tianocore/edk2.git

The tag edk2-stable201903 has been added into the main EDK II Wiki page.
  https://github.com/tianocore/tianocore.github.io/wiki/EDK-II

The quiet period has now ended. Thank you for your cooperation and patience. 
Normal commits can now be resumed.

Future edk2 stable tag (edk2-stable201905, edk2-stable201908, 
edk2-stable2019011) planning has been added into wiki page.
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning.

If you have ideas for features in the future stable tag, please enter a 
Bugzilla for evaluation. Please let me know if there are existing open Bugzilla 
entries that should be targeted at next stable tag.

Thanks
Liming
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 0/2] Fix bugs in HiiDatabase driver

2019-03-08 Thread Gao, Liming
Laszlo:
  Thanks for your suggestion. There is no other. I have update Wiki page to 
delay 12 hour for this stable tag. I have pushed this CVE fix. I will create 
the stable tag quickly and send another announcement. 

Thanks
Liming
> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Friday, March 8, 2019 4:51 AM
> To: Gao, Liming ; Wang, Jian J ; 
> Ni, Ray ; edk2-devel@lists.01.org;
> Kinney, Michael D ; af...@apple.com; Leif 
> Lindholm 
> Cc: Cetola, Stephano 
> Subject: Re: [edk2] [PATCH v2 0/2] Fix bugs in HiiDatabase driver
> 
> On 03/08/19 09:52, Laszlo Ersek wrote:
> > On 03/08/19 07:41, Gao, Liming wrote:
> >> This is to fix the security issue. I agree it is an import bug fix. I am 
> >> OK to push it for edk2-stable201903 tag
> >
> > Me too.
> >
> > If we had stable *branches* (as opposed to just stable tags), then we
> > wouldn't have to delay the stable tag (the release) -- we'd just apply
> > the CVE fix to both the master branch (*after* the stable tag) and on
> > the stable branch too. But our development workflow isn't there yet, so
> > I guess we can delay the stable tag a bit more. I suggest updating the
> > date in
> > <https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning#edk2-stable201903-tag-planning>.
> 
> Is there anything else blocking the tag, at the moment?
> 
> Thanks
> Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [edk2-announce] Hard Feature Freeze starts from 2019-03-01(00:00:00 UTC-8) for edk2-stable201903

2019-03-08 Thread Gao, Liming
Laszlo:
  https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Notes is 
designed to include the change in this stable tag. After the stable tag is 
created, the contents will be moved to tag notes. This wiki will be clear. 
  
  All things in 
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning 
are moved into the stable tag notes. We may keep the link to point to release 
tag note. 

Thanks
Liming
> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Friday, March 8, 2019 7:21 AM
> To: Tian, Hot ; Richardson, Brian 
> ; Gao, Liming ;
> edk2-devel@lists.01.org
> Subject: Re: [edk2] [edk2-announce] Hard Feature Freeze starts from 
> 2019-03-01(00:00:00 UTC-8) for edk2-stable201903
> 
> On 03/08/19 15:30, Tian, Hot wrote:
> > For this specific question from Laszlo, I do not have strong 
> > recommendation. Liming/Laszlo can work out a recommendation.
> > But looking at 
> > https://github.com/tianocore/tianocore.github.io/wiki/EDK-II, I do have 
> > recommendation to make UDK less prominent
> (e.g. remove "UDK Releases" section) as we've migrated to quarterly stable 
> tag release model on edk2 master.
> 
> Well, I'm not sure if my suggestion is logical, but given that I was
> staring at
> <https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning>
> when I got lost :) , I think it might help if the "current release
> planning" page simply featured a link to "past releases".
> 
> The latter can be a standalone wiki page or even a section in a larger page.
> 
> 
> Considering the sum of the currently available notes, the inconsistency
> is that
> 
> - for the first tag we had ("edk2-stable201808"), we seem to offer no
> notes (that's OK, we had just started back then);
> 
> - for the second tag ("edk2-stable201811"), the notes are at:
> 
> https://github.com/tianocore/edk2/releases/tag/edk2-stable201811
> 
> which was edited... I got no clue where (certainly not in the edk2-wiki);
> 
> - and for the upcoming tag, we have the notes at:
> 
> https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Notes#edk2-stable201903-tag
> 
> Thanks,
> Laszlo
> 
> 
> > -Original Message-
> > From: Richardson, Brian
> > Sent: Friday, March 08, 2019 22:19
> > To: Tian, Hot ; Tian, Hot ; Laszlo 
> > Ersek ; Gao, Liming
> ; edk2-devel@lists.01.org
> > Subject: RE: [edk2] [edk2-announce] Hard Feature Freeze starts from 
> > 2019-03-01(00:00:00 UTC-8) for edk2-stable201903
> >
> > Hot: it looks like we need to revise the wiki page so the stable tag & 
> > release notes links are more prominent. Any recommendations on
> changes?
> >
> > Thanks ... br
> > ---
> > Brian Richardson -- Director, Firmware Ecosystem Development 
> > brian.richard...@intel.com -- @intel_brian (Twitter & WeChat)
> https://software.intel.com/en-us/meet-the-developers/evangelists/team/brian-richardson
> >
> > -Original Message-
> > From: edk2-devel  On Behalf Of Tian, Hot
> > Sent: Friday, March 8, 2019 8:48 AM
> > To: Tian, Hot ; Laszlo Ersek ; Gao, 
> > Liming ; edk2-devel@lists.01.org
> > Subject: Re: [edk2] [edk2-announce] Hard Feature Freeze starts from 
> > 2019-03-01(00:00:00 UTC-8) for edk2-stable201903
> >
> > I guess 
> > https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Notes 
> > is also for future release notes. Seems it's not listed
> on https://github.com/tianocore/tianocore.github.io/wiki/EDK-II.
> >
> >
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 
> > Tian, Hot
> > Sent: Friday, March 08, 2019 21:38
> > To: Laszlo Ersek ; Gao, Liming ; 
> > edk2-devel@lists.01.org
> > Subject: Re: [edk2] [edk2-announce] Hard Feature Freeze starts from 
> > 2019-03-01(00:00:00 UTC-8) for edk2-stable201903
> >
> > Hi Laszlo,
> >
> > You can find the permanent release notes on 
> > https://github.com/tianocore/tianocore.github.io/wiki/EDK-II:
> > Under Stable Tags session: 
> > https://github.com/tianocore/edk2/releases/tag/edk2-stable201811
> > https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning
> >  is for Future Release and Tag Planning.
> >
> > Thanks,
> > Hot
> >
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 
> > Laszlo Ersek
> > Sent: Friday, March 08, 2019 17:00
> > To: Gao, Liming ; edk2-devel@lists.01

[edk2] [edk2-announce] EDK II Stable Tag edk2-stable201903 will be created based on commit 89910a

2019-03-08 Thread Gao, Liming
Hi, all
Sorry for a little late announce. I wait for some time to collect the feedback 
on the CEV fix. There is no rejection on CVE fix. So, I add it to this tag 
release. I will create edk2-stable201903 based on current edk2 trunk (commit 
89910a MdeModulePkg/HiiImage: Fix stack overflow when corrupted BMP is parsed 
(CVE-2018-12181)) before PST time (UTC - 8) 12:00PM of 2019-03-08. If you have 
any comments, please reply the mail. If no concern or objection, I will create 
tag and send another announce mail that edk2-stable201903 is completed and 
normal commit is resumed.

Thanks
Liming

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 0/2] Fix bugs in HiiDatabase driver

2019-03-07 Thread Gao, Liming
This is to fix the security issue. I agree it is an import bug fix. I am OK to 
push it for edk2-stable201903 tag

Thanks
Liming
> -Original Message-
> From: Wang, Jian J
> Sent: Thursday, March 7, 2019 7:17 PM
> To: Ni, Ray ; edk2-devel@lists.01.org
> Cc: Cetola, Stephano ; Gao, Liming 
> 
> Subject: RE: [edk2] [PATCH v2 0/2] Fix bugs in HiiDatabase driver
> 
> Hi all,
> 
> This is a very important fix for this issue. If no objection, I'd like the 
> patch be part of this stable tag.
> 
> 
> As to this patch series,
> 
> Reviewed-by: Jian J Wang 
> 
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ray 
> > Ni
> > Sent: Friday, March 08, 2019 10:35 AM
> > To: edk2-devel@lists.01.org
> > Subject: [edk2] [PATCH v2 0/2] Fix bugs in HiiDatabase driver
> >
> > v2: put the CVE number in patch title.
> >
> > Ray Ni (2):
> >   MdeModulePkg/HiiDatabase: Fix potential integer overflow
> > (CVE-2018-12181)
> >   MdeModulePkg/HiiImage: Fix stack overflow when corrupted BMP is parsed
> > (CVE-2018-12181)
> >
> >  MdeModulePkg/Universal/HiiDatabaseDxe/Image.c | 130 ++
> >  1 file changed, 105 insertions(+), 25 deletions(-)
> >
> > --
> > 2.20.1.windows.1
> >
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 0/2] Fix bugs in HiiDatabase driver

2019-03-07 Thread Gao, Liming
Please follow CVE format in 
https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-Format

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ray Ni
> Sent: Thursday, March 7, 2019 6:21 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [PATCH 0/2] Fix bugs in HiiDatabase driver
> 
> Ray Ni (2):
>   MdeModulePkg/HiiDatabase: Fix potential integer overflow
>   MdeModulePkg/HiiImage: Fix stack overflow when corrupted BMP is parsed
> 
>  MdeModulePkg/Universal/HiiDatabaseDxe/Image.c | 130 ++
>  1 file changed, 105 insertions(+), 25 deletions(-)
> 
> --
> 2.20.1.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 3/3] MdePkg/BaseSynchronizationLib: Remove inline X86 assembly code

2019-03-06 Thread Gao, Liming
Thanks for your clarification. Now, we will focus on SetJump/LongJump() first.

Thanks
Liming
From: af...@apple.com [mailto:af...@apple.com]
Sent: Wednesday, March 6, 2019 10:45 PM
To: Yao, Jiewen 
Cc: Kinney, Michael D ; Gao, Liming 
; edk2-devel-01 
Subject: Re: [edk2] [PATCH 3/3] MdePkg/BaseSynchronizationLib: Remove inline 
X86 assembly code




On Mar 6, 2019, at 10:09 PM, Yao, Jiewen 
mailto:jiewen@intel.com>> wrote:

Thanks Andrew.
Now I 100% agree with you - I think it is fine to restrict new C inline 
assembler, or at least have a very high bar to add anything new. Any new inline 
assembler *should also be simple and just be a function abstracting a CPU 
op-code* that is not available to C. This is how we prevent the maintenance 
issues you are worrying about.

And I also agree with your case.

Let’s discuss another case. Below 2 functions SetJump/LongJump are updated 
recently, by me unfortunately.

It is unclear to me what is the size optimization we can get by inline 
SetJump/LongJump.
But obviously, it brings the maintenance issue to me.
And I don’t believe it meets the criteria you mentioned above.


Jiewen,

I agree it seems like given the rules we agree on this code should be written 
in NASM.

Thanks,

Andrew Fish


_declspec (naked)
RETURNS_TWICE
UINTN
EFIAPI
SetJump (
  OUT BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer
  )
{
  _asm {
push[esp + 4]
callInternalAssertJumpBuffer
pop ecx
pop ecx
mov edx, [esp]

xor eax, eax
mov [edx + 24], eax; save 0 to SSP

mov eax, [PcdGet32 (PcdControlFlowEnforcementPropertyMask)]
testeax, eax
jz  CetDone
_emit  0x0F
_emit  0x20
_emit  0xE0; mov eax, cr4
bt  eax, 23; check if CET is enabled
jnc CetDone

mov eax, 1
_emit  0xF3
_emit  0x0F
_emit  0xAE
_emit  0xE8; INCSSP EAX to read original SSP
_emit  0xF3
_emit  0x0F
_emit  0x1E
_emit  0xC8; READSSP EAX
mov [edx + 0x24], eax  ; save SSP

CetDone:

mov [edx], ebx
mov [edx + 4], esi
mov [edx + 8], edi
mov [edx + 12], ebp
mov [edx + 16], esp
mov [edx + 20], ecx
xor eax, eax
jmp ecx
  }
}

__declspec (naked)
VOID
EFIAPI
InternalLongJump (
  IN  BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer,
  IN  UINTN Value
  )
{
  _asm {
mov eax, [PcdGet32 (PcdControlFlowEnforcementPropertyMask)]
testeax, eax
jz  CetDone
_emit  0x0F
_emit  0x20
_emit  0xE0; mov eax, cr4
bt  eax, 23; check if CET is enabled
jnc CetDone

mov edx, [esp + 4] ; edx = JumpBuffer
mov edx, [edx + 24]; edx = target SSP
_emit  0xF3
_emit  0x0F
_emit  0x1E
_emit  0xC8; READSSP EAX
sub edx, eax   ; edx = delta
mov eax, edx   ; eax = delta

shr eax, 2 ; eax = delta/sizeof(UINT32)
_emit  0xF3
_emit  0x0F
_emit  0xAE
_emit  0xE8; INCSSP EAX

CetDone:

pop eax ; skip return address
pop edx ; edx <- JumpBuffer
pop eax ; eax <- Value
mov ebx, [edx]
mov esi, [edx + 4]
mov edi, [edx + 8]
mov ebp, [edx + 12]
mov esp, [edx + 16]
jmp dword ptr [edx + 20]
  }
}



From: af...@apple.com<mailto:af...@apple.com> [mailto:af...@apple.com]
Sent: Wednesday, March 6, 2019 9:56 PM
To: Yao, Jiewen mailto:jiewen@intel.com>>
Cc: Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>; Gao, Liming 
mailto:liming@intel.com>>; edk2-devel-01 
mailto:edk2-devel@lists.01.org>>
Subject: Re: [edk2] [PATCH 3/3] MdePkg/BaseSynchronizationLib: Remove inline 
X86 assembly code





On Mar 6, 2019, at 9:06 PM, Yao, Jiewen 
mailto:jiewen@intel.com>> wrote:

HI Mike and Andrew
The problem is maintainability.

If we have multiple copy of implementation, a developer need verify multiple 
copy of implementation, if we make update. Before that, a developer has to be 
aware that there is multiple copy of implementation. - That increases the 
complexity.

If we have everything, there MAY be 5 copy - ASM, NASM, S, GCC inline, MS 
inline, theoretically.
Now, we remove ASM. It is good first step.
But we may still have 4 copies. I suggest we consider do more.

Jiewen,

I think you are trying do the right thing, but are optimize the wrong thing.

Most of the GCC/Clang inline assembler code is in Gccinline.c and since that 
code is mostly just abstracting an x86 instruction and the functions are very 
simple and thus it is NOT code that needs ongoi

Re: [edk2] [PATCH 3/3] MdePkg/BaseSynchronizationLib: Remove inline X86 assembly code

2019-03-06 Thread Gao, Liming
Andrew:
  I want to keep only one implementation. If inline assembly c source is 
preferred, I suggest to remove its nasm implementation.

Thanks
Liming
From: af...@apple.com [mailto:af...@apple.com]
Sent: Tuesday, March 5, 2019 2:44 PM
To: Gao, Liming 
Cc: Zhang, Shenglei ; edk2-devel-01 
; Kinney, Michael D 
Subject: Re: [edk2] [PATCH 3/3] MdePkg/BaseSynchronizationLib: Remove inline 
X86 assembly code




On Mar 5, 2019, at 1:32 PM, Gao, Liming 
mailto:liming@intel.com>> wrote:

Andrew:
 BZ 1163 is to remove inline X86 assembly code in C source file. But, this 
patch is wrong. I have gave my comments to update this patch.


Why do we want to remove inline X86 assembly. As I mentioned it will lead to 
larger binaries, slower binaries, and less optimized code.

For example take this simple inline assembly function:

VOID
EFIAPI
CpuBreakpoint (
  VOID
  )
{
  __asm__ __volatile__ ("int $3");
}


Today with clang LTO turned on calling CpuBreakpoint() looks like this from the 
callers point of view.

a.out[0x1fa5] <+6>:  cc  int3


But if we move that to NASM:


a.out[0x1fa6] <+7>:  e8 07 00 00 00  calll  0x1fb2; 
CpuBreakpoint


plus:
a.out`CpuBreakpoint:
a.out[0x1fb2] <+0>: cc int3
a.out[0x1fb3] <+1>: c3 retl


And there is also an extra push and pop on the stack. The other issue is the 
call to the function that is unknown to the compiler will act like a 
_ReadWriteBarrier (Yikes I see _ReadWriteBarrier is deprecated in VC++ 2017). 
Is the depreciation of some of these intrinsics in VC++ driving the removal of 
inline assembly? For GCC inline assembly works great for local compile, and for 
clang LTO it works in entire program optimization.

The LTO bitcode includes inline assembly and constraints so that the optimizer 
knows what to do so it can get optimized just like the abstract bitcode during 
the Link Time Optimization.

This is CpuBreakpoint():
; Function Attrs: noinline nounwind optnone ssp uwtable
define void @CpuBreakpoint() #0 {
  call void asm sideeffect "int $$3", "~{dirflag},~{fpsr},~{flags}"() #2, 
!srcloc !3
  ret void
}


This is AsmReadMsr64():
; Function Attrs: noinline nounwind optnone ssp uwtable
define i64 @AsmReadMsr64(i32) #0 {
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  store i32 %0, i32* %2, align 4
  %4 = load i32, i32* %2, align 4
  %5 = call i64 asm sideeffect "rdmsr", 
"=A,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %4) #2, !srcloc !4
  store i64 %5, i64* %3, align 8
  %6 = load i64, i64* %3, align 8
  ret i64 %6
}



I agree it make sense to remove .S and .asm files and only have .nasm files.

Thanks,

Andrew Fish

PS For the Xcode clang since it emits frame pointers by default we need to add 
the extra 4 bytes to save the assembly functions so the stack can get unwound.

a.out`CpuBreakpoint:
a.out[0x1f99] <+0>: 55 pushl  %ebp
a.out[0x1f9a] <+1>: 89 e5  movl   %esp, %ebp
a.out[0x1f9c] <+3>: cc int3
a.out[0x1f9d] <+4>: 5d popl   %ebp
a.out[0x1f9e] <+5>: c3 retl


So breakpoint goes from 1 byte to 11 bytes if we get rid of the intrinsics.


 The change is to reduce the duplicated implementation. It will be good on the 
code maintain. Recently, one patch has to update .c and .nasm both. Please see 
https://lists.01.org/pipermail/edk2-devel/2019-February/037165.html. Beside 
this change, I propose to remove all GAS assembly code for IA32 and X64 arch. 
After those change, the patch owner will collect the impact of the image size.

Thanks
Liming

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] Document: Add PCD flexible format value EBNF in Fdf.

2019-03-06 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: Feng, Bob C
> Sent: Tuesday, March 5, 2019 12:16 AM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C ; Gao, Liming ; 
> Zhu, Yonghong 
> Subject: [Patch] Document: Add PCD flexible format value EBNF in Fdf.
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=541
> 
> This patch is to add flexible PCD value format EBNF into Fdf spec.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> Cc: Yonghong Zhu 
> ---
>  3_edk_ii_fdf_file_format/32_fdf_definition.md | 25 ---
>  3_edk_ii_fdf_file_format/35_[fd]_sections.md  |  4 +--
>  3_edk_ii_fdf_file_format/36_[fv]_sections.md  |  4 +--
>  .../37_[capsule]_sections.md  |  4 +--
>  4 files changed, 27 insertions(+), 10 deletions(-)
> 
> diff --git a/3_edk_ii_fdf_file_format/32_fdf_definition.md 
> b/3_edk_ii_fdf_file_format/32_fdf_definition.md
> index db098cf..2b044ab 100644
> --- a/3_edk_ii_fdf_file_format/32_fdf_definition.md
> +++ b/3_edk_ii_fdf_file_format/32_fdf_definition.md
> @@ -1,9 +1,9 @@
>   2.20.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch V2 0/1] Document: Update Build spec to remove EDK related

2019-03-06 Thread Gao, Liming
Bob:
  Please ignore the previous comments. For build spec change, I have only one 
comment to update the commit message to remove EDK and IPF contents. With this 
change, Reviewed-by: Liming Gao 

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Gao, 
> Liming
> Sent: Wednesday, March 6, 2019 12:29 AM
> To: Feng, Bob C ; edk2-devel@lists.01.org
> Subject: Re: [edk2] [Patch V2 0/1] Document: Update Build spec to remove EDK 
> related
> 
> 1.  2.12 [UserExtensions] Section and ## 2.11 [UserExtensions] Section are 
> inconsistent. There are the similar issue in this patch. Please
> check them to make sure they are same.
> 
> Thanks
> Liming
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 
> > Feng, Bob C
> > Sent: Tuesday, March 5, 2019 11:49 PM
> > To: edk2-devel@lists.01.org
> > Subject: [edk2] [Patch V2 0/1] Document: Update Build spec to remove EDK 
> > related
> >
> > V2:
> > Update the top level README to add the update history.
> >
> > Feng, Bob C (1):
> >   Document: Update Build spec to remove EDK related contents
> >
> >  10_post-build_imagegen_stage_-_flash/103_build_intermediate_images.md |  3 
> > +--
> >  12_build_changes_and_customizations/README.md |  4 
> > ++--
> >  4_edk_ii_build_process_overview/42_build_process_overview.md  |  6 
> > ++
> >  4_edk_ii_build_process_overview/46_file_specifications.md | 20 
> > +---
> >  6_quick_start/61_environment_variables.md | 24 
> > +---
> >  8_pre-build_autogen_stage/82_auto-generation_process.md   | 76
> > +++-
> >  8_pre-build_autogen_stage/83_auto-generated_code.md   | 43 
> > +++
> >  8_pre-build_autogen_stage/85_auto-generated_makefiles.md  | 23 
> > +--
> >  9_build_or_make_stage/README.md   |  9 
> > -
> >  README.md |  1 
> > +
> >  appendix_a_variables.md   |  3 
> > +--
> >  11 files changed, 44 insertions(+), 168 deletions(-)
> >
> > --
> > 2.20.1.windows.1
> >
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] Document: Update DSC spec to remove EDK related contents

2019-03-06 Thread Gao, Liming


1. 2.12 [UserExtensions] Section and ## 2.11 [UserExtensions] Section are 
inconsistent. There are the similar issue in this patch. Please check them to 
make sure they are same.
2. Update commit message for EDK and IPF both. 

> -Original Message-
> From: Feng, Bob C
> Sent: Monday, March 4, 2019 7:49 PM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C ; Gao, Liming ; 
> Carsey, Jaben 
> Subject: [Patch] Document: Update DSC spec to remove EDK related contents
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1453
> 
> Remove EDK related contents inf Dsc spec.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> Cc: Jaben Carsey 
> ---
>  1_introduction/11_overview.md | 14 +--
>  ...=> 210_[components]_section_processing.md} | 27 +-
>  ...ion.md => 211_[userextensions]_section.md} |  4 +-
>  ...212_[defaultstores]_section_processing.md} |  4 +-
>  .../22_build_description_file_format.md   | 50 ++
>  .../23_[defines]_section_processing.md| 12 +--
>  2_dsc_overview/24_[buildoptions]_section.md   | 72 ++
>  .../26_[libraries]_section_processing.md  | 69 --
>  ...26_[libraryclasses]_section_processing.md} |  4 +-
>  ...essing.md => 27_pcd_section_processing.md} | 34 +++
>  ...{29_pcd_sections.md => 28_pcd_sections.md} | 26 ++---
>  ...210_pcd_database.md => 29_pcd_database.md} |  4 +-
>  ...ctions.md => 310_[components]_sections.md} | 62 +---
>  ...ns.md => 311_[userextensions]_sections.md} |  4 +-
>  ...tion.md => 312_[defaultstores]_section.md} |  4 +-
>  3_edk_ii_dsc_file_format/32_general_rules.md  | 13 +--
>  .../33_platform_dsc_definition.md | 17 +---
>  .../35_[defines]_section.md   | 12 +--
>  .../36_[buildoptions]_sections.md | 19 ++--
>  .../38_[libraries]_sections.md| 94 ---
>  ...ons.md => 38_[libraryclasses]_sections.md} |  4 +-
>  ...310_pcd_sections.md => 39_pcd_sections.md} | 14 +--
>  22 files changed, 101 insertions(+), 462 deletions(-)
>  rename 2_dsc_overview/{211_[components]_section_processing.md => 
> 210_[components]_section_processing.md} (84%)
>  rename 2_dsc_overview/{212_[userextensions]_section.md => 
> 211_[userextensions]_section.md} (93%)
>  rename 2_dsc_overview/{213_[defaultstores]_section_processing.md => 
> 212_[defaultstores]_section_processing.md} (93%)
>  delete mode 100644 2_dsc_overview/26_[libraries]_section_processing.md
>  rename 2_dsc_overview/{27_[libraryclasses]_section_processing.md => 
> 26_[libraryclasses]_section_processing.md} (96%)
>  rename 2_dsc_overview/{28_pcd_section_processing.md => 
> 27_pcd_section_processing.md} (94%)
>  rename 2_dsc_overview/{29_pcd_sections.md => 28_pcd_sections.md} (93%)
>  rename 2_dsc_overview/{210_pcd_database.md => 29_pcd_database.md} (96%)
>  rename 3_edk_ii_dsc_file_format/{311_[components]_sections.md => 
> 310_[components]_sections.md} (81%)
>  rename 3_edk_ii_dsc_file_format/{312_[userextensions]_sections.md => 
> 311_[userextensions]_sections.md} (94%)
>  rename 3_edk_ii_dsc_file_format/{313_[defaultstores]_section.md => 
> 312_[defaultstores]_section.md} (93%)
>  delete mode 100644 3_edk_ii_dsc_file_format/38_[libraries]_sections.md
>  rename 3_edk_ii_dsc_file_format/{39_[libraryclasses]_sections.md => 
> 38_[libraryclasses]_sections.md} (95%)
>  rename 3_edk_ii_dsc_file_format/{310_pcd_sections.md => 39_pcd_sections.md} 
> (97%)
> 
> diff --git a/1_introduction/11_overview.md b/1_introduction/11_overview.md
> index d9006df..ff2b517 100644
> --- a/1_introduction/11_overview.md
> +++ b/1_introduction/11_overview.md
> @@ -1,9 +1,9 @@
>   |:-:|::|:-:|::|:-:|::|
>  | EDK Build Tools| YES   | NO   | YES   | NO   | 
> YES   | NO   |
> -| EDK II Build Tools | NO| YES  | NO| YES  | 
> YES   | YES  |
> +| EDK II Build Tools | NO| YES  | NO| YES  | 
> NO| YES  |
> 
>  **
>  **Note:** This document is intended for persons doing EFI development and
>  support for different platforms. It is most likely only of interest in the
>  event that there is a problem with a build, or if a developer needs to 
> perform
> @@ -90,9 +87,6 @@ contain information on the EFI format for FFS or FV file 
> creation. The
>  Makefiles will support third party compilation tools - Microsoft, Intel and 
> GCC
>  tool chains - and at least one EDK II tool, GenFw. The GenFw tool is used to
>  manipula

Re: [edk2] [Patch V2 0/1] Document: Update Build spec to remove EDK related

2019-03-06 Thread Gao, Liming
1.  2.12 [UserExtensions] Section and ## 2.11 [UserExtensions] Section are 
inconsistent. There are the similar issue in this patch. Please check them to 
make sure they are same. 

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Feng, 
> Bob C
> Sent: Tuesday, March 5, 2019 11:49 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [Patch V2 0/1] Document: Update Build spec to remove EDK 
> related
> 
> V2:
> Update the top level README to add the update history.
> 
> Feng, Bob C (1):
>   Document: Update Build spec to remove EDK related contents
> 
>  10_post-build_imagegen_stage_-_flash/103_build_intermediate_images.md |  3 
> +--
>  12_build_changes_and_customizations/README.md |  4 
> ++--
>  4_edk_ii_build_process_overview/42_build_process_overview.md  |  6 
> ++
>  4_edk_ii_build_process_overview/46_file_specifications.md | 20 
> +---
>  6_quick_start/61_environment_variables.md | 24 
> +---
>  8_pre-build_autogen_stage/82_auto-generation_process.md   | 76
> +++-
>  8_pre-build_autogen_stage/83_auto-generated_code.md   | 43 
> +++
>  8_pre-build_autogen_stage/85_auto-generated_makefiles.md  | 23 
> +--
>  9_build_or_make_stage/README.md   |  9 
> -
>  README.md |  1 +
>  appendix_a_variables.md   |  3 
> +--
>  11 files changed, 44 insertions(+), 168 deletions(-)
> 
> --
> 2.20.1.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch V2 1/1] Document: Update DEC spec to remove EDK related contents

2019-03-06 Thread Gao, Liming
Update commit message and version info to remove EDK and IFP related contents 
from DEC spec. 

With this change, Reviewed-by: Liming Gao 

> -Original Message-
> From: Feng, Bob C
> Sent: Tuesday, March 5, 2019 11:50 PM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C ; Gao, Liming ; 
> Carsey, Jaben 
> Subject: [Patch V2 1/1] Document: Update DEC spec to remove EDK related 
> contents
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1453
> 
> Remove EDK related contents from DEC spec.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> Cc: Jaben Carsey 
> ---
>  2_dec_file_overview/210_pcd_usage.md | 4 +---
>  2_dec_file_overview/25_[includes]_usage.md   | 6 +-
>  2_dec_file_overview/26_[guids]_usage.md  | 6 +-
>  2_dec_file_overview/27_[protocols]_usage.md  | 6 +-
>  2_dec_file_overview/28_[ppis]_usage.md   | 6 +-
>  2_dec_file_overview/29_[libraryclasses]_usage.md | 4 +---
>  3_edk_ii_dec_file_format/310_pcd_sections.md | 8 ++--
>  3_edk_ii_dec_file_format/35_[includes]_sections.md   | 5 +
>  3_edk_ii_dec_file_format/39_[libraryclasses]_sections.md | 5 +
>  README.md| 1 +
>  10 files changed, 11 insertions(+), 40 deletions(-)
> 
> diff --git a/2_dec_file_overview/210_pcd_usage.md 
> b/2_dec_file_overview/210_pcd_usage.md
> index 9b554be..e600db2 100644
> --- a/2_dec_file_overview/210_pcd_usage.md
> +++ b/2_dec_file_overview/210_pcd_usage.md
> @@ -1,9 +1,9 @@
>   2.20.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] Document: Update FDF spec to remove EDK related contents

2019-03-06 Thread Gao, Liming
1. Update commit message
2. + 2.8 [Rule] Sections, and +## 2.7 [Rule] Sections. They are not consistent. 
3. +[Rule.Common.ACPITABLE] Here ACPITABLE is EDK type. Please change it to 
[Rule.Common.USER_DEFINED.ACPITABLE]

> -Original Message-
> From: Feng, Bob C
> Sent: Monday, March 4, 2019 7:00 AM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C ; Gao, Liming ; 
> Carsey, Jaben 
> Subject: [Patch] Document: Update FDF spec to remove EDK related contents
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1453
> 
> Remove EDK related contents inf Fdf spec.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> Cc: Jaben Carsey 
> ---
>  1_introduction/11_overview.md |  22 +-
>  1_introduction/12_terms.md|   8 +-
>  1_introduction/README.md  |   9 +-
>  .../22_flash_description_file_format.md   |  34 +--
>  2_fdf_design_discussion/24_[fd]_sections.md   |   9 +-
>  2_fdf_design_discussion/25_[fv]_sections.md   |   9 +-
>  ...ule]_sections.md => 27_[rule]_sections.md} | 232 +-
>  2_fdf_design_discussion/27_[vtf]_sections.md  |  82 ---
>  ...sections.md => 28_[optionrom]_sections.md} | 112 -
>  2_fdf_design_discussion/README.md |   2 -
>  3_edk_ii_fdf_file_format/310_[vtf]_section.md | 203 ---
>  ...ection.md => 310_pci_optionrom_section.md} | 228 -
>  3_edk_ii_fdf_file_format/31_general_rules.md  |  13 +-
>  3_edk_ii_fdf_file_format/32_fdf_definition.md |  67 +
>  appendix_a_nt32pkg_flash_description_file.md  |   4 +-
>  15 files changed, 317 insertions(+), 717 deletions(-)
>  rename 2_fdf_design_discussion/{28_[rule]_sections.md => 
> 27_[rule]_sections.md} (96%)
>  delete mode 100644 2_fdf_design_discussion/27_[vtf]_sections.md
>  rename 2_fdf_design_discussion/{29_[optionrom]_sections.md => 
> 28_[optionrom]_sections.md} (94%)
>  delete mode 100644 3_edk_ii_fdf_file_format/310_[vtf]_section.md
>  rename 3_edk_ii_fdf_file_format/{311_pci_optionrom_section.md => 
> 310_pci_optionrom_section.md} (93%)
> 
> diff --git a/1_introduction/11_overview.md b/1_introduction/11_overview.md
> index 6db8a26..d7dbb20 100644
> --- a/1_introduction/11_overview.md
> +++ b/1_introduction/11_overview.md
> @@ -1,9 +1,9 @@
>   --- |
>  | `$(WORKSPACE)`| System Environment Variable.
> |
>  | `PACKAGES_PATH`   | System Environment Variable that cannot be used in 
> EDK II meta-data Files. The build system will
> automatically detect if this variable is present and use directories listed 
> in this variable as if they were listed in $(WORKSPACE) |
> -| `$(EDK_SOURCE)`   | System Environment Variable.
> |
> -| `$(EFI_SOURCE)`   | System Environment Variable.
> |
>  | `$(EDK_TOOLS_PATH)`   | System Environment Variable
> |
>  | `EDK_TOOLS_BIN`   | System Environment Variable that cannot be used in 
> EDK II meta-data Files.
> |
> -| `$(ECP_SOURCE)`   | System Environment Variable
> |
>  | `$(OUTPUT_DIRECTORY)` | Tool parsing from either the DSC file or via a 
> command line option. This is typically the Build/Platform name
> directory created by the build system in the EDK II WORKSPACE 
>  |
>  | `$(BUILD_NUMBER)` | Tool parsing from either an EDK INF file or the 
> EDK II DSC file's `BUILD_NUMBER` statement. The EDK II DSC
> file's `BUILD_NUMBER` takes precedence over an EDK INF file's 
> |
>  |   | `BUILD_NUMBER` if and only if the EDK II DSC 
> specifies a
> |
>  |   | `BUILD_NUMBER`.
> |
>  |   | Future implementation may allow for setting the
> |
> @@ -408,14 +401,11 @@ must not be altered.
>  ## Table 3 Using System Environment Variable
> 
>  | Macro Style Used in Meta-Data files | Windows Environment Variable | Linux 
> & OS/X Environment Variable |
>  | --- | -- | - |
>  | `$(WORKSPACE)`  | `%WORKSPACE%`  | `$WORKSPACE`  |
> -| `$(EFI_SOURCE)` | `%EFI_SOURCE%` | `$EFI_SOURCE` |
> -| `$(EDK_SOURCE)` | `%EDK_SOURCE%` | `$EDK_SOURCE` |
>  | `$(EDK_TOOLS_PATH)` | `%EDK_TOOLS_PATH%` | `$EDK_TOOLS_PATH` |
> -| `$(ECP_SOURCE)` | `%ECP_SOURCE%` | `$ECP_SOURCE` |
> 
>  The system environment variables, `PACKAGES_PATH` and `EDK_TOOLS_BIN`, are 
> not
>  permitted in EDK II meta-data files.
> 
>  Macros defined in the FDF file are local to the FDF file. They are also
> diff --git a/2_fdf_design_discu

Re: [edk2] [Patch] Document: Update Inf spec to remove EDK related contents

2019-03-06 Thread Gao, Liming
Bob:
  I have some comments. 

1) Please update the commit message. The change is to remove EDK and IPF 
related contents. 
2) The below change should make sure the updated one keep the same alignment. 
-||-
+||
3) Below content is correct. It is for EDKII. No need to change it. 
-These sections are used for specifying PCD information and are valid for EDK
-II modules only. The entries for these sections are looked up from the package
-declaration files (DEC) for generating the `AutoGen.c` and `AutoGen.h` files.
+These sections are used for specifying PCD information. The entries for these 
+sections are looked up from the packagedeclaration files (DEC) for generating 
+the `AutoGen.c` and `AutoGen.h` files.

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Feng, 
> Bob C
> Sent: Monday, March 4, 2019 5:52 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Gao, Liming 
> Subject: [edk2] [Patch] Document: Update Inf spec to remove EDK related 
> contents
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1453
> 
> Remove EDK related contents
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> Cc: Jaben Carsey 
> ---
>  1_introduction/11_overview.md |   2 +-
>  2_inf_overview/210_[ppis]_section.md  |   1 -
>  2_inf_overview/211_[guids]_section.md |   1 -
>  .../212_[libraryclasses]_section.md   |   1 -
>  2_inf_overview/213_[packages]_section.md  |   1 -
>  2_inf_overview/214_pcd_sections.md|  14 +-
>  2_inf_overview/215_[depex]_section.md |   4 -
>  2_inf_overview/21_processing_overview.md  |  19 +-
>  .../22_information_file_general_rules.md  |  30 +-
>  2_inf_overview/24_[defines]_section.md|   4 +-
>  2_inf_overview/25_[sources]_section.md|   4 -
>  2_inf_overview/26_[buildoptions]_section.md   |   9 +-
>  2_inf_overview/27_[binaries]_section.md   |   5 -
>  2_inf_overview/29_[protocols]_section.md  |   1 -
>  2_inf_overview/README.md  |  11 -
>  .../314_[depex]_sections.md   |   6 +-
>  .../315_[binaries]_section.md |   5 -
>  .../32_component_inf_definition.md|   4 +-
>  .../34_[defines]_section.md   |   6 +-
>  .../35_[buildoptions]_sections.md |   5 +-
>  .../39_[sources]_sections.md  |   7 +-
>  3_edk_ii_inf_file_format/README.md|   4 -
>  ...ndix_a_build_changes_and_customizations.md |   0
>  .../README.md |  40 --
>  .../a1_design_discussion.md   | 317 
>  .../a2_edk_file_specification.md  | 461 --
>  ...ndix_c_symbols.md => appendix_b_symbols.md |   0
>  ...d => appendix_c_sample_driver_inf_files.md |   0
>  ... => appendix_d_sample_library_inf_files.md |   0
>  ...d => appendix_e_sample_binary_inf_files.md |   0
>  ...ule_types.md => appendix_f_module_types.md |   0
>  31 files changed, 30 insertions(+), 932 deletions(-)
>  rename appendix_b_build_changes_and_customizations.md => 
> appendix_a_build_changes_and_customizations.md (100%)
>  delete mode 100644 appendix_a_edk_inf_file_specification/README.md
>  delete mode 100644 
> appendix_a_edk_inf_file_specification/a1_design_discussion.md
>  delete mode 100644 
> appendix_a_edk_inf_file_specification/a2_edk_file_specification.md
>  rename appendix_c_symbols.md => appendix_b_symbols.md (100%)
>  rename appendix_d_sample_driver_inf_files.md => 
> appendix_c_sample_driver_inf_files.md (100%)
>  rename appendix_e_sample_library_inf_files.md => 
> appendix_d_sample_library_inf_files.md (100%)
>  rename appendix_f_sample_binary_inf_files.md => 
> appendix_e_sample_binary_inf_files.md (100%)
>  rename appendix_g_module_types.md => appendix_f_module_types.md (100%)
> 
> diff --git a/1_introduction/11_overview.md b/1_introduction/11_overview.md
> index 9239080..7349614 100644
> --- a/1_introduction/11_overview.md
> +++ b/1_introduction/11_overview.md
> @@ -40,11 +40,11 @@ Backward compatibility with the existing INF file 
> formats. Changes made to this
>  specification must not require changes to existing INF files.
> 
>  **Simplified platform build and configuration**
> 
>  Simplify the build setup and configuration for a given platform. The process 
> of
> -adding EDK and EDK II firmware components to a firmware volume on any given
> +adding EDK II firmware components to a firmware volume on any given
>  platform was also simplified.
> 
>  **Distributing Modules**
> 
>  Enable eas

Re: [edk2] [PATCH] UefiCpuPkg/Microcode.c: Add verification before calculate CheckSum32

2019-03-05 Thread Gao, Liming
This is a bug. I agree to add it into Q1 stable tag. 

Thanks
Liming
> -Original Message-
> From: Ni, Ray
> Sent: Tuesday, March 5, 2019 9:35 PM
> To: edk2-devel@lists.01.org; Gao, Liming 
> Cc: Dong, Eric ; Ni, Ray ; Chen, Chen 
> A 
> Subject: RE: [edk2] [PATCH] UefiCpuPkg/Microcode.c: Add verification before 
> calculate CheckSum32
> 
> Liming,
> Do I need any approval from you side before pushing the commit?
> 
> Thanks,
> Ray
> 
> > -Original Message-
> > From: edk2-devel  On Behalf Of Ni, Ray
> > Sent: Wednesday, March 6, 2019 10:15 AM
> > To: Chen, Chen A ; edk2-devel@lists.01.org
> > Cc: Dong, Eric 
> > Subject: Re: [edk2] [PATCH] UefiCpuPkg/Microcode.c: Add verification
> > before calculate CheckSum32
> >
> > Reviewed-by: Ray Ni 
> >
> > > -Original Message-
> > > From: edk2-devel  On Behalf Of Chen A
> > > Chen
> > > Sent: Tuesday, March 5, 2019 8:21 AM
> > > To: edk2-devel@lists.01.org
> > > Cc: Dong, Eric 
> > > Subject: [edk2] [PATCH] UefiCpuPkg/Microcode.c: Add verification
> > > before calculate CheckSum32
> > >
> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1020
> > >
> > > Should make sure the TotalSize of Microcode is aligned with 4 bytes
> > > before calling CalculateSum32 function.
> > >
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: Chen A Chen 
> > > Cc: Ray Ni 
> > > Cc: Eric Dong 
> > > ---
> > >  UefiCpuPkg/Library/MpInitLib/Microcode.c | 31
> > --
> > > -
> > >  1 file changed, 20 insertions(+), 11 deletions(-)
> > >
> > > diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > > b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > > index 5f9ae22794..643a6f94f4 100644
> > > --- a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > > +++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > > @@ -166,20 +166,29 @@ MicrocodeDetect (
> > >  //
> > >  CorrectMicrocode = FALSE;
> > >
> > > -//
> > > -// Save an in-complete CheckSum32 from CheckSum Part1 for common
> > > parts.
> > > -//
> > >  if (MicrocodeEntryPoint->DataSize == 0) {
> > > -  InCompleteCheckSum32 = CalculateSum32 (
> > > -   (UINT32 *) MicrocodeEntryPoint,
> > > -   sizeof (CPU_MICROCODE_HEADER) + 2000
> > > -   );
> > > +  TotalSize = sizeof (CPU_MICROCODE_HEADER) + 2000;
> > >  } else {
> > > -  InCompleteCheckSum32 = CalculateSum32 (
> > > -   (UINT32 *) MicrocodeEntryPoint,
> > > -   sizeof (CPU_MICROCODE_HEADER) +
> > MicrocodeEntryPoint-
> > > >DataSize
> > > -   );
> > > +  TotalSize = sizeof (CPU_MICROCODE_HEADER) +
> > > + MicrocodeEntryPoint-
> > > >DataSize;
> > >  }
> > > +
> > > +///
> > > +/// Check overflow and whether TotalSize is aligned with 4 bytes.
> > > +///
> > > +if ( ((UINTN)MicrocodeEntryPoint + TotalSize) > MicrocodeEnd ||
> > > + (TotalSize & 0x3) != 0
> > > +   ) {
> > > +  MicrocodeEntryPoint = (CPU_MICROCODE_HEADER *) (((UINTN)
> > > MicrocodeEntryPoint) + SIZE_1KB);
> > > +  continue;
> > > +}
> > > +
> > > +//
> > > +// Save an in-complete CheckSum32 from CheckSum Part1 for common
> > > parts.
> > > +//
> > > +InCompleteCheckSum32 = CalculateSum32 (
> > > + (UINT32 *) MicrocodeEntryPoint,
> > > + TotalSize
> > > + );
> > >  InCompleteCheckSum32 -= MicrocodeEntryPoint-
> > > >ProcessorSignature.Uint32;
> > >  InCompleteCheckSum32 -= MicrocodeEntryPoint->ProcessorFlags;
> > >  InCompleteCheckSum32 -= MicrocodeEntryPoint->Checksum;
> > > --
> > > 2.16.2.windows.1
> > >
> > > ___
> > > edk2-devel mailing list
> > > edk2-devel@lists.01.org
> > > https://lists.01.org/mailman/listinfo/edk2-devel
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 3/3] MdePkg/BaseSynchronizationLib: Remove inline X86 assembly code

2019-03-05 Thread Gao, Liming
Andrew:
  BZ 1163 is to remove inline X86 assembly code in C source file. But, this 
patch is wrong. I have gave my comments to update this patch.

  The change is to reduce the duplicated implementation. It will be good on the 
code maintain. Recently, one patch has to update .c and .nasm both. Please see 
https://lists.01.org/pipermail/edk2-devel/2019-February/037165.html. Beside 
this change, I propose to remove all GAS assembly code for IA32 and X64 arch. 
After those change, the patch owner will collect the impact of the image size. 

Thanks
Liming
> -Original Message-
> From: af...@apple.com [mailto:af...@apple.com]
> Sent: Tuesday, March 5, 2019 12:58 PM
> To: Zhang, Shenglei 
> Cc: edk2-devel-01 ; Kinney, Michael D 
> ; Gao, Liming 
> Subject: Re: [edk2] [PATCH 3/3] MdePkg/BaseSynchronizationLib: Remove inline 
> X86 assembly code
> 
> Shenglei,
> 
> I was confused by the names of these patches. From a C point of view this is 
> inline assembly:
> 
> VOID
> EFIAPI
> CpuBreakpoint (
> VOID
> )
> {
> __asm__ __volatile__ ("int $3");
> }
> 
> These patches seem to be removing GAS and MASM assembly files, but not the 
> inline assembly *.c files?
> 
> We don't want to remove the inline assembly from the BaseLib as that could 
> have size, performance, and compiler optimization impact.
> 
> For example CpuBreakpoint() for clang with LTO would end up inlining a single 
> byte. For i385 a call to assembler would be 5 bytes at each
> call location plus the overhead of the function. So that is a size increase 
> and a performance overhead. For a C complier calling an assembly
> function is a serializing event an that can restrict optimizations. Thus 
> having some limited inline assembly support is very useful.
> 
> Thanks,
> 
> Andrew Fish
> 
> > On Mar 4, 2019, at 5:40 PM, Shenglei Zhang  wrote:
> >
> > MdePkg BaseSynchronizationLib still uses the inline X86 assembly code
> > in C code files.It should be updated to consume nasm only.
> > https://bugzilla.tianocore.org/show_bug.cgi?id=1163
> >
> > Cc: Michael D Kinney 
> > Cc: Liming Gao 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Shenglei Zhang 
> > ---
> > .../Library/BaseSynchronizationLib/BaseSynchronizationLib.inf   | 2 --
> > 1 file changed, 2 deletions(-)
> >
> > diff --git 
> > a/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
> b/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
> > index 32414b29fa..719dc1938d 100755
> > --- a/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
> > +++ b/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
> > @@ -75,13 +75,11 @@
> >
> > [Sources.ARM]
> > Synchronization.c
> > -  Arm/Synchronization.asm   | RVCT
> > Arm/Synchronization.S | GCC
> >
> > [Sources.AARCH64]
> > Synchronization.c
> > AArch64/Synchronization.S | GCC
> > -  AArch64/Synchronization.asm   | MSFT
> >
> > [Packages]
> > MdePkg/MdePkg.dec
> > --
> > 2.18.0.windows.1
> >
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH V2] BaseTools:Run packagedoc_cli.py to generate doc failed

2019-03-04 Thread Gao, Liming
This is a bug. I agree to fix it for Q1 stable tag. 

> -Original Message-
> From: Feng, Bob C
> Sent: Monday, March 4, 2019 5:02 PM
> To: Gao, Liming ; Fan, ZhijuX ; 
> edk2-devel@lists.01.org
> Cc: Feng, Bob C 
> Subject: RE: [edk2] [PATCH V2] BaseTools:Run packagedoc_cli.py to generate 
> doc failed
> 
> Hi,
> 
> This patch is to fix the a regression issue introduced by python3 patch set. 
> I'd like to push this patch for Q1 stable tag.
> Would you approve it?
> 
> Thanks,
> Bob
> 
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Feng, 
> Bob C
> Sent: Monday, March 4, 2019 3:30 PM
> To: Fan, ZhijuX ; edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: Re: [edk2] [PATCH V2] BaseTools:Run packagedoc_cli.py to generate 
> doc failed
> 
> Reviewed-by: Bob Feng 
> 
> 
> -Original Message-
> From: Fan, ZhijuX
> Sent: Friday, March 1, 2019 10:52 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming ; Feng, Bob C 
> Subject: [edk2][PATCH V2] BaseTools:Run packagedoc_cli.py to generate doc 
> failed
> 
> The reason for this problem is that the file was opened incorrectly.
> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhiju.Fan 
> ---
>  .../plugins/EdkPlugins/edk2/model/doxygengen.py| 7 
> ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git 
> a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/doxygengen.py
> b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/doxygengen.py
> index e31df262bc..73349e2f48 100644
> --- 
> a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/doxygengen.py
> +++ 
> b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/doxygengen.py
> @@ -376,9 +376,10 @@ class PackageDocumentAction(DoxygenAction):
>  return
> 
>  try:
> -f = open(path, 'r')
> -lines = f.readlines()
> -f.close()
> +with open(path, 'r') as f:
> +lines = f.readlines()
> +except UnicodeDecodeError:
> +return
>  except IOError:
>  ErrorMsg('Fail to open file %s' % path)
>  return
> --
> 2.14.1.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 0/3] MdePkg: Remove inline X86 assembly code

2019-03-04 Thread Gao, Liming
Shenglei:
  The request is for X86, IA32 and X64. Please don't change ARM or AARCH64. 

Thanks
Liming
> -Original Message-
> From: Zhang, Shenglei
> Sent: Monday, March 4, 2019 5:41 PM
> To: edk2-devel@lists.01.org
> Cc: Kinney, Michael D ; Gao, Liming 
> 
> Subject: [PATCH 0/3] MdePkg: Remove inline X86 assembly code
> 
> MdePkg BaseLib, BaseCpuLib and BaseSynchronizationLib still use
> the inline X86 assembly code in C code files. They should be updated
> to consume nasm only.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1163
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Shenglei Zhang 
> Shenglei Zhang (3):
>   MdePkg/BaseCpuLib: Remove inline X86 assembly code
>   MdePkg/BaseLib: Remove inline X86 assembly code
>   MdePkg/BaseSynchronizationLib: Remove inline X86 assembly code
> 
>  MdePkg/Library/BaseCpuLib/BaseCpuLib.inf  |  6 -
>  MdePkg/Library/BaseLib/BaseLib.inf| 27 ---
>  .../BaseSynchronizationLib.inf|  2 --
>  3 files changed, 35 deletions(-)
> 
> --
> 2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] MdeModulePkg/SdMmcPciHcDxe: Add V3 64b DMA Support

2019-03-02 Thread Gao, Liming
Ashish:
  This seems a feature. Now, we are in Hard Feature Freeze. So, it will not be 
added until edk2-stable201903 tag is created at 2019-03-08. 

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ashish 
> Singhal
> Sent: Saturday, March 2, 2019 2:30 AM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A ; Ashish Singhal 
> Subject: [edk2] [PATCH] MdeModulePkg/SdMmcPciHcDxe: Add V3 64b DMA Support
> 
> Driver was supporting only 32b DMA support for V3 controllers. Add
> support for 64b DMA as well for completeness.
> 
> For V4.0 64b support, driver was looking at incorrect capability
> register bit. Fix for that is present as well.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ashish Singhal 
> ---
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c |  10 +-
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h |   6 +-
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c   | 199 
> ++---
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h   |  29 ++-
>  4 files changed, 170 insertions(+), 74 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c 
> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c
> index b474f8d..9b7b88c 100644
> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c
> @@ -6,7 +6,7 @@
> 
>It would expose EFI_SD_MMC_PASS_THRU_PROTOCOL for upper layer use.
> 
> -  Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
> +  Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
>Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD 
> License
> @@ -666,8 +666,12 @@ SdMmcPciHcDriverBindingStart (
>  // If any of the slots does not support 64b system bus
>  // do not enable 64b DMA in the PCI layer.
>  //
> -if (Private->Capability[Slot].SysBus64V3 == 0 &&
> -Private->Capability[Slot].SysBus64V4 == 0) {
> +if ((Private->ControllerVersion[Slot] == SD_MMC_HC_CTRL_VER_300 &&
> + Private->Capability[Slot].SysBus64V3 == 0) ||
> +(Private->ControllerVersion[Slot] == SD_MMC_HC_CTRL_VER_400 &&
> + Private->Capability[Slot].SysBus64V3 == 0) ||
> +(Private->ControllerVersion[Slot] >= SD_MMC_HC_CTRL_VER_410 &&
> + Private->Capability[Slot].SysBus64V4 == 0)) {
>Support64BitDma = FALSE;
>  }
> 
> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h 
> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h
> index 1bb701a..68d8a5c 100644
> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h
> @@ -2,7 +2,7 @@
> 
>Provides some data structure definitions used by the SD/MMC host 
> controller driver.
> 
> -Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
> +Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
>  Copyright (c) 2015, Intel Corporation. All rights reserved.
>  This program and the accompanying materials
>  are licensed and made available under the terms and conditions of the BSD 
> License
> @@ -145,13 +145,15 @@ typedef struct {
>EFI_PHYSICAL_ADDRESSDataPhy;
>VOID*DataMap;
>SD_MMC_HC_TRANSFER_MODE Mode;
> +  SD_MMC_HC_ADMA_LEGTHLength;
> 
>EFI_EVENT   Event;
>BOOLEAN Started;
>UINT64  Timeout;
> 
>SD_MMC_HC_ADMA_32_DESC_LINE *Adma32Desc;
> -  SD_MMC_HC_ADMA_64_DESC_LINE *Adma64Desc;
> +  SD_MMC_HC_ADMA_64_V3_DESC_LINE  *Adma64V3Desc;
> +  SD_MMC_HC_ADMA_64_V4_DESC_LINE  *Adma64V4Desc;
>EFI_PHYSICAL_ADDRESSAdmaDescPhy;
>VOID*AdmaMap;
>UINT32  AdmaPages;
> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c 
> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> index d73fa10..a6d2395 100644
> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> @@ -6,7 +6,7 @@
> 
>It would expose EFI_SD_MMC_PASS_THRU_PROTOCOL for upper layer use.
> 
> -  Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
> +  Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
>Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD 
> License
> @@ -1010,18 +1010,32 @@ SdMmcHcInitV4Enhancements (
>if (ControllerVer >= SD_MMC_HC_CTRL_VER_400) {
>  HostCtrl2 = SD_MMC_HC_V4_EN;
>  //
> -// Check if V4 64bit support is available
> +// Check if 

[edk2] [edk2-announce] Hard Feature Freeze starts from 2019-03-01(00:00:00 UTC-8) for edk2-stable201903

2019-03-01 Thread Gao, Liming
Hi, all
  Today, we enter into Hard Feature Freeze phase until edk2-stable201903 tag is 
created at 2019-03-08. In this phase, there is no feature to be pushed. The bug 
fix is still allowed. 

Thanks
Liming
>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Gao,
>Liming
>Sent: Friday, February 22, 2019 10:26 PM
>To: edk2-devel@lists.01.org
>Subject: [edk2] [edk2-announce] Soft Feature Freeze starts today for edk2-
>stable201903
>
>Hi, all
>  https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-
>Planning lists edk2-stable201903 tag planning. Now, we enter into Soft
>Feature Freeze phase. In this phase, the feature without Reviewed-by or
>Acked-by tags will be delayed after the upcoming stable tag. The patch review
>can continue without break. Below is edk2-stable201903 tag planning.
>
>2019-03-08 Beginning of development
>2019-02-22 Soft Feature Freeze
>2019-03-01 Hard Feature Freeze
>2019-03-08 Release
>
>Thanks
>Liming
>
>___
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [edk2-announce] Soft Feature Freeze starts today for edk2-stable201903

2019-02-28 Thread Gao, Liming
OK. To be clear, I take your suggestion. wiki page has been updated. 

> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Thursday, February 28, 2019 7:58 PM
> To: Gao, Liming 
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] [edk2-announce] Soft Feature Freeze starts today for 
> edk2-stable201903
> 
> On 02/28/19 03:22, Gao, Liming wrote:
> 
> > I update wiki page 
> > https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning
> >  with UTC zone.
> > I think the nature time of day is the begin time of one day. 00:00:00 
> > should be common sense. We may not highlight it.
> 
> I disagree: many organizations use "start of business" (e.g. 9AM) or
> "end of business" (e.g. 5PM) as "common sense" deadlines, on any given date.
> 
> I think it's a really simple update. Just replace, in the header,
> 
>   Date(UTC-8)
> 
> with
> 
>   Date (00:00:00 UTC-8)
> 
> That should suffice.
> 
> Thanks
> Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [edk2-announce] Soft Feature Freeze starts today for edk2-stable201903

2019-02-27 Thread Gao, Liming
Laszlo:

>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Laszlo Ersek
>Sent: Thursday, February 28, 2019 3:54 AM
>To: Gao, Liming 
>Cc: edk2-devel@lists.01.org
>Subject: Re: [edk2] [edk2-announce] Soft Feature Freeze starts today for
>edk2-stable201903
>
>On 02/27/19 14:16, Gao, Liming wrote:
>> Laszlo:
>>
>> Thanks
>> Liming
>>> -Original Message-
>>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Laszlo Ersek
>>> Sent: Tuesday, February 26, 2019 7:55 PM
>>> To: Gao, Liming 
>>> Cc: edk2-devel@lists.01.org
>>> Subject: Re: [edk2] [edk2-announce] Soft Feature Freeze starts today for
>edk2-stable201903
>>>
>>> On 02/26/19 04:30, Gao, Liming wrote:
>>>> Hi, all
>>>>   Two features (Add SMM CET support and Add WiFi Connection Manager)
>get Acked-By or Reviewed-by near the soft feature freeze
>>> date. CET is X86 specific feature. WiFi connection manager is the
>standalone feature. Their impact should be small. So, I suggest to include
>>> them in this stable tag edk2-stable201903. If you have different opinion,
>please raise. If no objection, I will push them late this week.
>>>>
>>>> Add SMM CET support https://lists.01.org/pipermail/edk2-devel/2019-
>February/037128.html
>>>> NetworkPkg: Add WiFi Connection Manager to NetworkPkg
>https://lists.01.org/pipermail/edk2-devel/2019-February/037137.html
>>>
>>> I think the required feedback tags arrived on time, but just barely. (At
>>> least in my time zone, CET = UTC+01:00.)
>>>
>>> - For Jiewen's "[edk2] [PATCH V3 0/4] Add SMM CET support":
>>>   - Ray's R-b appeared at 02/22/19 15:29
>>>   - My Regression-tested-by appeared at 02/22/19 22:41
>>>
>>> - For Wang Fan's "[edk2] [Patch V2] NetworkPkg: Add WiFi Connection
>>>   Manager to NetworkPkg":
>>>   - Jiaxin's R-b appeared at 02/22/19 08:56.
>>>
>>> I'm OK if both features are pushed.
>>>
>> Thanks.
I push these two features. 
CET feature: 
84110bbe4bb3a346514b9bb12eadb7586bca7dfd..3eb69b081c683f9d825930d0c511e43c0485e5d2
Wifi Conncetion: 90b24889f9ced53c18b73266d507e45fbd94fab0

>>
>>>
>>> However, I do have a suggestion for the announcement email, for the
>>> future. Given that we've already encountered three cases in this cycle
>>> where the feedback tags are on the boundary, I suggest to include an
>>> exact timestamp (in the UTC zone) in each announcement. I never
>expected
>>> that this accuracy would be necessary, but apparently it is.
>>>
>> I suggest to list UTC zone in Proposed Schedule of EDK II Release Planning
>wiki page as below. I prefer to use PST (UST -8), because edk2-devel Archives
>(https://lists.01.org/pipermail/edk2-devel/) uses PST time. Then, we can base
>on the archive mail to check each patch.
>>
>> Date (UTC -8)Description
>> 2019-03-08 Beginning of development
>> 2019-02-22 Soft Feature Freeze
>> 2019-03-01 Hard Feature Freeze
>> 2019-03-08 Release
>
>I think PST (UTC-8) works fine as well, as long as we state it clearly.
>Given the time zone, the timestamp is unique, and can be translated to
>other time zones.
>
>I do recommend that we specify "midnight" or 00:00:00 as well, however,
>if that is our intent. (I'm fine with other hours too, such as "noon"
>etc, but it should be specific down to the second. We should be able to
>look at any email on the list and determine if it was before or after.
>"Equal" should still be accepted.)
>
I update wiki page 
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning 
with UTC zone. 
I think the nature time of day is the begin time of one day. 00:00:00 should be 
common sense. We may not highlight it. 

>Thanks
>Laszlo
>___
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 0/2] MdeModulePkg: Resolve buffer cross boundary access in Ramdisk

2019-02-27 Thread Gao, Liming
I update 
https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-Format 
with CVE example. Please check it. 

>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Laszlo Ersek
>Sent: Thursday, February 28, 2019 3:31 AM
>To: Gao, Liming ; Wu, Hao A ;
>edk2-devel@lists.01.org
>Cc: Zeng, Star 
>Subject: Re: [edk2] [PATCH v2 0/2] MdeModulePkg: Resolve buffer cross
>boundary access in Ramdisk
>
>On 02/27/19 13:49, Gao, Liming wrote:
>> Laszlo:
>>   I add my comments.
>>
>> Thanks
>> Liming
>>> -Original Message-
>>> From: Laszlo Ersek [mailto:ler...@redhat.com]
>>> Sent: Wednesday, February 27, 2019 4:58 PM
>>> To: Wu, Hao A ; Gao, Liming
>; edk2-devel@lists.01.org
>>> Cc: Zeng, Star 
>>> Subject: Re: [edk2] [PATCH v2 0/2] MdeModulePkg: Resolve buffer cross
>boundary access in Ramdisk
>>>
>>> On 02/27/19 07:56, Wu, Hao A wrote:
>>>>> -Original Message-
>>>>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf
>Of
>>>>> Laszlo Ersek
>>>>> Sent: Tuesday, February 26, 2019 7:45 PM
>>>>> To: Wu, Hao A; edk2-devel@lists.01.org
>>>>> Cc: Zeng, Star
>>>>> Subject: Re: [edk2] [PATCH v2 0/2] MdeModulePkg: Resolve buffer
>cross
>>>>> boundary access in Ramdisk
>>>>>
>>>>> On 02/26/19 08:45, Hao Wu wrote:
>>>>>> V2 changes:
>>>>>>
>>>>>> Correct CC list information.
>>>>>>
>>>>>>
>>>>>> V1 history:
>>>>>>
>>>>>> The series will resolve a buffer cross boundary access issue during the
>>>>>> use of RAM disks. It is the mitigation for issue CVE-2018-12180.
>>>>>>
>>>>>> Cc: Jian J Wang 
>>>>>> Cc: Ray Ni 
>>>>>> Cc: Star Zeng 
>>>>>>
>>>>>> Hao Wu (2):
>>>>>>   MdeModulePkg/PartitionDxe: Ensure blocksize can hold MBR (CVE
>FIX)
>>>>>>   MdeModulePkg/RamDiskDxe: Ramdisk size be multiple of BlkSize
>(CVE
>>>>> FIX)
>>>>>>
>>>>>>  MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h |  6
>+++---
>>>>>>  MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c   |  9
>-
>>>>>>  MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c   |  9
>-
>>>>>>  MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskBlockIo.c  | 20
>>>>> ++--
>>>>>>  MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c |  5
>+++--
>>>>>>  5 files changed, 36 insertions(+), 13 deletions(-)
>>>>>>
>>>>>
>>>>> Please put the exact CVE numbers in the subject lines.
>>>>
>>>> Hello Laszlo and Liming,
>>>>
>>>> I totally agree the commit subject line should include the CVE number.
>>>> But I have one feedback that, if the commit is for a CVE fix, is it
>>>> possible to exempt the commit subject from 71 characters limit?
>>>
>>> In my opinion, that is absolutely the case.
>>>
>>>> I found it can be hard to summary the commit with the Package/Module
>plus
>>>> the CVE number information.
>>>
>>> I agree, it is hard. But, IMO, in this case, the precise CVE reference
>>> takes priority.
>>>
>> For this case, I suggest to allow subject line length to be bigger, such as 
>> 120
>character.
>> I will update wiki
>https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-
>Format for CVE commit message format.
>> For example: Pkg-Module: Brief-single-line-summary (CVE-Year-Number)
>
>Thanks for that!
>Laszlo
>___
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] Maintainers.txt: clarify Reviewer requirements and responsibilities

2019-02-27 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Laszlo Ersek
>Sent: Thursday, February 28, 2019 5:22 AM
>To: edk2-devel-01 
>Cc: Gao, Liming ; Kinney, Michael D
>
>Subject: [edk2] [PATCH] Maintainers.txt: clarify Reviewer requirements and
>responsibilities
>
>The current language for "Package Reviewer" only vaguely hints that
>Package Reviewers should be able to provide guidance and directions.
>Make this more obvious.
>
>Cc: Andrew Fish 
>Cc: Ard Biesheuvel 
>Cc: Leif Lindholm 
>Cc: Liming Gao 
>Cc: Michael D Kinney 
>Cc: Philippe Mathieu-Daude 
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Laszlo Ersek 
>---
>
>Notes:
>- this is clearly a political patch; feel free to disagree
>- I'm proposing this for the next development cycle
>
> Maintainers.txt | 5 -
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
>diff --git a/Maintainers.txt b/Maintainers.txt
>index 7772926b2fb1..ed090aeb4bdb 100644
>--- a/Maintainers.txt
>+++ b/Maintainers.txt
>@@ -20,7 +20,10 @@ Descriptions of section entries:
>   M: Package Maintainer: Cc address for patches and questions. Responsible
>  for reviewing and pushing package changes to source control.
>   R: Package Reviewer: Cc address for patches and questions. Reviewers help
>- maintainers review code, but don't have push access.
>+ maintainers review code, but don't have push access. A designated
>Package
>+ Reviewer is reasonably familiar with the Package (or some modules
>+ thereof), and/or provides testing or regression testing for the Package
>+ (or some modules thereof), in certain platforms and environments.
>   W: Web-page with status/info
>   T: SCM tree type and location.  Type is one of: git, svn.
>   S: Status, one of the following:
>--
>2.19.1.3.g30247aa5d201
>
>___
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [edk2-announce] Soft Feature Freeze starts today for edk2-stable201903

2019-02-27 Thread Gao, Liming
Laszlo:

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Laszlo 
> Ersek
> Sent: Tuesday, February 26, 2019 7:55 PM
> To: Gao, Liming 
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] [edk2-announce] Soft Feature Freeze starts today for 
> edk2-stable201903
> 
> On 02/26/19 04:30, Gao, Liming wrote:
> > Hi, all
> >   Two features (Add SMM CET support and Add WiFi Connection Manager) get 
> > Acked-By or Reviewed-by near the soft feature freeze
> date. CET is X86 specific feature. WiFi connection manager is the standalone 
> feature. Their impact should be small. So, I suggest to include
> them in this stable tag edk2-stable201903. If you have different opinion, 
> please raise. If no objection, I will push them late this week.
> >
> > Add SMM CET support 
> > https://lists.01.org/pipermail/edk2-devel/2019-February/037128.html
> > NetworkPkg: Add WiFi Connection Manager to NetworkPkg 
> > https://lists.01.org/pipermail/edk2-devel/2019-February/037137.html
> 
> I think the required feedback tags arrived on time, but just barely. (At
> least in my time zone, CET = UTC+01:00.)
> 
> - For Jiewen's "[edk2] [PATCH V3 0/4] Add SMM CET support":
>   - Ray's R-b appeared at 02/22/19 15:29
>   - My Regression-tested-by appeared at 02/22/19 22:41
> 
> - For Wang Fan's "[edk2] [Patch V2] NetworkPkg: Add WiFi Connection
>   Manager to NetworkPkg":
>   - Jiaxin's R-b appeared at 02/22/19 08:56.
> 
> I'm OK if both features are pushed.
> 
Thanks.

> 
> However, I do have a suggestion for the announcement email, for the
> future. Given that we've already encountered three cases in this cycle
> where the feedback tags are on the boundary, I suggest to include an
> exact timestamp (in the UTC zone) in each announcement. I never expected
> that this accuracy would be necessary, but apparently it is.
> 
I suggest to list UTC zone in Proposed Schedule of EDK II Release Planning wiki 
page as below. I prefer to use PST (UST -8), because edk2-devel Archives 
(https://lists.01.org/pipermail/edk2-devel/) uses PST time. Then, we can base 
on the archive mail to check each patch. 

Date (UTC -8)   Description
2019-03-08 Beginning of development
2019-02-22 Soft Feature Freeze
2019-03-01 Hard Feature Freeze
2019-03-08 Release

> Thanks!
> Laszlo
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 0/2] MdeModulePkg: Resolve buffer cross boundary access in Ramdisk

2019-02-27 Thread Gao, Liming
Laszlo:
  I add my comments. 

Thanks
Liming
> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Wednesday, February 27, 2019 4:58 PM
> To: Wu, Hao A ; Gao, Liming ; 
> edk2-devel@lists.01.org
> Cc: Zeng, Star 
> Subject: Re: [edk2] [PATCH v2 0/2] MdeModulePkg: Resolve buffer cross 
> boundary access in Ramdisk
> 
> On 02/27/19 07:56, Wu, Hao A wrote:
> >> -Original Message-
> >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> >> Laszlo Ersek
> >> Sent: Tuesday, February 26, 2019 7:45 PM
> >> To: Wu, Hao A; edk2-devel@lists.01.org
> >> Cc: Zeng, Star
> >> Subject: Re: [edk2] [PATCH v2 0/2] MdeModulePkg: Resolve buffer cross
> >> boundary access in Ramdisk
> >>
> >> On 02/26/19 08:45, Hao Wu wrote:
> >>> V2 changes:
> >>>
> >>> Correct CC list information.
> >>>
> >>>
> >>> V1 history:
> >>>
> >>> The series will resolve a buffer cross boundary access issue during the
> >>> use of RAM disks. It is the mitigation for issue CVE-2018-12180.
> >>>
> >>> Cc: Jian J Wang 
> >>> Cc: Ray Ni 
> >>> Cc: Star Zeng 
> >>>
> >>> Hao Wu (2):
> >>>   MdeModulePkg/PartitionDxe: Ensure blocksize can hold MBR (CVE FIX)
> >>>   MdeModulePkg/RamDiskDxe: Ramdisk size be multiple of BlkSize (CVE
> >> FIX)
> >>>
> >>>  MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h |  6 +++---
> >>>  MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c   |  9 -
> >>>  MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c   |  9 -
> >>>  MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskBlockIo.c  | 20
> >> ++--
> >>>  MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c |  5 +++--
> >>>  5 files changed, 36 insertions(+), 13 deletions(-)
> >>>
> >>
> >> Please put the exact CVE numbers in the subject lines.
> >
> > Hello Laszlo and Liming,
> >
> > I totally agree the commit subject line should include the CVE number.
> > But I have one feedback that, if the commit is for a CVE fix, is it
> > possible to exempt the commit subject from 71 characters limit?
> 
> In my opinion, that is absolutely the case.
> 
> > I found it can be hard to summary the commit with the Package/Module plus
> > the CVE number information.
> 
> I agree, it is hard. But, IMO, in this case, the precise CVE reference
> takes priority.
> 
For this case, I suggest to allow subject line length to be bigger, such as 120 
character.
I will update wiki 
https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-Format for 
CVE commit message format. 
For example: Pkg-Module: Brief-single-line-summary (CVE-Year-Number)

> Thanks
> Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [edk2-announce] Soft Feature Freeze starts today for edk2-stable201903

2019-02-25 Thread Gao, Liming
Hi, all
  Two features (Add SMM CET support and Add WiFi Connection Manager) get 
Acked-By or Reviewed-by near the soft feature freeze date. CET is X86 specific 
feature. WiFi connection manager is the standalone feature. Their impact should 
be small. So, I suggest to include them in this stable tag edk2-stable201903. 
If you have different opinion, please raise. If no objection, I will push them 
late this week. 

Add SMM CET support 
https://lists.01.org/pipermail/edk2-devel/2019-February/037128.html
NetworkPkg: Add WiFi Connection Manager to NetworkPkg 
https://lists.01.org/pipermail/edk2-devel/2019-February/037137.html

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Gao, 
> Liming
> Sent: Friday, February 22, 2019 10:26 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [edk2-announce] Soft Feature Freeze starts today for 
> edk2-stable201903
> 
> Hi, all
>   
> https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning 
> lists edk2-stable201903 tag planning. Now, we enter
> into Soft Feature Freeze phase. In this phase, the feature without 
> Reviewed-by or Acked-by tags will be delayed after the upcoming stable
> tag. The patch review can continue without break. Below is edk2-stable201903 
> tag planning.
> 
> 2019-03-08 Beginning of development
> 2019-02-22 Soft Feature Freeze
> 2019-03-01 Hard Feature Freeze
> 2019-03-08 Release
> 
> Thanks
> Liming
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] Fix links in Maintainers.txt and remove slow, outdated sourceforge git mirror

2019-02-25 Thread Gao, Liming
Yes. This is a bug fix. I agree to push it for Q1 release. 

>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Laszlo Ersek
>Sent: Tuesday, February 26, 2019 3:36 AM
>To: Gao, Liming ; Rebecca Cran
>; edk2-devel@lists.01.org
>Cc: Kinney, Michael D 
>Subject: Re: [edk2] [PATCH] Fix links in Maintainers.txt and remove slow,
>outdated sourceforge git mirror
>
>On 02/25/19 14:36, Gao, Liming wrote:
>> I can't clone edk2 code from http://git.code.sf.net/p/tianocore/edk2.
>Seemly, it doesn't work. So, I agree to remove it.
>>
>> Reviewed-by: Liming Gao 
>
>Do we consider this a bugfix, suitable to be pushed during the soft
>feature freeze?
>
>I suggest that we do.
>
>Thanks,
>Laszlo
>
>
>>> -Original Message-
>>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Laszlo Ersek
>>> Sent: Monday, February 25, 2019 6:07 PM
>>> To: Rebecca Cran ; edk2-devel@lists.01.org
>>> Cc: Kinney, Michael D 
>>> Subject: Re: [edk2] [PATCH] Fix links in Maintainers.txt and remove slow,
>outdated sourceforge git mirror
>>>
>>> On 02/23/19 06:18, Rebecca Cran via edk2-devel wrote:
>>>> ---
>>>>  Maintainers.txt | 7 +++
>>>>  1 file changed, 3 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/Maintainers.txt b/Maintainers.txt
>>>> index 7f1061d6c1..d9d3d840c5 100644
>>>> --- a/Maintainers.txt
>>>> +++ b/Maintainers.txt
>>>> @@ -31,11 +31,10 @@ Descriptions of section entries:
>>>>
>>>>  EDK II
>>>>  --
>>>> -W: http://www.tianocore.org/edk2/
>>>> -L: https://lists.sourceforge.net/lists/listinfo/edk2-devel
>>>> +W: https://github.com/tianocore/tianocore.github.io/wiki/EDK-II
>>>> +L: https://lists.01.org/mailman/listinfo/edk2-devel
>>>>  T: git - https://github.com/tianocore/edk2.git
>>>>  T: git (mirror) - https://bitbucket.org/tianocore/edk2.git
>>>> -T: git (mirror) - http://git.code.sf.net/p/tianocore/edk2
>>>>  T: svn (read-only, deprecated) -
>https://svn.code.sf.net/p/edk2/code/trunk/edk2
>>>>
>>>>  Tianocore Stewards
>>>> @@ -203,7 +202,7 @@ W:
>https://github.com/tianocore/tianocore.github.io/wiki/OptionRomPkg
>>>>  M: Ruiyu Ni 
>>>>
>>>>  OvmfPkg
>>>> -W: http://www.tianocore.org/ovmf/
>>>> +W: https://github.com/tianocore/tianocore.github.io/wiki/OVMF
>>>>  M: Jordan Justen 
>>>>  M: Laszlo Ersek 
>>>>  M: Ard Biesheuvel 
>>>>
>>>
>>> Reviewed-by: Laszlo Ersek 
>>>
>>> I can help push this change, but first let's wait for more feedback. I
>>> think the only point that might see a bit of discussion is dropping
>>>  (as you highlight in your followup).
>>>
>>> Thanks!
>>> Laszlo
>
>
>___
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] Fix links in Maintainers.txt and remove slow, outdated sourceforge git mirror

2019-02-25 Thread Gao, Liming
I can't clone edk2 code from http://git.code.sf.net/p/tianocore/edk2. Seemly, 
it doesn't work. So, I agree to remove it. 

Reviewed-by: Liming Gao 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Laszlo 
> Ersek
> Sent: Monday, February 25, 2019 6:07 PM
> To: Rebecca Cran ; edk2-devel@lists.01.org
> Cc: Kinney, Michael D 
> Subject: Re: [edk2] [PATCH] Fix links in Maintainers.txt and remove slow, 
> outdated sourceforge git mirror
> 
> On 02/23/19 06:18, Rebecca Cran via edk2-devel wrote:
> > ---
> >  Maintainers.txt | 7 +++
> >  1 file changed, 3 insertions(+), 4 deletions(-)
> >
> > diff --git a/Maintainers.txt b/Maintainers.txt
> > index 7f1061d6c1..d9d3d840c5 100644
> > --- a/Maintainers.txt
> > +++ b/Maintainers.txt
> > @@ -31,11 +31,10 @@ Descriptions of section entries:
> >
> >  EDK II
> >  --
> > -W: http://www.tianocore.org/edk2/
> > -L: https://lists.sourceforge.net/lists/listinfo/edk2-devel
> > +W: https://github.com/tianocore/tianocore.github.io/wiki/EDK-II
> > +L: https://lists.01.org/mailman/listinfo/edk2-devel
> >  T: git - https://github.com/tianocore/edk2.git
> >  T: git (mirror) - https://bitbucket.org/tianocore/edk2.git
> > -T: git (mirror) - http://git.code.sf.net/p/tianocore/edk2
> >  T: svn (read-only, deprecated) - 
> > https://svn.code.sf.net/p/edk2/code/trunk/edk2
> >
> >  Tianocore Stewards
> > @@ -203,7 +202,7 @@ W: 
> > https://github.com/tianocore/tianocore.github.io/wiki/OptionRomPkg
> >  M: Ruiyu Ni 
> >
> >  OvmfPkg
> > -W: http://www.tianocore.org/ovmf/
> > +W: https://github.com/tianocore/tianocore.github.io/wiki/OVMF
> >  M: Jordan Justen 
> >  M: Laszlo Ersek 
> >  M: Ard Biesheuvel 
> >
> 
> Reviewed-by: Laszlo Ersek 
> 
> I can help push this change, but first let's wait for more feedback. I
> think the only point that might see a bit of discussion is dropping
>  (as you highlight in your followup).
> 
> Thanks!
> Laszlo
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 2/2] BaseTools: Fix a Eot issue.

2019-02-25 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Feng, 
> Bob C
> Sent: Monday, February 25, 2019 5:23 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [Patch 2/2] BaseTools: Fix a Eot issue.
> 
> FirmwareVolume.UnDispatchedFfsDict is mutated during iteration,
> convert the FirmwareVolume.UnDispatchedFfsDict.keys() to a new list
>  to resolve this problem.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> ---
>  BaseTools/Source/Python/Eot/EotMain.py | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Eot/EotMain.py 
> b/BaseTools/Source/Python/Eot/EotMain.py
> index 3020f6525e..4802aea8b1 100644
> --- a/BaseTools/Source/Python/Eot/EotMain.py
> +++ b/BaseTools/Source/Python/Eot/EotMain.py
> @@ -389,11 +389,11 @@ class FirmwareVolume(Image):
>  FfsSecCoreGuid = None
>  FfsPeiCoreGuid = None
>  FfsDxeCoreGuid = None
>  FfsPeiPrioriGuid = None
>  FfsDxePrioriGuid = None
> -for FfsID in self.UnDispatchedFfsDict.keys():
> +for FfsID in list(self.UnDispatchedFfsDict.keys()):
>  Ffs = self.UnDispatchedFfsDict[FfsID]
>  if Ffs.Type == 0x03:
>  FfsSecCoreGuid = FfsID
>  continue
>  if Ffs.Type == 0x04:
> @@ -495,11 +495,11 @@ class FirmwareVolume(Image):
>  EotGlobalData.gPpiList[Record[0].lower()] = ModuleGuid
> 
>  def DisPatchDxe(self, Db):
>  IsInstalled = False
>  ScheduleList = sdict()
> -for FfsID in self.UnDispatchedFfsDict.keys():
> +for FfsID in list(self.UnDispatchedFfsDict.keys()):
>  CouldBeLoaded = False
>  DepexString = ''
>  FileDepex = None
>  Ffs = self.UnDispatchedFfsDict[FfsID]
>  if Ffs.Type == 0x07:
> @@ -560,11 +560,11 @@ class FirmwareVolume(Image):
>  if IsInstalled:
>  self.DisPatchDxe(Db)
> 
>  def DisPatchPei(self, Db):
>  IsInstalled = False
> -for FfsID in self.UnDispatchedFfsDict.keys():
> +for FfsID in list(self.UnDispatchedFfsDict.keys()):
>  CouldBeLoaded = True
>  DepexString = ''
>  FileDepex = None
>  Ffs = self.UnDispatchedFfsDict[FfsID]
>  if Ffs.Type == 0x06 or Ffs.Type == 0x08:
> --
> 2.20.1.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 1/2] BaseTools: Eot failed when enable python3

2019-02-25 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: Feng, Bob C
> Sent: Monday, February 25, 2019 5:22 PM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C ; Gao, Liming 
> Subject: [Patch 1/2] BaseTools: Eot failed when enable python3
> 
> The Eot will report error when python3 enabled.
> We replaced sdict with collections.OrderedDict in python3
> patch set, but the sdict implement "append" method which is not
> implemented in collections.OrderedDict.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> ---
>  BaseTools/Source/Python/Eot/EotMain.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Source/Python/Eot/EotMain.py 
> b/BaseTools/Source/Python/Eot/EotMain.py
> index 56aa48d2a1..3020f6525e 100644
> --- a/BaseTools/Source/Python/Eot/EotMain.py
> +++ b/BaseTools/Source/Python/Eot/EotMain.py
> @@ -1103,11 +1103,11 @@ class MultipleFv(FirmwareVolume):
> 
>  Fv = FirmwareVolume(FvName)
>  Fv.frombuffer(Buf, 0, len(Buf))
> 
>  self.BasicInfo.append([Fv.Name, Fv.FileSystemGuid, Fv.Size])
> -self.FfsDict.append(Fv.FfsDict)
> +self.FfsDict.update(Fv.FfsDict)
> 
>  ## Class Eot
>  #
>  # This class is used to define Eot main entrance
>  #
> --
> 2.20.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [edk2-announce] Soft Feature Freeze starts today for edk2-stable201903

2019-02-23 Thread Gao, Liming
Lazlo:
  I agree. I don't think there is the rule break for the patch set of boot 
progress reporting. I also prefer to push them early next week. 

Thanks
Liming
> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Saturday, February 23, 2019 4:20 AM
> To: Gao, Liming ; edk2-devel@lists.01.org
> Subject: Re: [edk2] [edk2-announce] Soft Feature Freeze starts today for 
> edk2-stable201903
> 
> Hi Liming,
> 
> On 02/22/19 15:25, Gao, Liming wrote:
> > Hi, all
> >   
> > https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning
> >  lists edk2-stable201903 tag planning. Now, we enter
> into Soft Feature Freeze phase. In this phase, the feature without 
> Reviewed-by or Acked-by tags will be delayed after the upcoming stable
> tag. The patch review can continue without break. Below is edk2-stable201903 
> tag planning.
> >
> > 2019-03-08 Beginning of development
> > 2019-02-22 Soft Feature Freeze
> > 2019-03-01 Hard Feature Freeze
> > 2019-03-08 Release
> 
> I got the last missing R-b from Ray for my patch set
> 
> [edk2] [PATCH v3 0/5] MdeModulePkg, OvmfPkg, ArmVirtPkg: more visible
> boot progress reporting
> 
> today (2019-02-22) at 12:50 in my time zone (CET = UTC+01:00). Before
> pushing the series, I asked Ray to confirm one last thing about his
> review. I consider the series properly reviewed, but due to this last
> question, I expect I should push it early next week.
> 
> IMO that satisfies the soft feature freeze definition:
> 
> https://github.com/tianocore/tianocore.github.io/wiki/SoftFeatureFreeze
> 
> "By the date of the soft feature freeze, developers must have sent their
> patches to the mailing list and received positive maintainer reviews
> (Reviewed-by or Acked-by tags). [...] Between the soft feature freeze
> and the hard feature freeze, previously reviewed and unit-tested
> features may be applied (or merged) to the master branch, for
> integration testing."
> 
> Do you (and others) agree?
> 
> If not, I won't insist -- while I'd certainly prefer these patches to be
> in the upcoming stable tag, if the community perceives it would mean
> bending the rules, I wouldn't want to do that. (Right now I don't think
> it would bend the rules).
> 
> Thanks,
> Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch V2] BaseTools: Add parameter check for the AsciiStringToUint64

2019-02-23 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: Feng, Bob C
> Sent: Saturday, February 23, 2019 5:42 PM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C ; Gao, Liming 
> Subject: [Patch V2] BaseTools: Add parameter check for the AsciiStringToUint64
> 
> If the input parameter AsciiString length is greater
> than 255, the GenFv will hang.
> 
> This patch is to fix this issue.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> ---
>  BaseTools/Source/C/Common/ParseInf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Source/C/Common/ParseInf.c 
> b/BaseTools/Source/C/Common/ParseInf.c
> index 3907f44331..c5d79c89fa 100644
> --- a/BaseTools/Source/C/Common/ParseInf.c
> +++ b/BaseTools/Source/C/Common/ParseInf.c
> @@ -506,11 +506,11 @@ Returns:
>Index = 0;
> 
>//
>// Check input parameter
>//
> -  if (AsciiString == NULL || ReturnValue == NULL) {
> +  if (AsciiString == NULL || ReturnValue == NULL || strlen(AsciiString) > 
> 0xFF) {
>  return EFI_INVALID_PARAMETER;
>}
>while (AsciiString[Index] == ' ') {
>  Index ++;
>}
> --
> 2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch edk2-wiki] Update ECC wiki page

2019-02-22 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Bi, 
> Dandan
> Sent: Monday, February 18, 2019 3:36 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [patch edk2-wiki] Update ECC wiki page
> 
> Update ECC wiki page to record how to solve the
> problem “ModuleNotFoundError: No module named 'antlr4'”
> when run ECC tool with python3.x.
> 
> Cc: Liming Gao 
> Cc: Bob Feng 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Dandan Bi 
> ---
>  ECC-tool.md | 15 ---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/ECC-tool.md b/ECC-tool.md
> index eaf4137..03dbb30 100644
> --- a/ECC-tool.md
> +++ b/ECC-tool.md
> @@ -12,18 +12,27 @@ Steps to run ECC tool:
>  **1). Enter edk2 directory, run: **edksetup.bat (**on Windows**)
>**Enter edk2 directory, run: **source edksetup.sh (**on 
> Linux**)
> 
>  **2). Then in edk2 directory, you can type "Ecc" to run ECC tool 
> directly**.
> 
> -**3). If you meet following error:**
> +**3). If you meet following errors:**
> +**Error 1:**
>  **import antlr3**
>  **ImportError: No module named antlr3**
> 
> -Since ECC depends on antlr V3.0.1, you can download it from 
> http://www.antlr3.org/download/Python/ 
> +This error may be met when you run ECC tool with python 2.x, then ECC 
> depends on antlr V3.0.1, you can download it from
> http://www.antlr3.org/download/Python/ 
>  After download and extract it, you can enter the antlr tool directory and 
> run: 
>  **C:\Python27\python.exe setup.py install** to install it.(**on Windows**) 
> 
> -**python setup.py install**" to install it, root access may be 
> required.(**on Linux**) 
> +**python setup.py install** to install it, root access may be required.(**on 
> Linux**) 
> +
> +**Error 2:**
> +**import antlr4 as antlr** 
> +**ModuleNotFoundError: No module named 'antlr4'** 
> +
> +This error may be met when you run ECC tool with python 3.x, then ECC 
> depends on antlr4, you can install it through following
> command.
> +**py -3 -m pip install antlr4-python3-runtime** to install it.(**on 
> Windows**) 
> +**sudo python3 -m pip install antlr4-python3-runtime** to install it. (**on 
> Linux**) 
> 
>  **4). You can type "Ecc -h/Ecc --help" to get the help info of ECC 
> tool**.
> 
>  **5). Common usage model:**
>  **Ecc -c config file  -e exception file  -t  the target directory which need 
> to be scanned by ECC -r the ECC scan result csv file**
> --
> 2.18.0.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] BaseTools: Add parameter check for the AsciiStringToUint64

2019-02-22 Thread Gao, Liming
Bob:
  This function is used to convert string to UINT64. So, the string len should 
not be too long. I think UINT8 max value 255 is enough for its usage.

Thanks
Liming
> -Original Message-
> From: Feng, Bob C
> Sent: Friday, February 22, 2019 6:05 PM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C ; Gao, Liming 
> Subject: [Patch] BaseTools: Add parameter check for the AsciiStringToUint64
> 
> If the input parameter AsciiString length is greater
> than 255, the GenFv will hang.
> 
> This patch is to fix this issue.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> ---
>  BaseTools/Source/C/Common/ParseInf.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/C/Common/ParseInf.c 
> b/BaseTools/Source/C/Common/ParseInf.c
> index 3907f44331..b29f4c2f93 100644
> --- a/BaseTools/Source/C/Common/ParseInf.c
> +++ b/BaseTools/Source/C/Common/ParseInf.c
> @@ -493,11 +493,11 @@ Returns:
>EFI_SUCCESS   Number successfully converted.
>EFI_ABORTED   Invalid character encountered.
> 
>  --*/
>  {
> -  UINT8   Index;
> +  UINT32   Index;
>UINT64  Value;
>CHAR8   CurrentChar;
> 
>//
>// Initialize the result
> @@ -506,11 +506,11 @@ Returns:
>Index = 0;
> 
>//
>// Check input parameter
>//
> -  if (AsciiString == NULL || ReturnValue == NULL) {
> +  if (AsciiString == NULL || ReturnValue == NULL || strlen(AsciiString) > 
> 0x) {
>  return EFI_INVALID_PARAMETER;
>}
>while (AsciiString[Index] == ' ') {
>  Index ++;
>}
> --
> 2.20.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch edk2 wiki] Add new feature: WiFi Connection Manager for edk2-stable201903 in EDK-II-Release-Planning

2019-02-22 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: Wang, Fan
> Sent: Wednesday, February 13, 2019 11:27 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [Patch edk2 wiki] Add new feature: WiFi Connection Manager for 
> edk2-stable201903 in EDK-II-Release-Planning
> 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Wang Fan 
> ---
>  EDK-II-Release-Planning.md | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/EDK-II-Release-Planning.md b/EDK-II-Release-Planning.md
> index f302be3..eba2afe 100644
> --- a/EDK-II-Release-Planning.md
> +++ b/EDK-II-Release-Planning.md
> @@ -23,9 +23,10 @@
>  * [Split the S3 phase device initialization codes from the OpalPassword PEI 
> driver](https://bugzilla.tianocore.org/show_bug.cgi?id=1409)
>  * [Remove PcdPeiCoreMaxXXX 
> PCDs](https://bugzilla.tianocore.org/show_bug.cgi?id=1405)
>  * [Remove unused tool logic in BaseTools 
> C\Python](https://bugzilla.tianocore.org/show_bug.cgi?id=1350)
>  * [BaseTools: Enable component override 
> functionality](https://bugzilla.tianocore.org/show_bug.cgi?id=1449)
>  * [SMM CET support](https://bugzilla.tianocore.org/show_bug.cgi?id=1521)
> +* [Add Wi-Fi Connection Manager to 
> NetworkPkg](https://bugzilla.tianocore.org/show_bug.cgi?id=1492)
>  * Standalone MM build of authenticated variable stack (bugzilla link TBD)
>  * TBD Bugzilla List
> 
>  ---
> --
> 2.16.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [edk2-announce] Soft Feature Freeze starts today for edk2-stable201903

2019-02-22 Thread Gao, Liming
Hi, all
  https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning 
lists edk2-stable201903 tag planning. Now, we enter into Soft Feature Freeze 
phase. In this phase, the feature without Reviewed-by or Acked-by tags will be 
delayed after the upcoming stable tag. The patch review can continue without 
break. Below is edk2-stable201903 tag planning.

2019-03-08 Beginning of development
2019-02-22 Soft Feature Freeze
2019-03-01 Hard Feature Freeze
2019-03-08 Release

Thanks
Liming

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] BaseTools: Fix a bug about Structure PCD

2019-02-21 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: Feng, Bob C
>Sent: Tuesday, February 19, 2019 9:30 PM
>To: edk2-devel@lists.01.org
>Cc: Feng, Bob C ; Gao, Liming 
>Subject: [Patch] BaseTools: Fix a bug about Structure PCD
>
>BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1535
>If there is Hii Structure Pcd, build will fail, root cause is that
>there is an incorrect variable access method used in code.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Bob Feng 
>Cc: Liming Gao 
>---
> BaseTools/Source/Python/Workspace/DscBuildData.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
>b/BaseTools/Source/Python/Workspace/DscBuildData.py
>index e45beb3924..2e6eb16b08 100644
>--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
>+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
>@@ -2392,11 +2392,11 @@ class DscBuildData(PlatformBuildClassObject):
> skuinfo = Pcd.SkuInfoList[skuname]
> if skuinfo.VariableName:
> for defaultstore in skuinfo.DefaultStoreDict:
> pcddscrawdefaultvalue = 
> self.GetPcdDscRawDefaultValue(Pcd,
>skuname, defaultstore)
> if pcddscrawdefaultvalue:
>-Value = skuinfo[defaultstore]
>+Value = skuinfo.DefaultStoreDict[defaultstore]
> if "{CODE(" in Value:
> realvalue = Value.strip()[6:-2] # 
> "{CODE(").rstrip(")}"
> CApp += "static %s %s_%s_%s_%s_Value%s = 
> %s;\n" %
>(Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName,Pcd.TokenCName,skunam
>e,defaultstore,Demesion,realvalue)
> else:
> pcddscrawdefaultvalue = self.GetPcdDscRawDefaultValue(Pcd,
>skuname, TAB_DEFAULT_STORES_DEFAULT)
>--
>2.20.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch V2] BaseTool: Fixed incremental rebuild issue.

2019-02-21 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: Feng, Bob C
>Sent: Wednesday, February 20, 2019 11:22 PM
>To: edk2-devel@lists.01.org
>Cc: Feng, Bob C ; Gao, Liming 
>Subject: [Patch V2] BaseTool: Fixed incremental rebuild issue.
>
>BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1540
>
>This issue in introduced by commit
>d943b0c339fe3d35ffdf9f580ccb7a55915c6854
>
>To convert bytes to string, we need to use bytes.decode()
>instead of using str(bytes).
>
>If the source file is not a txt file, ignore that file.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Bob Feng 
>Cc: Liming Gao 
>---
> BaseTools/Source/Python/AutoGen/GenMake.py  | 16 
> .../Source/Python/Workspace/DscBuildData.py | 17 -
> 2 files changed, 16 insertions(+), 17 deletions(-)
>
>diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py
>b/BaseTools/Source/Python/AutoGen/GenMake.py
>index 53c5b8577d..b441817b52 100644
>--- a/BaseTools/Source/Python/AutoGen/GenMake.py
>+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
>@@ -1043,18 +1043,18 @@ cleanlib:
> Fd.close()
> except BaseException as X:
> EdkLogger.error("build", FILE_OPEN_FAILURE, 
> ExtraData=F.Path +
>"\n\t" + str(X))
> if len(FileContent) == 0:
> continue
>-
>-if FileContent[0] == 0xff or FileContent[0] == 0xfe:
>-FileContent = FileContent.decode('utf-16')
>-else:
>-try:
>-FileContent = str(FileContent)
>-except:
>-pass
>+try:
>+if FileContent[0] == 0xff or FileContent[0] == 0xfe:
>+FileContent = FileContent.decode('utf-16')
>+else:
>+FileContent = FileContent.decode()
>+except:
>+# The file is not txt file. for example .mcb file
>+continue
> IncludedFileList = gIncludePattern.findall(FileContent)
>
> for Inc in IncludedFileList:
> Inc = Inc.strip()
> # if there's macro used to reference header file, expand 
> it
>diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
>b/BaseTools/Source/Python/Workspace/DscBuildData.py
>index 1ffefe6e7e..7221946062 100644
>--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
>+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
>@@ -153,19 +153,18 @@ def GetDependencyList(FileStack, SearchPathList):
> Fd.close()
>
> if len(FileContent) == 0:
> continue
>
>-if FileContent[0] == 0xff or FileContent[0] == 0xfe:
>-FileContent = FileContent.decode('utf-16')
>-IncludedFileList = gIncludePattern.findall(FileContent)
>-else:
>-try:
>-FileContent = str(FileContent)
>-IncludedFileList = gIncludePattern.findall(FileContent)
>-except:
>-pass
>+try:
>+if FileContent[0] == 0xff or FileContent[0] == 0xfe:
>+FileContent = FileContent.decode('utf-16')
>+else:
>+FileContent = FileContent.decode()
>+except:
>+# The file is not txt file. for example .mcb file
>+continue
> IncludedFileList = gIncludePattern.findall(FileContent)
>
> for Inc in IncludedFileList:
> Inc = Inc.strip()
> Inc = os.path.normpath(Inc)
>--
>2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 0/3] Add SMM CET support

2019-02-21 Thread Gao, Liming
Acked-by: Liming Gao 

>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Jiewen Yao
>Sent: Friday, February 22, 2019 12:16 PM
>To: edk2-devel@lists.01.org
>Cc: Dong, Eric ; Gao, Liming ;
>Yao, Jiewen ; Kinney, Michael D
>; Laszlo Ersek 
>Subject: [edk2] [PATCH 0/3] Add SMM CET support
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1521
>
>This patch series implement add CET ShadowStack support for SMM.
>
>The CET document can be found at:
>https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-
>enforcement-technology-preview.pdf
>
>Patch 1 adds SSP (ShadowStackPointer) to JUMP_BUFFER.
>Patch 2 adds Control Protection exception (CP#) dump info.
>Patch 3 adds CET ShadowStack support in SMM.
>
>For more detail please refer to each patch.
>
>I also post all update to https://github.com/jyao1/edk2/tree/CET
>
>Cc: Michael D Kinney 
>Cc: Liming Gao 
>Cc: Eric Dong 
>Cc: Ray Ni 
>Cc: Laszlo Ersek 
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Yao Jiewen 
>
>Jiewen Yao (3):
>  MdePkg/BaseLib: Add Shadow Stack Support for X86.
>  UefiCpuPkg/ExceptionLib: Add CET support.
>  UefiCpuPkg/PiSmmCpu: Add Shadow Stack Support for X86 SMM.
>
> MdePkg/Include/Library/BaseLib.h  |   2 +
> MdePkg/Library/BaseLib/Ia32/LongJump.nasm |  18 ++-
> MdePkg/Library/BaseLib/Ia32/SetJump.nasm  |  17 ++-
> MdePkg/Library/BaseLib/X64/LongJump.nasm  |  20 ++-
> MdePkg/Library/BaseLib/X64/SetJump.nasm   |  17 ++-
> .../Include/Library/SmmCpuFeaturesLib.h   |  23 +++-
> .../CpuExceptionCommon.c  |   7 +-
> .../CpuExceptionCommon.h  |   3 +-
> .../Ia32/ArchExceptionHandler.c   |   5 +-
> .../X64/ArchExceptionHandler.c|   5 +-
> UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Cet.nasm   |  37 ++
> UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c  |  38 +-
> UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm  |  98
>++-
> .../PiSmmCpuDxeSmm/Ia32/SmiException.nasm |   6 +-
> UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmFuncsArch.c |  57 -
> UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c |  12 +-
> UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c|  97
>--
> UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h| 103
>++-
> UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf  |   6 +-
> .../PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c   |  85
>-
> UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c|  18 ++-
> UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.h|   4 +-
> UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c|   4 +-
> UefiCpuPkg/PiSmmCpuDxeSmm/X64/Cet.nasm|  38 ++
> UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c   |  39 +-
> UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm   | 119
>+-
> UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmmFuncsArch.c  |  58 -
> UefiCpuPkg/UefiCpuPkg.dec |  13 +-
> 28 files changed, 890 insertions(+), 59 deletions(-)
> create mode 100644 UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Cet.nasm
> create mode 100644 UefiCpuPkg/PiSmmCpuDxeSmm/X64/Cet.nasm
>
>--
>2.19.2.windows.1
>
>___
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch edk2 Wiki] Add three features for edk2-stable201903

2019-02-21 Thread Gao, Liming
Sorry for confuse. I just realize this patch wrongly remove SMM CET support in 
Q1 planning. This change is not in this patch scope. I will add back it. 

Thanks
Liming
>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Liming Gao
>Sent: Wednesday, February 13, 2019 12:24 PM
>To: edk2-devel@lists.01.org
>Subject: [edk2] [Patch edk2 Wiki] Add three features for edk2-stable201903
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Liming Gao 
>---
> EDK-II-Release-Planning.md | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
>diff --git a/EDK-II-Release-Planning.md b/EDK-II-Release-Planning.md
>index f302be3..095da69 100644
>--- a/EDK-II-Release-Planning.md
>+++ b/EDK-II-Release-Planning.md
>@@ -24,7 +24,9 @@
> * [Remove PcdPeiCoreMaxXXX
>PCDs](https://bugzilla.tianocore.org/show_bug.cgi?id=1405)
> * [Remove unused tool logic in BaseTools
>C\Python](https://bugzilla.tianocore.org/show_bug.cgi?id=1350)
> * [BaseTools: Enable component override
>functionality](https://bugzilla.tianocore.org/show_bug.cgi?id=1449)
>-* [SMM CET support](https://bugzilla.tianocore.org/show_bug.cgi?id=1521)
>+* [Support PI1.7
>EFI_PEI_CORE_FV_LOCATION_PPI](https://bugzilla.tianocore.org/show_bug.
>cgi?id=1524)
>+* [Remove unused tool chain configuration in
>tools_def.template](https://bugzilla.tianocore.org/show_bug.cgi?id=1377)
>+* [BaseTools supports to the driver
>combination](https://bugzilla.tianocore.org/show_bug.cgi?id=1520)
> * Standalone MM build of authenticated variable stack (bugzilla link TBD)
> * TBD Bugzilla List
>
>--
>2.13.0.windows.1
>
>___
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch edk2 Wiki] Add ATA Security feature set support for edk2-stable201903

2019-02-21 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: Wu, Hao A
> Sent: Thursday, February 21, 2019 2:05 PM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A ; Gao, Liming 
> Subject: [Patch edk2 Wiki] Add ATA Security feature set support for 
> edk2-stable201903
> 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Hao Wu 
> ---
>  EDK-II-Release-Planning.md | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/EDK-II-Release-Planning.md b/EDK-II-Release-Planning.md
> index 095da69..9244fc4 100644
> --- a/EDK-II-Release-Planning.md
> +++ b/EDK-II-Release-Planning.md
> @@ -27,6 +27,7 @@
>  * [Support PI1.7 
> EFI_PEI_CORE_FV_LOCATION_PPI](https://bugzilla.tianocore.org/show_bug.cgi?id=1524)
>  * [Remove unused tool chain configuration in 
> tools_def.template](https://bugzilla.tianocore.org/show_bug.cgi?id=1377)
>  * [BaseTools supports to the driver 
> combination](https://bugzilla.tianocore.org/show_bug.cgi?id=1520)
> +* [Add Security feature set support for ATA 
> devices](https://bugzilla.tianocore.org/show_bug.cgi?id=1529)
>  * Standalone MM build of authenticated variable stack (bugzilla link TBD)
>  * TBD Bugzilla List
> 
> --
> 2.12.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v4 0/7] ResetSystemLib changings

2019-02-20 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 
> Zhichao Gao
> Sent: Thursday, February 21, 2019 9:00 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [PATCH v4 0/7] ResetSystemLib changings
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1460
> Add a new API ResetSystem in ResetSystemLib.
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1461
> Implement a runtime library instance of ResetSystemLib base on the new 
> changing.
> 
> V2: Add some required data type header file
> 
> V3: Resolve a case-typing error.
> 
> V4: Change the ResetSystemRuntimeDxe/ResetSystem.c name to 
> RuntimeServiceResetSystem.
> Add a new interface for PEI version ResetSystemLib.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhichao Gao 
> Cc: Ray Ni 
> Cc: Liming Gao 
> 
> Zhichao Gao (7):
>   MdeModulePkg: change the function name ResetSystem
>   MdeModulePkg: Add the new API ResetSystem in the head file
>   MdeModulePkg: Add a new API ResetSystem for DXE ResetSystemLib
>   MdeModulePkg: Add a new API ResetSystem for Null version
>   MdeModulePkg: Add a new API ResetSystem for PEI ResetSystemLib
>   MdeModulePkg: Add a runtime library instance of ResetSystemLib
>   MdeModulePkg: Add the runtime ResetSystemLib in MdeModulePkg.dsc
> 
>  MdeModulePkg/Include/Library/ResetSystemLib.h  |  28 ++-
>  .../BaseResetSystemLibNull.c   |  27 +++
>  .../Library/DxeResetSystemLib/DxeResetSystemLib.c  |  28 ++-
>  .../Library/PeiResetSystemLib/PeiResetSystemLib.c  |  28 ++-
>  .../RuntimeResetSystemLib/RuntimeResetSystemLib.c  | 216 
> +
>  .../RuntimeResetSystemLib.inf  |  50 +
>  .../RuntimeResetSystemLib.uni  |  21 ++
>  MdeModulePkg/MdeModulePkg.dsc  |   1 +
>  .../Universal/ResetSystemRuntimeDxe/ResetSystem.c  |   8 +-
>  .../Universal/ResetSystemRuntimeDxe/ResetSystem.h  |   4 +-
>  10 files changed, 402 insertions(+), 9 deletions(-)
>  create mode 100644 
> MdeModulePkg/Library/RuntimeResetSystemLib/RuntimeResetSystemLib.c
>  create mode 100644 
> MdeModulePkg/Library/RuntimeResetSystemLib/RuntimeResetSystemLib.inf
>  create mode 100644 
> MdeModulePkg/Library/RuntimeResetSystemLib/RuntimeResetSystemLib.uni
> 
> --
> 2.16.2.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] MdeModulePkg/ScsiDiskDxe: Support Storage Security Command Protocol

2019-02-20 Thread Gao, Liming
Christopher:
  Please separate the patch per package. The patch can't cross the different 
packages. 

Thanks
Liming
>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Zurcher, Christopher J
>Sent: Thursday, February 21, 2019 7:56 AM
>To: edk2-devel@lists.01.org
>Subject: [edk2] [PATCH] MdeModulePkg/ScsiDiskDxe: Support Storage
>Security Command Protocol
>
>BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1546
>
>This patch implements the EFI_STORAGE_SECURITY_COMMAND_PROTOCOL
>in the
>ScsiDiskDxe driver (and supporting library, UefiScsiLib).
>
>Support is currently limited to the RPMB Well-known LUN for UFS devices.
>
>Cc: Jiewen Yao 
>Cc: Jian J Wang 
>Cc: Liming Gao 
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Christopher J Zurcher 
>---
> MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c|   5 +-
> MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ComponentName.c |  14 +-
> MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c  | 510
>+-
> MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h  | 171 +++-
> MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf |   3 +-
> MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c |  19 +-
> MdePkg/Include/IndustryStandard/Scsi.h|  48 +-
> MdePkg/Include/Library/UefiScsiLib.h  | 126 +-
> MdePkg/Include/Protocol/ScsiIo.h  |   9 +-
> MdePkg/Library/UefiScsiLib/UefiScsiLib.c  | 205 -
> 10 files changed, 1064 insertions(+), 46 deletions(-)
>
>diff --git a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
>b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
>index 11a7f2a927..0b4c51764e 100644
>--- a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
>+++ b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
>@@ -2,7 +2,7 @@
>   SCSI Bus driver that layers on every SCSI Pass Thru and
>   Extended SCSI Pass Thru protocol in the system.
>
>-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
>+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
> This program and the accompanying materials
> are licensed and made available under the terms and conditions of the BSD
>License
> which accompanies this distribution.  The full text of the license may be 
> found
>at
>@@ -1374,7 +1374,8 @@ DiscoverScsiDevice (
> goto Done;
>   }
>
>-  if (0x1e >= InquiryData->Peripheral_Type && InquiryData-
>>Peripheral_Type >= 0xa) {
>+  if ((InquiryData->Peripheral_Type >= EFI_SCSI_TYPE_RESERVED_LOW) &&
>+  (InquiryData->Peripheral_Type <= EFI_SCSI_TYPE_RESERVED_HIGH)) {
> ScsiDeviceFound = FALSE;
> goto Done;
>   }
>diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ComponentName.c
>b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ComponentName.c
>index f2da7af8fb..cba833d4ca 100644
>--- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ComponentName.c
>+++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ComponentName.c
>@@ -1,7 +1,7 @@
> /** @file
>   UEFI Component Name(2) protocol implementation for SCSI disk driver.
>
>-Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
>+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
> This program and the accompanying materials
> are licensed and made available under the terms and conditions of the BSD
>License
> which accompanies this distribution.  The full text of the license may be 
> found
>at
>@@ -173,9 +173,9 @@ ScsiDiskComponentNameGetControllerName (
>   OUT CHAR16  **ControllerName
>   )
> {
>-  EFI_STATUSStatus;
>-  SCSI_DISK_DEV *ScsiDiskDevice;
>-  EFI_BLOCK_IO_PROTOCOL *BlockIo;
>+  EFI_STATUS  Status;
>+  SCSI_DISK_DEV   *ScsiDiskDevice;
>+  EFI_DISK_INFO_PROTOCOL  *DiskInfo;
>
>   //
>   // This is a device driver, so ChildHandle must be NULL.
>@@ -200,8 +200,8 @@ ScsiDiskComponentNameGetControllerName (
>   //
>   Status = gBS->OpenProtocol (
>   ControllerHandle,
>-  ,
>-  (VOID **) ,
>+  ,
>+  (VOID **) ,
>   gScsiDiskDriverBinding.DriverBindingHandle,
>   ControllerHandle,
>   EFI_OPEN_PROTOCOL_GET_PROTOCOL
>@@ -211,7 +211,7 @@ ScsiDiskComponentNameGetControllerName (
> return Status;
>   }
>
>-  ScsiDiskDevice = SCSI_DISK_DEV_FROM_BLKIO (BlockIo);
>+  ScsiDiskDevice = SCSI_DISK_DEV_FROM_DISKINFO (DiskInfo);
>
>   return LookupUnicodeString2 (
>Language,
>diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
>b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
>index 0d63c85e44..75eb13ca20 100644
>--- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
>+++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
>@@ -1,7 +1,7 @@
> /** @file
>   SCSI disk driver that layers on every SCSI IO protocol in the system.
>
>-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
>+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
> This program and the accompanying 

Re: [edk2] Issues with EDK-II-Debugging wiki page, and how to submit a pull request for wiki pages

2019-02-20 Thread Gao, Liming
Laszlo:
  I mostly use local editor to edit wiki and send the patch. This way can't see 
the preview wiki page in web. It may cause the mistake. 

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Laszlo 
> Ersek
> Sent: Wednesday, February 20, 2019 5:52 PM
> To: Rebecca Cran ; Kinney, Michael D 
> 
> Cc: edk2-devel 
> Subject: Re: [edk2] Issues with EDK-II-Debugging wiki page, and how to submit 
> a pull request for wiki pages
> 
> On 02/20/19 08:45, Rebecca Cran wrote:
> > On Thursday, 14 February 2019 12:23:05 MST Laszlo Ersek wrote:
> >
> >> The wikis on github are non-intuitive, if you intend to edit them in a
> >> normal text editor, locally. I struggled a lot until I came up with the
> >> list on top. (It's possible I relied on others' advice in that; I no
> >> longer remember.) I hope it helps.
> >
> > Yeah, thanks but no thanks. I'm not _that_ keen on making my changes if it's
> > going to involve all that work!
> >
> 
> Totally understandable. I *think* it should be possible to simply edit
> the wiki articles with github's built-in wiki editor too, but I have no
> clue about the credentials needed. Perhaps being a member of the
>  organization suffices; I'm not certain.
> 
> Mike, can you please comment? What's the best process for wiki edits?
> 
> Thanks,
> Laszlo
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v3 0/6] ResetSystemLib changings

2019-02-20 Thread Gao, Liming
Zhichao:
  For patch2~5, my comment is to move patch 4 as patch 2. Normally, we add API 
definition in library class header file first, then update the library instance 
implementation. I have no comments for the code change. Reviewed-by: Liming Gao 


Thanks
Liming
> -Original Message-
> From: Gao, Zhichao
> Sent: Wednesday, February 20, 2019 4:39 PM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ray ; Gao, Liming 
> Subject: [PATCH v3 0/6] ResetSystemLib changings
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1460
> Add a new API ResetSystem in ResetSystemLib.
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1461
> Implement a runtime library instance of ResetSystemLib base on the new 
> changing.
> 
> V2: Add some required data type header file
> 
> V3: Resolve a case-typing error.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhichao Gao 
> Cc: Ray Ni 
> Cc: Liming Gao 
> 
> Zhichao Gao (6):
>   MdeModulePkg: change the function name ResetSystem
>   MdeModulePkg: Add a new API ResetSystem for DXE ResetSystemLib
>   MdeModulePkg: Add a new API ResetSystem for Null version
>   MdeModulePkg: Add the new API ResetSystem in the head file
>   MdeModulePkg: Add a runtime library instance of ResetSystemLib
>   MdeModulePkg: Add the runtime ResetSystemLib in MdeModulePkg.dsc
> 
>  MdeModulePkg/Include/Library/ResetSystemLib.h  |  28 ++-
>  .../BaseResetSystemLibNull.c   |  27 +++
>  .../Library/DxeResetSystemLib/DxeResetSystemLib.c  |  28 ++-
>  .../RuntimeResetSystemLib/RuntimeResetSystemLib.c  | 216 
> +
>  .../RuntimeResetSystemLib.inf  |  50 +
>  .../RuntimeResetSystemLib.uni  |  21 ++
>  MdeModulePkg/MdeModulePkg.dsc  |   1 +
>  .../Universal/ResetSystemRuntimeDxe/ResetSystem.c  |   8 +-
>  .../Universal/ResetSystemRuntimeDxe/ResetSystem.h  |   4 +-
>  9 files changed, 375 insertions(+), 8 deletions(-)
>  create mode 100644 
> MdeModulePkg/Library/RuntimeResetSystemLib/RuntimeResetSystemLib.c
>  create mode 100644 
> MdeModulePkg/Library/RuntimeResetSystemLib/RuntimeResetSystemLib.inf
>  create mode 100644 
> MdeModulePkg/Library/RuntimeResetSystemLib/RuntimeResetSystemLib.uni
> 
> --
> 2.16.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v3 1/6] MdeModulePkg: change the function name ResetSystem

2019-02-20 Thread Gao, Liming
Zhichao:
  My comment is to change function name as RuntimeServiceResetSystem. This is 
the similar name in RuntimeServiceSetVariable of Variable driver. I don't 
suggest to use Efi as function prefix. 

Thanks
Liming
> -Original Message-
> From: Gao, Zhichao
> Sent: Wednesday, February 20, 2019 4:39 PM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ray ; Gao, Liming 
> Subject: [PATCH v3 1/6] MdeModulePkg: change the function name ResetSystem
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1460
> 
> Change the function name form ResetSystem to EfiRuntimeResetSystem.
> Because ResetSystem and EfiResetSystem would be used in ResetSystemLib
> and RuntimeLib.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhichao Gao 
> Cc: Ray Ni 
> Cc: Liming Gao 
> ---
>  MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c | 8 
>  MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.h | 4 ++--
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c
> b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c
> index afc35587fc..e16b0cda7b 100644
> --- a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c
> +++ b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c
> @@ -1,7 +1,7 @@
>  /** @file
>Reset Architectural and Reset Notification protocols implementation.
> 
> -  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> +  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
> 
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD 
> License
> @@ -187,7 +187,7 @@ InitializeResetSystem (
>//
>// Hook the runtime service table
>//
> -  gRT->ResetSystem = ResetSystem;
> +  gRT->ResetSystem = EfiRuntimeResetSystem;
> 
>//
>// Now install the Reset RT AP on a new handle
> @@ -242,7 +242,7 @@ DoS3 (
>  **/
>  VOID
>  EFIAPI
> -ResetSystem (
> +EfiRuntimeResetSystem (
>IN EFI_RESET_TYPE   ResetType,
>IN EFI_STATUS   ResetStatus,
>IN UINTNDataSize,
> @@ -256,7 +256,7 @@ ResetSystem (
>RESET_NOTIFY_ENTRY  *Entry;
> 
>//
> -  // Only do REPORT_STATUS_CODE() on first call to ResetSystem()
> +  // Only do REPORT_STATUS_CODE() on first call to EfiRuntimeResetSystem()
>//
>if (mResetNotifyDepth == 0) {
>  //
> diff --git a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.h
> b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.h
> index 8529de675c..448e30f079 100644
> --- a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.h
> +++ b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.h
> @@ -1,6 +1,6 @@
>  /** @file
> 
> -  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> +  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
> 
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD 
> License
> @@ -97,7 +97,7 @@ InitializeResetSystem (
>  **/
>  VOID
>  EFIAPI
> -ResetSystem (
> +EfiRuntimeResetSystem (
>IN EFI_RESET_TYPE   ResetType,
>IN EFI_STATUS   ResetStatus,
>IN UINTNDataSize,
> --
> 2.16.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: add array index check for shell delay option

2019-02-20 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: Gao, Zhichao
> Sent: Monday, February 18, 2019 4:28 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming ; Ni, Ray 
> Subject: [PATCH] ShellPkg: add array index check for shell delay option
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1528
> 
> Shell delay option without parameters do not check the
> index of shell parameter argv. Add index check to avoid
> invalid pointer references.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhichao Gao 
> 
> Cc: Liming Gao 
> Cc: Ray Ni 
> ---
>  ShellPkg/Application/Shell/Shell.c | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/ShellPkg/Application/Shell/Shell.c 
> b/ShellPkg/Application/Shell/Shell.c
> index 104f4c8961..ec344137d3 100644
> --- a/ShellPkg/Application/Shell/Shell.c
> +++ b/ShellPkg/Application/Shell/Shell.c
> @@ -1,7 +1,7 @@
>  /** @file
>This is THE shell (application)
> 
> -  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
> +  Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
>(C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.
>Copyright 2015-2018 Dell Technologies.
>This program and the accompanying materials
> @@ -1002,7 +1002,11 @@ ProcessCommandLine(
>   ) == 0) {
>ShellInfoObject.ShellInitSettings.BitUnion.Bits.Delay= TRUE;
>// Check for optional delay value following "-delay"
> -  DelayValueStr = gEfiShellParametersProtocol->Argv[LoopVar + 1];
> +  if ((LoopVar + 1) >= gEfiShellParametersProtocol->Argc) {
> +DelayValueStr = NULL;
> +  } else {
> +DelayValueStr = gEfiShellParametersProtocol->Argv[LoopVar + 1];
> +  }
>if (DelayValueStr != NULL){
>  if (*DelayValueStr == L':') {
>DelayValueStr++;
> --
> 2.16.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] BaseTool/GenC: Fix build error when type is BASE or USER_DEFINED.

2019-02-20 Thread Gao, Liming
Jiewen:
  This change causes NT32 SecMain build failure. For USER_DEFINED and BASE 
type, they only consumes Constructor() from the library instance with BASE 
type. They don't use PEIM or DXE type Constructor(), because they have no 
PeiService pointer or ImageHandle. 

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Jiewen 
> Yao
> Sent: Wednesday, February 20, 2019 7:55 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [PATCH] BaseTool/GenC: Fix build error when type is BASE or 
> USER_DEFINED.
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1544
> 
> 1) The GenC tool does not include the constructor/destructor for
> USER_DEFINED module. It should be included.
> 
> 2) The GenC tool includes the UnloadImage code for BASE module.
> It should NOT be included.
> 
> 3) The GenC tool uses EFI_STATUS and ASSERT_EFI_ERROR for BASE type.
> It should use RETURN_STATUS and ASSERT_RETURN_ERROR.
> 
> 4) The GenC tool miss DebugLib.h for BASE or USER_DEFINED module
> AutoGen.c. Only Base.h is there. It should add Library/DebugLib.h.
> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Yonghong Zhu 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jiewen Yao 
> ---
>  BaseTools/Source/Python/AutoGen/GenC.py | 14 +++---
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/GenC.py 
> b/BaseTools/Source/Python/AutoGen/GenC.py
> index 9700bf8527..c4bba8da17 100644
> --- a/BaseTools/Source/Python/AutoGen/GenC.py
> +++ b/BaseTools/Source/Python/AutoGen/GenC.py
> @@ -684,7 +684,7 @@ ${Function} (
>  gLibraryStructorCall = {
>  SUP_MODULE_BASE  : TemplateString("""${BEGIN}
>Status = ${Function} ();
> -  ASSERT_EFI_ERROR (Status);${END}
> +  ASSERT_RETURN_ERROR (Status);${END}
>  """),
> 
>  'PEI'   : TemplateString("""${BEGIN}
> @@ -714,7 +714,7 @@ ProcessLibrary${Type}List (
>VOID
>)
>  {
> -${BEGIN}  EFI_STATUS  Status;
> +${BEGIN}  RETURN_STATUS  Status;
>  ${FunctionCall}${END}
>  }
>  """),
> @@ -768,7 +768,7 @@ ${FunctionCall}${END}
>  gBasicHeaderFile = "Base.h"
> 
>  gModuleTypeHeaderFile = {
> -SUP_MODULE_BASE  :   [gBasicHeaderFile],
> +SUP_MODULE_BASE  :   [gBasicHeaderFile, 
> "Library/DebugLib.h"],
>  SUP_MODULE_SEC   :   ["PiPei.h", "Library/DebugLib.h"],
>  SUP_MODULE_PEI_CORE  :   ["PiPei.h", "Library/DebugLib.h", 
> "Library/PeiCoreEntryPoint.h"],
>  SUP_MODULE_PEIM  :   ["PiPei.h", "Library/DebugLib.h", 
> "Library/PeimEntryPoint.h"],
> @@ -782,7 +782,7 @@ gModuleTypeHeaderFile = {
>  SUP_MODULE_SMM_CORE  :   ["PiDxe.h", "Library/BaseLib.h", 
> "Library/DebugLib.h", "Library/UefiDriverEntryPoint.h"],
>  SUP_MODULE_MM_STANDALONE :   ["PiMm.h", "Library/BaseLib.h", 
> "Library/DebugLib.h",
> "Library/StandaloneMmDriverEntryPoint.h"],
>  SUP_MODULE_MM_CORE_STANDALONE :  ["PiMm.h", "Library/BaseLib.h", 
> "Library/DebugLib.h",
> "Library/StandaloneMmCoreEntryPoint.h"],
> -SUP_MODULE_USER_DEFINED  :   [gBasicHeaderFile]
> +SUP_MODULE_USER_DEFINED  :   [gBasicHeaderFile, "Library/DebugLib.h"]
>  }
> 
>  ## Autogen internal worker macro to define DynamicEx PCD name includes both 
> the TokenSpaceGuidName
> @@ -1373,7 +1373,7 @@ def CreateLibraryConstructorCode(Info, AutoGenC, 
> AutoGenH):
>  if Info.IsLibrary:
>  AutoGenH.Append("${BEGIN}${FunctionPrototype}${END}", Dict)
>  else:
> -if Info.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]:
> +if Info.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC, 
> SUP_MODULE_USER_DEFINED]:
>  AutoGenC.Append(gLibraryString[SUP_MODULE_BASE].Replace(Dict))
>  elif Info.ModuleType in SUP_MODULE_SET_PEI:
>  AutoGenC.Append(gLibraryString['PEI'].Replace(Dict))
> @@ -1435,7 +1435,7 @@ def CreateLibraryDestructorCode(Info, AutoGenC, 
> AutoGenH):
>  if Info.IsLibrary:
>  AutoGenH.Append("${BEGIN}${FunctionPrototype}${END}", Dict)
>  else:
> -if Info.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]:
> +if Info.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC, 
> SUP_MODULE_USER_DEFINED]:
>  AutoGenC.Append(gLibraryString[SUP_MODULE_BASE].Replace(Dict))
>  el

Re: [edk2] [Patch] BaseTool: Fixed incremental rebuild issue.

2019-02-20 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: Feng, Bob C
> Sent: Wednesday, February 20, 2019 6:09 PM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C ; Gao, Liming 
> Subject: [Patch] BaseTool: Fixed incremental rebuild issue.
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1540
> 
> This issue in introduced by commit
> d943b0c339fe3d35ffdf9f580ccb7a55915c6854
> 
> To convert bytes to string, we need to use bytes.decode()
> instead of using str(bytes)
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> ---
>  BaseTools/Source/Python/AutoGen/GenMake.py| 2 +-
>  BaseTools/Source/Python/Workspace/DscBuildData.py | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py 
> b/BaseTools/Source/Python/AutoGen/GenMake.py
> index 53c5b8577d..641ed8305f 100644
> --- a/BaseTools/Source/Python/AutoGen/GenMake.py
> +++ b/BaseTools/Source/Python/AutoGen/GenMake.py
> @@ -1048,11 +1048,11 @@ cleanlib:
> 
>  if FileContent[0] == 0xff or FileContent[0] == 0xfe:
>  FileContent = FileContent.decode('utf-16')
>  else:
>  try:
> -FileContent = str(FileContent)
> +FileContent = FileContent.decode()
>  except:
>  pass
>  IncludedFileList = gIncludePattern.findall(FileContent)
> 
>  for Inc in IncludedFileList:
> diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
> b/BaseTools/Source/Python/Workspace/DscBuildData.py
> index 1ffefe6e7e..74bc333144 100644
> --- a/BaseTools/Source/Python/Workspace/DscBuildData.py
> +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
> @@ -158,11 +158,11 @@ def GetDependencyList(FileStack, SearchPathList):
>  if FileContent[0] == 0xff or FileContent[0] == 0xfe:
>  FileContent = FileContent.decode('utf-16')
>  IncludedFileList = gIncludePattern.findall(FileContent)
>  else:
>  try:
> -FileContent = str(FileContent)
> +FileContent = FileContent.decode()
>  IncludedFileList = gIncludePattern.findall(FileContent)
>  except:
>  pass
>  IncludedFileList = gIncludePattern.findall(FileContent)
> 
> --
> 2.20.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH V3] BaseTools:BaseTools supports to the driver combination.

2019-02-19 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: Fan, ZhijuX
> Sent: Tuesday, February 19, 2019 6:47 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2][PATCH V3] BaseTools:BaseTools supports to the driver 
> combination.
> 
> BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1520
> 
> To save the image size without the compression, more than
> one drivers can be combined into single one. When more than
> one drivers are combined, their depex will be AND together.
> Below is the example to combine BootManagerPolicyDxe into
> DriverHealthManagerDxe.
> 
> Besides this patch, BaseTools also needs to check the module
> type and make sure all module type are same. Otherwise,
> BaseTools will report the error.
> DRIVER INF has the parameter ENTRY_POINT
> LIBRARY INF has the parameter LIBRARY_CLASS
> 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhiju.Fan 
> ---
>  BaseTools/Source/Python/AutoGen/GenC.py| 32 
> ++
>  .../Source/Python/Workspace/WorkspaceCommon.py |  8 ++
>  2 files changed, 35 insertions(+), 5 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/GenC.py 
> b/BaseTools/Source/Python/AutoGen/GenC.py
> index 9700bf8527..e6fc5cda3c 100644
> --- a/BaseTools/Source/Python/AutoGen/GenC.py
> +++ b/BaseTools/Source/Python/AutoGen/GenC.py
> @@ -1455,10 +1455,25 @@ def CreateLibraryDestructorCode(Info, AutoGenC, 
> AutoGenH):
>  def CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH):
>  if Info.IsLibrary or Info.ModuleType in [SUP_MODULE_USER_DEFINED, 
> SUP_MODULE_SEC]:
>  return
> +ModuleEntryPointList = []
> +for Lib in Info.DependentLibraryList:
> +if len(Lib.ModuleEntryPointList) > 0:
> +if Lib.ModuleType == Info.ModuleType:
> +ModuleEntryPointList = ModuleEntryPointList + 
> Lib.ModuleEntryPointList
> +else:
> +EdkLogger.error(
> +"build",
> +PREBUILD_ERROR,
> +"Driver's ModuleType must be consistent [%s]"%(str(Lib)),
> +File=str(Info.PlatformInfo),
> +ExtraData="consumed by [%s]" % str(Info.MetaFile)
> +)
> +ModuleEntryPointList = ModuleEntryPointList + 
> Info.Module.ModuleEntryPointList
> +
>  #
>  # Module Entry Points
>  #
> -NumEntryPoints = len(Info.Module.ModuleEntryPointList)
> +NumEntryPoints = len(ModuleEntryPointList)
>  if 'PI_SPECIFICATION_VERSION' in Info.Module.Specification:
>  PiSpecVersion = Info.Module.Specification['PI_SPECIFICATION_VERSION']
>  else:
> @@ -1468,7 +1483,7 @@ def CreateModuleEntryPointCode(Info, AutoGenC, 
> AutoGenH):
>  else:
>  UefiSpecVersion = '0x'
>  Dict = {
> -'Function'   :   Info.Module.ModuleEntryPointList,
> +'Function'   :   ModuleEntryPointList,
>  'PiSpecVersion'  :   PiSpecVersion + 'U',
>  'UefiSpecVersion':   UefiSpecVersion + 'U'
>  }
> @@ -1481,7 +1496,7 @@ def CreateModuleEntryPointCode(Info, AutoGenC, 
> AutoGenH):
>AUTOGEN_ERROR,
>'%s must have exactly one entry point' % Info.ModuleType,
>File=str(Info),
> -  ExtraData= ", ".join(Info.Module.ModuleEntryPointList)
> +  ExtraData= ", ".join(ModuleEntryPointList)
>)
>  if Info.ModuleType == SUP_MODULE_PEI_CORE:
>  AutoGenC.Append(gPeiCoreEntryPointString.Replace(Dict))
> @@ -1535,11 +1550,18 @@ def CreateModuleEntryPointCode(Info, AutoGenC, 
> AutoGenH):
>  def CreateModuleUnloadImageCode(Info, AutoGenC, AutoGenH):
>  if Info.IsLibrary or Info.ModuleType in [SUP_MODULE_USER_DEFINED, 
> SUP_MODULE_SEC]:
>  return
> +
> +ModuleUnloadImageList = []
> +for Lib in Info.DependentLibraryList:
> +if len(Lib.ModuleUnloadImageList) > 0:
> +ModuleUnloadImageList = ModuleUnloadImageList + 
> Lib.ModuleUnloadImageList
> +ModuleUnloadImageList = ModuleUnloadImageList + 
> Info.Module.ModuleUnloadImageList
> +
>  #
>  # Unload Image Handlers
>  #
> -NumUnloadImage = len(Info.Module.ModuleUnloadImageList)
> -Dict = {'Count':str(NumUnloadImage) + 'U', 
> 'Function':Info.Module.ModuleUnloadImageList}
> +NumUnloadImage = len(ModuleUnloadImageList)
> +Dict = {'Count':str(NumUnloadImage) + 'U', 
> 'Function':ModuleUnloadImageList}
>  if NumUnloadImage < 2:
>  AutoGenC.Append(gUefiUnloadIm

Re: [edk2] [PATCH 00/10] Fix PEI Core issue during TemporaryRamMigration

2019-02-19 Thread Gao, Liming
Ray:
In PI spec, TEMPORARY_RAM_SUPPORT_PPI is described as an optional PPI 
that is only required for platforms that may have side effects when both 
Temporary RAM and Permanent RAM are enabled. If a platform does not have any 
side effects when both Temporary RAM and Permanent RAM are enabled, and the 
platform is required to disable the use of Temporary RAM, then 
EFI_PEI_TEMPORARY_RAM_DONE should be produced. If a platform does not have any 
side effects when both Temporary RAM and Permanent RAM are enabled, and the 
platform is not required to disable the use of Temporary RAM, then neither 
EFI_PEI_TEMPORARY_RAM_DONE nor EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI should be 
produced.

Now, real platform has no side effect. So, only TempRamDone PPI is 
produced. For emulator platform, is there any side effect when both Temporary 
RAM and Permanent RAM are enabled? 

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ni, Ray
> Sent: Tuesday, February 19, 2019 10:46 AM
> To: Justen, Jordan L ; edk2-devel@lists.01.org
> Cc: Wu, Hao A ; Anthony Perard 
> ; Laszlo Ersek ; Zeng, Star
> 
> Subject: Re: [edk2] [PATCH 00/10] Fix PEI Core issue during 
> TemporaryRamMigration
> 
> Jordan,
> I find many real platforms do not implement the temporary ram migration
> PPI and rely on the PeiCore migration  logic.
> So perhaps TemporaryRamMigration PPI was added to help platform to
> destroy the temporary RAM (CAR in x86 platform).
> But with the introduction of TemporaryRamDone PPI, maybe the
> TemporaryRamMigration PPI can be retired.
> The logic in PeiCore to call TemporaryRamMigration is just for backward
> compatibility.
> If that's true, do you still need to enhance PeiCore?
> 
> For the Emulator case, I already found without TemporaryRamMigration
> the platform can still boot.
> 
> Does OVMF hard-depend on TemporaryRamMigration? Or it can reply on
> the PeiCore migration logic + TemporaryDone PPI?
> 
> Thanks,
> Ray
> 
> > -Original Message-
> > From: Justen, Jordan L 
> > Sent: Monday, February 18, 2019 12:12 PM
> > To: edk2-devel@lists.01.org
> > Cc: Justen, Jordan L ; Liu Yu
> > ; Andrew Fish ; Anthony
> > Perard ; Ard Biesheuvel
> > ; Wu, Hao A ; Wang, Jian
> > J ; Julien Grall ; Laszlo 
> > Ersek
> > ; Ni, Ray ; Zeng, Star
> > 
> > Subject: [PATCH 00/10] Fix PEI Core issue during TemporaryRamMigration
> >
> > https://github.com/jljusten/edk2.git temp-ram-support
> >
> > This series fixes an issue that, while rare, is possible based on the way 
> > the
> > TemporaryRamSupport PPI is defined along with how it is used by the PEI
> > Core.
> >
> > Liu Yu reported a boot issue with EmulatorPkg, which I believe was caused by
> > this issue.
> >
> > The details of the issue are described in the commit message of the
> > "MdeModePkg/Core/Pei: Add code path to allow assembly temp-ram
> > migration" patch.
> >
> > Along with this, I added a few Temporary RAM patches for EmulatorPkg and
> > OvmfPkg.
> >
> > Cc: Liu Yu 
> > Cc: Andrew Fish 
> > Cc: Anthony Perard 
> > Cc: Ard Biesheuvel 
> > Cc: Hao Wu 
> > Cc: Jian J Wang 
> > Cc: Julien Grall 
> > Cc: Laszlo Ersek 
> > Cc: Ray Ni 
> > Cc: Star Zeng 
> >
> > Jordan Justen (10):
> >   EmulatorPkg/build.sh: Fix missing usage of -b BUILDTARGET parameter
> >   EmulatorPkg/Unix/Host: Use PcdInitValueInTempStack to init temp-ram
> >   EmulatorPkg/Sec: Replace assembly temp-ram support with C code
> >   EmulatorPkg/Sec: Disable optimizations for TemporaryRamMigration
> > function
> >   OvmfPkg/Sec: Swap TemporaryRam Stack and Heap locations
> >   OvmfPkg/Sec: Disable optimizations for TemporaryRamMigration
> >   MdeModePkg/Core/Pei: Add code path to allow assembly temp-ram
> > migration
> >   MdeModulePkg/Core/Pei: Use assembly for X64 TemporaryRamMigration
> >   MdeModulePkg/Core/Pei: Use assembly for IA32 TemporaryRamMigration
> >   OvmfPkg/Sec: Fill Temp Ram after TemporaryRamMigration
> >
> >  EmulatorPkg/Sec/Ia32/SwitchRam.S  | 95 ---
> >  EmulatorPkg/Sec/Ia32/SwitchRam.asm| 94 --
> >  EmulatorPkg/Sec/Ia32/TempRam.c| 65 -
> >  EmulatorPkg/Sec/Sec.c | 76 ++-
> >  EmulatorPkg/Sec/Sec.inf   | 13 +--
> >  EmulatorPkg/Sec/X64/SwitchRam.S   | 72 --
> >  EmulatorPkg/Sec/X64/SwitchRam.asm | 76 ---
> >  EmulatorPkg/Unix/Host/Host.c  |  2 +-
> >  EmulatorPkg/Unix/Host/Host.inf|  1 +
> >  EmulatorPkg/build.sh  | 10 +-
> >  MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 59 
> >  .../Dispatcher/Ia32/TemporaryRamMigration.S   | 72 ++
> >  .../Ia32/TemporaryRamMigration.nasm   | 78 +++
> >  .../Pei/Dispatcher/TemporaryRamMigration.c| 52 ++
> >  .../Dispatcher/X64/TemporaryRamMigration.S| 69 

Re: [edk2] [PATCH v2 0/2] Add sanity check for FilePath device path

2019-02-19 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Jian
>J Wang
>Sent: Tuesday, February 19, 2019 5:22 PM
>To: edk2-devel@lists.01.org
>Subject: [edk2] [PATCH v2 0/2] Add sanity check for FilePath device path
>
>> v2: fix wrong detection of FilePath device path
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1497
>
>Tests
>- Pass specific DevicePathLib test cases
>- Boot shell
>- Boot to Fedora 26 (Qemu/x64)
>- Boot to Ubuntu 18.04 (Qemu/x64)
>- Boot to Windows 10 (Qemu/x64)
>- Boot to Windows 7 (Qemu/x64)
>
>Jian J Wang (2):
>  MdePkg/UefiDevicePathLib: Add sanity check for FilePath device path
>  MdePkg/UefiDevicePathLibDevicePathProtocol: Add sanity check for
>FilePath device path
>
> MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c   | 9 +
> .../UefiDevicePathLib.c  | 9 +
> 2 files changed, 18 insertions(+)
>
>--
>2.17.1.windows.2
>
>___
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] BaseTools: Fixed a code bug for Pcd Array.

2019-02-19 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Feng, Bob C
>Sent: Saturday, February 16, 2019 1:54 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming 
>Subject: [edk2] [Patch] BaseTools: Fixed a code bug for Pcd Array.
>
>For example, PCD gUefiOvmfPkgTokenSpaceGuid.Test001 datatype is Array:
>TEST1[2]
>and the filed TEST1UINT64ARRAY in TEST1 is also an array:
>UINT64 TEST1UINT64ARRAY[2];
>
>Then the following filed assignment in DSC will cause build failure.
>gUefiOvmfPkgTokenSpaceGuid.Test001[0].TEST1UINT64ARRAY|{'A','B'}
>
>The root cause is build tool generate incorrect PcdValueInit.c File.
>
>This patch is going to fix this issue.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Bob Feng 
>Cc: Liming Gao 
>---
> BaseTools/Source/Python/Workspace/DscBuildData.py | 12 +---
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
>diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
>b/BaseTools/Source/Python/Workspace/DscBuildData.py
>index 1fd1639ab6..e45beb3924 100644
>--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
>+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
>@@ -2015,14 +2015,13 @@ class DscBuildData(PlatformBuildClassObject):
> indicator = self.GetIndicator(index, FieldName,Pcd)
> if IsArray:
> #
> # Use memcpy() to copy value into field
> #
>-CApp = CApp + '  FieldSize = __FIELD_SIZE(%s, %s);\n' %
>(Pcd.DatumType, FieldName)
>+CApp = CApp + '  FieldSize = __FIELD_SIZE(%s, %s);\n' %
>(Pcd.BaseDatumType, FieldName)
> CApp = CApp + '  Value = %s; // From %s Line %d Value 
> %s\n' %
>(DscBuildData.IntToCString(Value, ValueSize), FieldList[FieldName][1],
>FieldList[FieldName][2], FieldList[FieldName][0])
>-CApp = CApp + '  __STATIC_ASSERT((__FIELD_SIZE(%s, %s) >= 
>%d)
>|| (__FIELD_SIZE(%s, %s) == 0), "Input buffer exceeds the buffer array"); //
>From %s Line %d Value %s\n' % (Pcd.DatumType, FieldName, ValueSize,
>Pcd.DatumType, FieldName, FieldList[FieldName][1], FieldList[FieldName][2],
>FieldList[FieldName][0])
>-CApp = CApp + '  memcpy (>%s, Value, (FieldSize > 0 
>&&
>FieldSize < %d) ? FieldSize : %d);\n' % (FieldName, ValueSize, ValueSize)
>+CApp = CApp + '  __STATIC_ASSERT((__FIELD_SIZE(%s, %s) >= 
>%d)
>|| (__FIELD_SIZE(%s, %s) == 0), "Input buffer exceeds the buffer array"); //
>From %s Line %d Value %s\n' % (Pcd.BaseDatumType, FieldName, ValueSize,
>Pcd.BaseDatumType, FieldName, FieldList[FieldName][1],
>FieldList[FieldName][2], FieldList[FieldName][0])
> CApp = CApp + '  memcpy (&%s, Value, (FieldSize > 0 && 
> FieldSize
>< %d) ? FieldSize : %d);\n' % (indicator, ValueSize, ValueSize)
> elif isinstance(Value, str):
> CApp = CApp + '  %s = %s; // From %s Line %d Value %s\n' %
>(indicator, Value, FieldList[FieldName][1], FieldList[FieldName][2],
>FieldList[FieldName][0])
> else:
> if '[' in FieldName and ']' in FieldName:
>@@ -2130,12 +2129,11 @@ class DscBuildData(PlatformBuildClassObject):
> #
> # Use memcpy() to copy value into field
> #
> CApp = CApp + '  FieldSize = __FIELD_SIZE(%s, %s);\n' 
> %
>(Pcd.BaseDatumType, FieldName)
> CApp = CApp + '  Value = %s; // From %s Line %d 
> Value %s\n' %
>(DscBuildData.IntToCString(Value, ValueSize), FieldList[FieldName][1],
>FieldList[FieldName][2], FieldList[FieldName][0])
>-CApp = CApp + '  __STATIC_ASSERT((__FIELD_SIZE(%s, 
>%s) >= %d)
>|| (__FIELD_SIZE(%s, %s) == 0), "Input buffer exceeds the buffer array"); //
>From %s Line %d Value %s\n' % (Pcd.DatumType, FieldName, ValueSize,
>Pcd.DatumType, FieldName, FieldList[FieldName][1], FieldList[FieldName][2],
>FieldList[FieldName][0])
>-CApp = CApp + '  memcpy (>%s, Value, (FieldSize 
>> 0 &&
>FieldSize < %d) ? FieldSize : %d);\n' % (FieldName, ValueSize, ValueSize)
>+CApp = CApp + '
>__STATIC_ASSERT((__FIELD_SIZE(%s, %s) >= %d) || (__FIELD_SIZE(%s, %s)
>== 0), "Input buffer exceeds the buffer array"); // From %s Line %d
>Value %s\n' % (Pcd.BaseDatumType, FieldName, ValueSize,
>Pcd.BaseDatumType, FieldName, FieldList[FieldName][1],
>FieldList[FieldName][2], FieldList[FieldName][0])
>  

Re: [edk2] [Patch] BaseTools: Add MaxSizeUserSet to Pcd deepcopy function

2019-02-19 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: Feng, Bob C
>Sent: Saturday, February 16, 2019 10:55 PM
>To: edk2-devel@lists.01.org
>Cc: Feng, Bob C ; Gao, Liming 
>Subject: [Patch] BaseTools: Add MaxSizeUserSet to Pcd deepcopy function
>
>MaxSizeUserSet is missing in Pcd deepcopy function.
>This patch is to add it back to Pcd deepcopy function.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Bob Feng 
>Cc: Liming Gao 
>---
> BaseTools/Source/Python/Workspace/BuildClassObject.py | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py
>b/BaseTools/Source/Python/Workspace/BuildClassObject.py
>index 1df042f41c..d7ca9e8cf1 100644
>--- a/BaseTools/Source/Python/Workspace/BuildClassObject.py
>+++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py
>@@ -220,10 +220,11 @@ class PcdClassObject(object):
> new_pcd.Type = self.Type
> new_pcd.DatumType = self.DatumType
> new_pcd.DefaultValue = self.DefaultValue
> new_pcd.TokenValue = self.TokenValue
> new_pcd.MaxDatumSize = self.MaxDatumSize
>+new_pcd.MaxSizeUserSet = self.MaxSizeUserSet
>
> new_pcd.Phase = self.Phase
> new_pcd.Pending = self.Pending
> new_pcd.IsOverrided = self.IsOverrided
> new_pcd.IsFromBinaryInf = self.IsFromBinaryInf
>--
>2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


  1   2   3   4   5   6   7   8   9   10   >