Re: [edk2-devel] [PATCH] BaseTools:Updata the Judgment Method of "--exclude"

2019-06-27 Thread Liming Gao
Zhiju:
  Please keep original behavior on --exclude for the directory name or file 
name. 

> -Original Message-
> From: Fan, ZhijuX
> Sent: Thursday, June 27, 2019 10:55 AM
> To: devel@edk2.groups.io
> Cc: Gao, Liming ; Feng, Bob C 
> Subject: [PATCH] BaseTools:Updata the Judgment Method of "--exclude"
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1944
> 
> --exclude cannot be used under certain circumstances
> 1.The value of the parameter USES an absolute path
> 2.The value of Exclude parameters is based on the value
>   of the Path parameter
> Neither of these approaches currently works
> 
> This patch is going to fix that issue.
> 
> Cc: Liming Gao 
> Cc: Bob Feng 
> Signed-off-by: Zhiju.Fan 
> ---
>  BaseTools/Scripts/FormatDosFiles.py | 18 +++---
>  1 file changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/BaseTools/Scripts/FormatDosFiles.py 
> b/BaseTools/Scripts/FormatDosFiles.py
> index d9a880f299..7a5af209f2 100644
> --- a/BaseTools/Scripts/FormatDosFiles.py
> +++ b/BaseTools/Scripts/FormatDosFiles.py
> @@ -20,7 +20,7 @@ import copy
> 
>  __prog__= 'FormatDosFiles'
>  __version__ = '%s Version %s' % (__prog__, '0.10 ')
> -__copyright__   = 'Copyright (c) 2018, Intel Corporation. All rights 
> reserved.'
> +__copyright__   = 'Copyright (c) 2019, Intel Corporation. All rights 
> reserved.'
>  __description__ = 'Convert source files to meet the EDKII C Coding Standards 
> Specification.\n'
>  DEFAULT_EXT_LIST = ['.h', '.c', '.nasm', '.nasmb', '.asm', '.S', '.inf', 
> '.dec', '.dsc', '.fdf', '.uni', '.asl', '.aslc', '.vfr', '.idf', '.txt', 
> '.bat', '.py']
> 
> @@ -46,10 +46,22 @@ def FormatFile(FilePath, Args):
>  def FormatFilesInDir(DirPath, ExtList, Args):
> 
>  FileList = []
> +ExcludeDir = DirPath
>  for DirPath, DirNames, FileNames in os.walk(DirPath):
>  if Args.Exclude:
> -DirNames[:] = [d for d in DirNames if d not in Args.Exclude]
> -FileNames[:] = [f for f in FileNames if f not in Args.Exclude]
> +Continue = False
> +for Path in Args.Exclude:
> +if not os.path.isdir(Path) and not os.path.isfile(Path):
> +Path = os.path.join(ExcludeDir, Path)
> +if os.path.isdir(Path) and Path.endswith(DirPath):
> +Continue = True
> +elif os.path.isfile(Path):
> +for ItemPath in FileNames[:]:
> +FilePath = os.path.join(DirPath, ItemPath)
> +if Path.endswith(FilePath):
> +FileNames.remove(ItemPath)
> +if Continue:
> +continue
>  for FileName in [f for f in FileNames if any(f.endswith(ext) for ext 
> in ExtList)]:
>  FileList.append(os.path.join(DirPath, FileName))
>  for File in FileList:
> --
> 2.14.1.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42922): https://edk2.groups.io/g/devel/message/42922
Mute This Topic: https://groups.io/mt/32227595/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH] Fix indentation in edksetup.sh SetupPython3

2019-06-27 Thread Liming Gao
So, this is just indentation update. There is no functionality impact. What 
test have you done?

Thanks
Liming
> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of 
> rebe...@bluestop.org
> Sent: Thursday, June 27, 2019 12:55 AM
> To: devel@edk2.groups.io; Feng, Bob C ; Gao, Liming 
> ; Fan, ZhijuX 
> Cc: Rebecca Cran 
> Subject: [edk2-devel] [PATCH] Fix indentation in edksetup.sh SetupPython3
> 
> Signed-off-by: Rebecca Cran 
> ---
>  edksetup.sh | 40 
>  1 file changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/edksetup.sh b/edksetup.sh
> index c7b2e1e201..61e988035f 100755
> --- a/edksetup.sh
> +++ b/edksetup.sh
> @@ -108,27 +108,27 @@ function SetupEnv()
>  function SetupPython3()
>  {
>if [ $origin_version ];then
> -  origin_version=
> +origin_version=
> +  fi
> +  for python in $(whereis python3)
> +  do
> +python=$(echo $python | grep "[[:digit:]]$" || true)
> +python_version=${python##*python}
> +if [ -z "${python_version}" ] || (! command -v $python >/dev/null 
> 2>&1);then
> +  continue
>  fi
> -for python in $(whereis python3)
> -do
> -  python=$(echo $python | grep "[[:digit:]]$" || true)
> -  python_version=${python##*python}
> -  if [ -z "${python_version}" ] || (! command -v $python >/dev/null 
> 2>&1);then
> -continue
> -  fi
> -  if [ -z $origin_version ];then
> -origin_version=$python_version
> -export PYTHON_COMMAND=$python
> -continue
> -  fi
> -  ret=`echo "$origin_version < $python_version" |bc`
> -  if [ "$ret" -eq 1 ]; then
> -origin_version=$python_version
> -export PYTHON_COMMAND=$python
> -  fi
> -done
> -return 0
> +if [ -z $origin_version ];then
> +  origin_version=$python_version
> +  export PYTHON_COMMAND=$python
> +  continue
> +fi
> +ret=`echo "$origin_version < $python_version" |bc`
> +if [ "$ret" -eq 1 ]; then
> +  origin_version=$python_version
> +  export PYTHON_COMMAND=$python
> +fi
> +  done
> +  return 0
>  }
> 
>  function SetupPython()
> --
> 2.22.0
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> 
> View/Reply Online (#42903): https://edk2.groups.io/g/devel/message/42903
> Mute This Topic: https://groups.io/mt/32217032/1759384
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub  [liming@intel.com]
> -=-=-=-=-=-=


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42923): https://edk2.groups.io/g/devel/message/42923
Mute This Topic: https://groups.io/mt/32217032/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v4 0/2] MdeModulePkg/SdMmcHcDxe: Implement revision 3 of SdMmcOverrideProtocol

2019-06-27 Thread Ard Biesheuvel
(+ Sumit)

On Thu, 27 Jun 2019 at 08:29, Wu, Hao A  wrote:
>
> > -Original Message-
> > From: Marcin Wojtas [mailto:m...@semihalf.com]
> > Sent: Thursday, June 27, 2019 2:25 PM
> > To: Albecki, Mateusz
> > Cc: edk2-devel-groups-io; Wu, Hao A
> > Subject: Re: [edk2-devel] [PATCH v4 0/2] MdeModulePkg/SdMmcHcDxe:
> > Implement revision 3 of SdMmcOverrideProtocol
> >
> > Hi Mateusz,
> >
> > Can you please push those patches somewhere (github?) so that I can
> > easily do a quick check for regression?
> >
> > Thanks,
> > Marcin
>
>
> Hello Marcin,
>
> I have just pushed the series at:
> https://github.com/hwu25/edk2/tree/sdmmc_override_extend_v4
>
> Please help to check.
>

I have cc'ed my colleague Sumit, who has kindly agreed to regression
test this branch on Socionext SynQuacer, which also uses the SD/MMC
override infrastructure.

Sumit, please reply here with your results. And thanks again!

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42924): https://edk2.groups.io/g/devel/message/42924
Mute This Topic: https://groups.io/mt/32214570/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [RFC][PATCH 0/1] Drop the SourceForge SVN mirror

2019-06-27 Thread Leif Lindholm
On Thu, Jun 27, 2019 at 01:50:43PM +0800, Hao A Wu wrote:
> The patch proposes to:
> 
> A. Remove the information on the SourceForge SVN mirror repository from
>the Maintainers.txt file.
> B. Stop the sync of the SourceForge SVN mirror from the upstream Github
>Git repository. (At this moment, the SVN mirror is still syncing the
>latest changes)
> 
> Cc: Liming Gao 
> Cc: Andrew Fish 
> Cc: Laszlo Ersek 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 

>From my point of view, a strong:
Reviewed-by: Leif Lindholm 

But please wait for additional feedback before pushing.

> Hao A Wu (1):
>   Maintainers.txt: Drop deprecated SourceForge SVN link
> 
>  Maintainers.txt | 1 -
>  1 file changed, 1 deletion(-)
> 
> -- 
> 2.12.0.windows.1
> 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42925): https://edk2.groups.io/g/devel/message/42925
Mute This Topic: https://groups.io/mt/32228628/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [patch 0/2] Edk2Setup: Enahnce edk2setup batch files

2019-06-27 Thread Liming Gao
Dandan:
  One minor comment. Help message shows two ForceRebuild options. Please remove 
one. And, this change retire --nt32 option. Please update wiki page on edksetup 
usage in 
https://github.com/tianocore/tianocore.github.io/wiki/Getting-Started-Writing-Simple-Application.
 With those change, Reviewed-by: Liming Gao 

Reconfig   Reinstall target.txt, tools_def.txt and build_rule.txt.
RebuildPerform incremental rebuild of BaseTools binaries.
ForceRebuild   Force a full rebuild of BaseTools binaries.
ForceRebuild   Force a full rebuild of BaseTools binaries.

Thanks
Liming
> -Original Message-
> From: Bi, Dandan
> Sent: Sunday, June 23, 2019 9:59 PM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C ; Gao, Liming 
> Subject: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1693
> 
> Patch 1 remove nt32 related flags in bat files.
> Patch 2 setup for different VS tool chains.
> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Dandan Bi (2):
>   Edk2: Remove nt32 related flag in bat files
>   Edk2Setup: Support different VS tool chain setup
> 
>  BaseTools/get_vsvars.bat| 42 +
>  BaseTools/set_vsprefix_envs.bat | 47 +---
>  BaseTools/toolsetup.bat | 68 
> ++---
>  edksetup.bat| 32 ++-
>  4 files changed, 145 insertions(+), 44 deletions(-)
> 
> --
> 1.9.5.msysgit.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42926): https://edk2.groups.io/g/devel/message/42926
Mute This Topic: https://groups.io/mt/32177263/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH] MdeModulePkg SmbiosMeasurementDxe: Add Type4 Voltage field to blacklist

2019-06-27 Thread Zeng, Star
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1922

The Type4 Voltage field may be various.
So this patch adds it into the blacklist.

Signed-off-by: Star Zeng 
Cc: Jian J Wang 
Cc: Hao A Wu 
Cc: Ray Ni 
Cc: Donald Kuo 
Cc: Chasel Chiu 
---
 .../Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c| 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c 
b/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c
index 229d4c5f2c5c..7b5d4731466d 100644
--- a/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c
+++ b/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c
@@ -64,6 +64,7 @@ SMBIOS_FILTER_TABLE  mSmbiosFilterType4BlackList[] = {
   {0x04, OFFSET_OF(SMBIOS_TABLE_TYPE4, CoreCount2),   
FIELD_SIZE_OF(SMBIOS_TABLE_TYPE4, CoreCount2),   0},
   {0x04, OFFSET_OF(SMBIOS_TABLE_TYPE4, EnabledCoreCount2),
FIELD_SIZE_OF(SMBIOS_TABLE_TYPE4, EnabledCoreCount2),0},
   {0x04, OFFSET_OF(SMBIOS_TABLE_TYPE4, ThreadCount2), 
FIELD_SIZE_OF(SMBIOS_TABLE_TYPE4, ThreadCount2), 0},
+  {0x04, OFFSET_OF(SMBIOS_TABLE_TYPE4, Voltage),  
FIELD_SIZE_OF(SMBIOS_TABLE_TYPE4, Voltage),  0},
 };
 SMBIOS_FILTER_TABLE  mSmbiosFilterType17BlackList[] = {
   {0x11, OFFSET_OF(SMBIOS_TABLE_TYPE17, SerialNumber),
FIELD_SIZE_OF(SMBIOS_TABLE_TYPE17, SerialNumber),
SMBIOS_FILTER_TABLE_FLAG_IS_STRING},
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42927): https://edk2.groups.io/g/devel/message/42927
Mute This Topic: https://groups.io/mt/32229980/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [patch 0/2] Edk2Setup: Enahnce edk2setup batch files

2019-06-27 Thread Bob Feng
The patches look good.

I think removing --nt32 option is incompatible change. What about keep the 
--nt32 ?

For the Patch 2 setup for different VS tool chains.
Reviewed-by: Bob Feng 

Thanks,
Bob

-Original Message-
From: Bi, Dandan 
Sent: Sunday, June 23, 2019 9:59 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming 
Subject: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1693

Patch 1 remove nt32 related flags in bat files.
Patch 2 setup for different VS tool chains.

Cc: Bob Feng 
Cc: Liming Gao 
Dandan Bi (2):
  Edk2: Remove nt32 related flag in bat files
  Edk2Setup: Support different VS tool chain setup

 BaseTools/get_vsvars.bat| 42 +
 BaseTools/set_vsprefix_envs.bat | 47 +---
 BaseTools/toolsetup.bat | 68 ++---
 edksetup.bat| 32 ++-
 4 files changed, 145 insertions(+), 44 deletions(-)

-- 
1.9.5.msysgit.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42928): https://edk2.groups.io/g/devel/message/42928
Mute This Topic: https://groups.io/mt/32177263/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [RFC][PATCH 1/1] Maintainers.txt: Drop deprecated SourceForge SVN link

2019-06-27 Thread Laszlo Ersek
+Jordan

On 06/27/19 07:50, Hao A Wu wrote:
> The commit will remove the deprecated edk2 SVN mirror at:
> https://svn.code.sf.net/p/edk2/code/trunk/edk2
> 
> After this commit, the above minnor will not be synced with the changes

(1) s/minnor/mirror/

> made in the GitHub upstream.
> 
> Cc: Liming Gao 
> Cc: Andrew Fish 
> Cc: Laszlo Ersek 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> Signed-off-by: Hao A Wu 
> ---
>  Maintainers.txt | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index e52f044bec..e4eb37d641 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -43,7 +43,6 @@ W: http://www.tianocore.org/edk2/
>  L: https://edk2.groups.io/g/devel/
>  T: git - https://github.com/tianocore/edk2.git
>  T: git (mirror) - https://bitbucket.org/tianocore/edk2.git
> -T: svn (read-only, deprecated) - 
> https://svn.code.sf.net/p/edk2/code/trunk/edk2
>  
>  Tianocore Stewards
>  --
> 

Reviewed-by: Laszlo Ersek 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42929): https://edk2.groups.io/g/devel/message/42929
Mute This Topic: https://groups.io/mt/32228630/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH] Fix indentation in edksetup.sh SetupPython3

2019-06-27 Thread rebecca
On 2019-06-27 01:37, Gao, Liming wrote:
> So, this is just indentation update. There is no functionality impact. What 
> test have you done?


Yes, it's just whitespace changes. I haven't done any tests, since
whitespace doesn't affect functionality.

Running "git diff -w" confirms there are no functionality changes.


-- 
Rebecca Cran


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42930): https://edk2.groups.io/g/devel/message/42930
Mute This Topic: https://groups.io/mt/32217032/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH edk2-platforms 1/2] Platform/ARM: Juno: Fix usage of deprecated macros

2019-06-27 Thread Sami Mujawar
Replaced the use of unsafe/deprecated macros with alternate safe
options.

Signed-off-by: Sami Mujawar 
---

Notes:
v1:
- Replace unsafe/deprecated macros with alternate safe options.   [SAMI]

 Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c 
b/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
index 
c5967f5b7112fbf794573a6040711a9f1cc14c9f..ea7591d704439cd4216f3e3d7155df2b4d2482b3
 100644
--- a/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
+++ b/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2013-2017, ARM Limited. All rights reserved.
+*  Copyright (c) 2013-2019, ARM Limited. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -407,7 +407,6 @@ ArmJunoEntryPoint (
   EFI_PHYSICAL_ADDRESS  HypBase;
   CHAR16*TextDevicePath;
   UINTN TextDevicePathSize;
-  VOID  *Buffer;
   UINT32JunoRevision;
   EFI_EVENT EndOfDxeEvent;
 
@@ -495,7 +494,7 @@ ArmJunoEntryPoint (
   //
   if (JunoRevision != JUNO_REVISION_R0) {
 // Enable PCI enumeration
-PcdSetBool (PcdPciDisableBusEnumeration, FALSE);
+PcdSetBoolS (PcdPciDisableBusEnumeration, FALSE);
 
 //
 // Create an event belonging to the "gEfiEndOfDxeEventGroupGuid" group.
@@ -531,8 +530,11 @@ ArmJunoEntryPoint (
   TextDevicePath = (CHAR16*)FixedPcdGetPtr (PcdJunoFdtDevicePath);
   if (TextDevicePath != NULL) {
 TextDevicePathSize = StrSize (TextDevicePath);
-Buffer = PcdSetPtr (PcdFdtDevicePaths, &TextDevicePathSize, 
TextDevicePath);
-Status = (Buffer != NULL) ? EFI_SUCCESS : EFI_BUFFER_TOO_SMALL;
+Status = PcdSetPtrS (
+   PcdFdtDevicePaths,
+   &TextDevicePathSize,
+   TextDevicePath
+   );
   } else {
 Status = EFI_NOT_FOUND;
   }
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42932): https://edk2.groups.io/g/devel/message/42932
Mute This Topic: https://groups.io/mt/32230897/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH edk2-platforms 2/2] Platform/ARM: Disable deprecated APIs

2019-06-27 Thread Sami Mujawar
Add DISABLE_NEW_DEPRECATED_INTERFACES macro to the Arm platform
build flags to disable the use of deprecated APIs.

Signed-off-by: Sami Mujawar 
---

Notes:
v1:
- Disable the use of deprecated APIs for Arm Platforms.   [SAMI]

 Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc 
b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
index 
13f5c6c1e7493a72354744ca37721b4a682f6b50..0d543d2a61b15c9c7dcd9212b81a4594c3bd38f0
 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2011-2018, ARM Limited. All rights reserved.
+#  Copyright (c) 2011-2019, ARM Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -17,6 +17,9 @@ [Defines]
   DEFINE NETWORK_TLS_ENABLE = FALSE
   DEFINE NETWORK_HTTP_BOOT_ENABLE   = FALSE
 
+[BuildOptions.common]
+  *_*_*_CC_FLAGS = -DDISABLE_NEW_DEPRECATED_INTERFACES
+
 
[BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICATION]
   GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
 
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42933): https://edk2.groups.io/g/devel/message/42933
Mute This Topic: https://groups.io/mt/32230898/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH edk2-platforms 0/2] Platform/ARM: Disable deprecated APIs for Arm Platforms

2019-06-27 Thread Sami Mujawar
edk2 implements the DISABLE_NEW_DEPRECATED_INTERFACES macro that prevents the
usage of unsafe/deprecated APIs/macros by reporting errors at build time.

This patch series:
 - defines DISABLE_NEW_DEPRECATED_INTERFACES macro as part of the build
   options for Arm platforms so that the unsafe/deprecated APIs/macros
   are not used.
 - fixes the usage of unsafe/deprecated APIs/macros in the Juno platform
   code.

The changes can be seen at
https://github.com/samimujawar/edk2-platforms/tree/580_disable_deprecated_interfaces_v1

Sami Mujawar (2):
  Platform/ARM: Juno: Fix usage of deprecated macros
  Platform/ARM: Disable deprecated APIs

 Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c | 12 +++-
 Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc |  5 -
 2 files changed, 11 insertions(+), 6 deletions(-)

-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42931): https://edk2.groups.io/g/devel/message/42931
Mute This Topic: https://groups.io/mt/32230896/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH edk2-platforms 1/2] Platform/ARM: Juno: Fix usage of deprecated macros

2019-06-27 Thread Alexei Fedorov
Reviewed-by: Alexei Fedorov 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42935): https://edk2.groups.io/g/devel/message/42935
Mute This Topic: https://groups.io/mt/32230897/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH edk2-platforms 2/2] Platform/ARM: Disable deprecated APIs

2019-06-27 Thread Alexei Fedorov
Reviewed-by: Alexei Fedorov 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42934): https://edk2.groups.io/g/devel/message/42934
Mute This Topic: https://groups.io/mt/32230898/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH edk2-platforms 0/2] Platform/ARM: Disable deprecated APIs for Arm Platforms

2019-06-27 Thread Alexei Fedorov
Reviewed-by: Alexei Fedorov 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42936): https://edk2.groups.io/g/devel/message/42936
Mute This Topic: https://groups.io/mt/32230896/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v4 0/2] MdeModulePkg/SdMmcHcDxe: Implement revision 3 of SdMmcOverrideProtocol

2019-06-27 Thread Sumit Garg
On Thu, 27 Jun 2019 at 13:40, Ard Biesheuvel  wrote:
>
> (+ Sumit)
>
> On Thu, 27 Jun 2019 at 08:29, Wu, Hao A  wrote:
> >
> > > -Original Message-
> > > From: Marcin Wojtas [mailto:m...@semihalf.com]
> > > Sent: Thursday, June 27, 2019 2:25 PM
> > > To: Albecki, Mateusz
> > > Cc: edk2-devel-groups-io; Wu, Hao A
> > > Subject: Re: [edk2-devel] [PATCH v4 0/2] MdeModulePkg/SdMmcHcDxe:
> > > Implement revision 3 of SdMmcOverrideProtocol
> > >
> > > Hi Mateusz,
> > >
> > > Can you please push those patches somewhere (github?) so that I can
> > > easily do a quick check for regression?
> > >
> > > Thanks,
> > > Marcin
> >
> >
> > Hello Marcin,
> >
> > I have just pushed the series at:
> > https://github.com/hwu25/edk2/tree/sdmmc_override_extend_v4
> >
> > Please help to check.
> >
>
> I have cc'ed my colleague Sumit, who has kindly agreed to regression
> test this branch on Socionext SynQuacer, which also uses the SD/MMC
> override infrastructure.
>
> Sumit, please reply here with your results. And thanks again!

I did picked this patch-set and applied on top of edk2 master branch.
It works well on SynQuacer with eMMC device enumerated properly and
all three eMMC partitions are visible:

 BLK4: Alias(s):
  VenHw(0D51905B-B77E-452A-A2C0-ECA0CC8D514A,305200)/eMMC(0x
0)/Ctrl(0x0)
 BLK5: Alias(s):
  VenHw(0D51905B-B77E-452A-A2C0-ECA0CC8D514A,305200)/eMMC(0x
0)/Ctrl(0x1)
 BLK6: Alias(s):
  VenHw(0D51905B-B77E-452A-A2C0-ECA0CC8D514A,305200)/eMMC(0x
0)/Ctrl(0x2)

Shell> devices

  E9 D - -  1  1   0 VenHw(0D51905B-B77E-452A-A2C0-ECA0CC8D514A,3052
00)/eMMC(0x0)/Ctrl(0x0)
  EA D - -  1  1   0 VenHw(0D51905B-B77E-452A-A2C0-ECA0CC8D514A,3052
00)/eMMC(0x0)/Ctrl(0x1)
  EB D - -  1  1   0 VenHw(0D51905B-B77E-452A-A2C0-ECA0CC8D514A,3052
00)/eMMC(0x0)/Ctrl(0x2)

So you can add following:

Regression-tested-by: Sumit Garg 

-Sumit

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42937): https://edk2.groups.io/g/devel/message/42937
Mute This Topic: https://groups.io/mt/32214570/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [patch 0/2] Edk2Setup: Enahnce edk2setup batch files

2019-06-27 Thread Liming Gao
Bob:
  --nt32 option is added for Nt32Pkg. Now, Nt32Pkg has been removed. So, I 
think it is fine to remove --nt32 option. 

> -Original Message-
> From: Feng, Bob C
> Sent: Thursday, June 27, 2019 7:56 PM
> To: Bi, Dandan ; devel@edk2.groups.io
> Cc: Gao, Liming 
> Subject: RE: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
> 
> The patches look good.
> 
> I think removing --nt32 option is incompatible change. What about keep the 
> --nt32 ?
> 
> For the Patch 2 setup for different VS tool chains.
> Reviewed-by: Bob Feng 
> 
> Thanks,
> Bob
> 
> -Original Message-
> From: Bi, Dandan
> Sent: Sunday, June 23, 2019 9:59 PM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C ; Gao, Liming 
> Subject: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1693
> 
> Patch 1 remove nt32 related flags in bat files.
> Patch 2 setup for different VS tool chains.
> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Dandan Bi (2):
>   Edk2: Remove nt32 related flag in bat files
>   Edk2Setup: Support different VS tool chain setup
> 
>  BaseTools/get_vsvars.bat| 42 +
>  BaseTools/set_vsprefix_envs.bat | 47 +---
>  BaseTools/toolsetup.bat | 68 
> ++---
>  edksetup.bat| 32 ++-
>  4 files changed, 145 insertions(+), 44 deletions(-)
> 
> --
> 1.9.5.msysgit.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42938): https://edk2.groups.io/g/devel/message/42938
Mute This Topic: https://groups.io/mt/32177263/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [patch 0/2] Edk2Setup: Enahnce edk2setup batch files

2019-06-27 Thread Bob Feng
OK.  I think it may break some pre-build script if the pre-build script have 
"edksetup --nt32"...

-Original Message-
From: Gao, Liming 
Sent: Thursday, June 27, 2019 10:48 PM
To: Feng, Bob C ; Bi, Dandan ; 
devel@edk2.groups.io
Subject: RE: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files

Bob:
  --nt32 option is added for Nt32Pkg. Now, Nt32Pkg has been removed. So, I 
think it is fine to remove --nt32 option. 

> -Original Message-
> From: Feng, Bob C
> Sent: Thursday, June 27, 2019 7:56 PM
> To: Bi, Dandan ; devel@edk2.groups.io
> Cc: Gao, Liming 
> Subject: RE: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
> 
> The patches look good.
> 
> I think removing --nt32 option is incompatible change. What about keep the 
> --nt32 ?
> 
> For the Patch 2 setup for different VS tool chains.
> Reviewed-by: Bob Feng 
> 
> Thanks,
> Bob
> 
> -Original Message-
> From: Bi, Dandan
> Sent: Sunday, June 23, 2019 9:59 PM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C ; Gao, Liming 
> Subject: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1693
> 
> Patch 1 remove nt32 related flags in bat files.
> Patch 2 setup for different VS tool chains.
> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Dandan Bi (2):
>   Edk2: Remove nt32 related flag in bat files
>   Edk2Setup: Support different VS tool chain setup
> 
>  BaseTools/get_vsvars.bat| 42 +
>  BaseTools/set_vsprefix_envs.bat | 47 +---
>  BaseTools/toolsetup.bat | 68 
> ++---
>  edksetup.bat| 32 ++-
>  4 files changed, 145 insertions(+), 44 deletions(-)
> 
> --
> 1.9.5.msysgit.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42939): https://edk2.groups.io/g/devel/message/42939
Mute This Topic: https://groups.io/mt/32177263/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [patch 0/2] Edk2Setup: Enahnce edk2setup batch files

2019-06-27 Thread Liming Gao
Yes. Those script needs to be updated together. 

> -Original Message-
> From: Feng, Bob C
> Sent: Thursday, June 27, 2019 11:14 PM
> To: Gao, Liming ; Bi, Dandan ; 
> devel@edk2.groups.io
> Subject: RE: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
> 
> OK.  I think it may break some pre-build script if the pre-build script have 
> "edksetup --nt32"...
> 
> -Original Message-
> From: Gao, Liming
> Sent: Thursday, June 27, 2019 10:48 PM
> To: Feng, Bob C ; Bi, Dandan ; 
> devel@edk2.groups.io
> Subject: RE: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
> 
> Bob:
>   --nt32 option is added for Nt32Pkg. Now, Nt32Pkg has been removed. So, I 
> think it is fine to remove --nt32 option.
> 
> > -Original Message-
> > From: Feng, Bob C
> > Sent: Thursday, June 27, 2019 7:56 PM
> > To: Bi, Dandan ; devel@edk2.groups.io
> > Cc: Gao, Liming 
> > Subject: RE: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
> >
> > The patches look good.
> >
> > I think removing --nt32 option is incompatible change. What about keep the 
> > --nt32 ?
> >
> > For the Patch 2 setup for different VS tool chains.
> > Reviewed-by: Bob Feng 
> >
> > Thanks,
> > Bob
> >
> > -Original Message-
> > From: Bi, Dandan
> > Sent: Sunday, June 23, 2019 9:59 PM
> > To: devel@edk2.groups.io
> > Cc: Feng, Bob C ; Gao, Liming 
> > Subject: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1693
> >
> > Patch 1 remove nt32 related flags in bat files.
> > Patch 2 setup for different VS tool chains.
> >
> > Cc: Bob Feng 
> > Cc: Liming Gao 
> > Dandan Bi (2):
> >   Edk2: Remove nt32 related flag in bat files
> >   Edk2Setup: Support different VS tool chain setup
> >
> >  BaseTools/get_vsvars.bat| 42 +
> >  BaseTools/set_vsprefix_envs.bat | 47 +---
> >  BaseTools/toolsetup.bat | 68 
> > ++---
> >  edksetup.bat| 32 ++-
> >  4 files changed, 145 insertions(+), 44 deletions(-)
> >
> > --
> > 1.9.5.msysgit.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42940): https://edk2.groups.io/g/devel/message/42940
Mute This Topic: https://groups.io/mt/32177263/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [Experiment] GitHub pull requests for some low-priority corrections

2019-06-27 Thread coeur
About a year ago, I changed 8000+ lines of text in edk2 to fix various typos.
But I didn't split it all and I didn't create a hundred of patches by email to 
get it all applied (except for a few folders of them).

As it's still a lot of work to rebase it, split it, patch it and get it 
reviewed, I wanted to make it easier for me, so I made a few branches and pull 
requested those on GitHub:
- https://github.com/tianocore/edk2/pull/143
- https://github.com/tianocore/edk2/pull/144 ( 
https://github.com/tianocore/edk2/pull/143 )
- https://github.com/tianocore/edk2-libc/pull/1

With branches & pull-requests, I can immediately detect conflicts when the 
branch is out-of-sync with master, immediately rebase and more.
With patches... well, they get LOST: try to find my unmerged patches from 
February 2019 for instance...

So those pulls are an experiment with low priority. I can change the licence if 
needed (I don't even need attribution, I just want to help), or I can perform 
other changes, but I would be much pleased if such experiment becomes 
conclusive.

Thank you
Antoine Cœur,
Currently looking for a job in Shanghai

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42941): https://edk2.groups.io/g/devel/message/42941
Mute This Topic: https://groups.io/mt/32232368/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel][Patch] MdeModulePkg/DxeCapsuleLibFmp: Add missing NULL pointer check.

2019-06-27 Thread Xu, Wei6
Add missing NULL pointer check for CapsuleNameBufStart.
Also add comments to notice that capsule name integrity check assumes
the capsule has been validated by IsValidCapsuleHeader().

Cc: Jian J Wang 
Cc: Hao A Wu 
Cc: Chao B Zhang 
Signed-off-by: Wei6 Xu 
---
 MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c 
b/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c
index 66c9be8e1f..3193ca8f4d 100644
--- a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c
+++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c
@@ -23,10 +23,13 @@ IsCapsuleNameCapsule (
 
 /**
   Check the integrity of the capsule name capsule.
   If the capsule is vaild, return the physical address of each capsule name 
string.
 
+  This routine assumes the capsule has been validated by 
IsValidCapsuleHeader(), so
+  capsule memory overflow is not going to happen in this routine.
+
   @param[in]  CapsuleHeader   Pointer to the capsule header of a capsule name 
capsule.
   @param[out] CapsuleNameNum  Number of capsule name.
 
   @retval NULLCapsule name capsule is not valid.
   @retval CapsuleNameBuf  Array of capsule name physical address.
@@ -63,10 +66,13 @@ ValidateCapsuleNameCapsuleIntegrity (
   //
   // If strings are not aligned on a 16-bit boundary, reallocate memory for it.
   //
   if (((UINTN) CapsuleNameBufStart & BIT0) != 0) {
 CapsuleNameBufStart = AllocateCopyPool (CapsuleHeader->CapsuleImageSize - 
CapsuleHeader->HeaderSize, CapsuleNameBufStart);
+if (CapsuleNameBufStart == NULL) {
+  return NULL;
+}
   }
 
   CapsuleNameBufEnd = CapsuleNameBufStart + CapsuleHeader->CapsuleImageSize - 
CapsuleHeader->HeaderSize;
 
   CapsuleNamePtr = CapsuleNameBufStart;
-- 
2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42942): https://edk2.groups.io/g/devel/message/42942
Mute This Topic: https://groups.io/mt/32232931/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v3 4/4] OvmfPkg: don't assign PCI BARs above 4GiB when CSM enabled

2019-06-27 Thread Alexander Graf via Groups.Io

Hi David and Laszlo,

(with broken threading because gmane still mirrors the old ML ...)


Mostly, this is only necessary for devices that the CSM might have
native support for, such as VirtIO and NVMe; PciBusDxe will already
degrade devices to 32-bit if they have an OpROM.

However, there doesn't seem to be a generic way of requesting PciBusDxe
to downgrade specific devices.

There's IncompatiblePciDeviceSupportProtocol but that doesn't provide
the PCI class information or a handle to the device itself, so there's
no simple way to just match on all NVMe devices, for example.

Just leave gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size set to zero for
CSM builds, until/unless that can be fixed.

Signed-off-by: David Woodhouse 
Reviewed-by: Laszlo Ersek 
---
 OvmfPkg/OvmfPkgIa32X64.dsc | 4 
 OvmfPkg/OvmfPkgX64.dsc | 4 
 2 files changed, 8 insertions(+)

diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index 639e33cb285f..ad20531ceb8b 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -543,7 +543,11 @@ [PcdsDynamicDefault]
   gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base|0x0
   gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size|0x0
   gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base|0x0
+!ifdef $(CSM_ENABLE)
+  gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size|0x0
+!else
   gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size|0x8
+!endif
 
   gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0
 
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc

index 69a3497c2c9e..0542ac2235b4 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -542,7 +542,11 @@ [PcdsDynamicDefault]
   gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base|0x0
   gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size|0x0
   gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base|0x0
+!ifdef $(CSM_ENABLE)
+  gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size|0x0


IIRC x86 Linux just takes firmware provided BAR maps as they are and 
doesn't map on its own. Or does it map if a BAR was previously unmapped?


In the former case, wouldn't that mean that we're breaking GPU 
passthrough (*big* BARs) for OVMF if the OVMF version happens to support 
CSM? So if a distro decides to turn on CSM, that would be a very subtle 
regression.


Would it be possible to change the PCI mapping logic to just simply 
*prefer* low BAR space if there's some available and the BAR is not big 
(<64MB for example)?


That way we could have CSM enabled OVMF for everyone ;)


Alex



+!else
   gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size|0x8
+!endif
 
   gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0
 
--

2.21.0


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42943): https://edk2.groups.io/g/devel/message/42943
Mute This Topic: https://groups.io/mt/32213812/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v3 4/4] OvmfPkg: don't assign PCI BARs above 4GiB when CSM enabled

2019-06-27 Thread Laszlo Ersek
On 06/27/19 18:36, Alexander Graf wrote:
> Hi David and Laszlo,
> 
> (with broken threading because gmane still mirrors the old ML ...)
> 
>> Mostly, this is only necessary for devices that the CSM might have
>> native support for, such as VirtIO and NVMe; PciBusDxe will already
>> degrade devices to 32-bit if they have an OpROM.
>>
>> However, there doesn't seem to be a generic way of requesting PciBusDxe
>> to downgrade specific devices.
>>
>> There's IncompatiblePciDeviceSupportProtocol but that doesn't provide
>> the PCI class information or a handle to the device itself, so there's
>> no simple way to just match on all NVMe devices, for example.
>>
>> Just leave gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size set to zero for
>> CSM builds, until/unless that can be fixed.
>>
>> Signed-off-by: David Woodhouse 
>> Reviewed-by: Laszlo Ersek 
>> ---
>>  OvmfPkg/OvmfPkgIa32X64.dsc | 4 
>>  OvmfPkg/OvmfPkgX64.dsc | 4 
>>  2 files changed, 8 insertions(+)
>>
>> diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
>> index 639e33cb285f..ad20531ceb8b 100644
>> --- a/OvmfPkg/OvmfPkgIa32X64.dsc
>> +++ b/OvmfPkg/OvmfPkgIa32X64.dsc
>> @@ -543,7 +543,11 @@ [PcdsDynamicDefault]
>>    gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base|0x0
>>    gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size|0x0
>>    gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base|0x0
>> +!ifdef $(CSM_ENABLE)
>> +  gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size|0x0
>> +!else
>>    gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size|0x8
>> +!endif
>>  
>>    gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0
>>  
>> diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
>> index 69a3497c2c9e..0542ac2235b4 100644
>> --- a/OvmfPkg/OvmfPkgX64.dsc
>> +++ b/OvmfPkg/OvmfPkgX64.dsc
>> @@ -542,7 +542,11 @@ [PcdsDynamicDefault]
>>    gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base|0x0
>>    gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size|0x0
>>    gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base|0x0
>> +!ifdef $(CSM_ENABLE)
>> +  gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size|0x0
> 
> IIRC x86 Linux just takes firmware provided BAR maps as they are and
> doesn't map on its own.

That's correct.


> Or does it map if a BAR was previously unmapped?

My understanding is that Linux re-maps the BARs if it dislikes something
(e.g. root bridge apertures described in ACPI _CRS do not cover some
ranges programmed into actual BARs).

IIUC reallocation can be requested on the kernel cmdline as well, with
pci=realloc.

I believe you could test your question with the "pci-testdev" QEMU
device model -- in QEMU commit 417463341e3e ("pci-testdev: add optional
memory bar", 2018-11-05), Gerd added the "membar" property for just that
(IIRC).


> In the former case, wouldn't that mean that we're breaking GPU
> passthrough (*big* BARs) for OVMF if the OVMF version happens to support
> CSM? So if a distro decides to turn on CSM, that would be a very subtle
> regression.

Yes, this is in theory a possible regression. It requires the user to
combine huge BARs with an OVMF build that includes the CSM.

I've been aware of this, but it seems like such a corner case that I
didn't intend to raise it. To begin with, building OVMF with the CSM is
a niche use case in itself.

David described (but I've forgotten the details, by now) some kind of
setup or service where a user cannot choose between pure SeaBIOS and
pure OVMF, for their virtual machine. They are given just one firmware,
and so in order to let users boot both legacy and UEFI OSes, it makes
sense for the service provider to offer OVMF+CSM.

Fine -- but, in that kind of service, where users are prevented from
picking one of two "pure" firmwares, do we really expect users to have
the configuration freedom to shove GPUs with huge BARs into their VMs?


> Would it be possible to change the PCI mapping logic to just simply
> *prefer* low BAR space if there's some available and the BAR is not big
> (<64MB for example)?

PciBusDxe in MdeModulePkg is practically untouchable, at such a
"strategy" level. We can fix bugs in it, but only surgically. (This is
not something that I endorse, I'm just observing it.)

Platforms are expected to influence the behavior of PciBusDxe through
implementing the "incompatible pci device support" protocol. OVMF
already does that (IncompatiblePciDeviceSupportDxe), but the protocol
interface (from the PI spec) is not flexible enough for what David
actually wanted. Otherwise, this restriction would have been expressed
per-controller.

If the problem that you describe above outweighs the issue that David
intends to mitigate with the patch, in a given service, then the vendor
can rebuild OVMF with a suitable "--pcd=..." option. Or else, they can
even use

  -fw_cfg name=opt/ovmf/X-PciMmio64Mb,string=32768

dynamically, on the QEMU command line. (Please see commit 7e5b1b670c38,
"OvmfPkg: PlatformPei: determine the 64-bit PCI host aperture for X64
DXE", 2016-03-23.)


> That way we could have CSM enabled OVMF for everyo

Re: [edk2-devel] [Experiment] GitHub pull requests for some low-priority corrections

2019-06-27 Thread Laszlo Ersek
On 06/27/19 13:31, co...@gmx.fr wrote:
> About a year ago, I changed 8000+ lines of text in edk2 to fix various typos.
> But I didn't split it all and I didn't create a hundred of patches by email 
> to get it all applied (except for a few folders of them).
> 
> As it's still a lot of work to rebase it, split it, patch it and get it 
> reviewed, I wanted to make it easier for me, so I made a few branches and 
> pull requested those on GitHub:
> - https://github.com/tianocore/edk2/pull/143
> - https://github.com/tianocore/edk2/pull/144 ( 
> https://github.com/tianocore/edk2/pull/143 )
> - https://github.com/tianocore/edk2-libc/pull/1
> 
> With branches & pull-requests, I can immediately detect conflicts when the 
> branch is out-of-sync with master, immediately rebase and more.
> With patches... well, they get LOST: try to find my unmerged patches from 
> February 2019 for instance...
> 
> So those pulls are an experiment with low priority. I can change the licence 
> if needed (I don't even need attribution, I just want to help), or I can 
> perform other changes, but I would be much pleased if such experiment becomes 
> conclusive.

I stated my take on this in the following comments:

[1] https://github.com/tianocore/edk2/pull/143#issuecomment-506425815
[2] https://github.com/tianocore/edk2/pull/143#issuecomment-506430151

To capture them here:

[1] Antoine, I'll have to reject this github PR (similarly to other
github pull requests for the edk2 project). While we may have discussed
github pull requests for other projects on the list, such as
"Edk2-Library", to my knowledge we're not even considering an evaluation
of github pull requests for the main edk2 project. Please submit your
patch to the list for review. The point is exactly that patch review
happen on the list. Thanks.

[2] For the record, a few months ago we did evaluate github,
phabricator, and gitlab. Gerrit was added to the "evaluation backlog".
>From the three we checked, at that time, github proved the least
inferior to the mailing list. We identified a number of sticking points
which github.com should address before we could consider adopting it.

http://mid.mail-archive.com/793375cd-f55a-fa22-97c2-d6fd04da7d8b@linux.intel.com
http://mid.mail-archive.com/0b2ce1b0-93ab-aef2-d192-23fd84024b70@redhat.com

(Alternative links:

https://lists.01.org/pipermail/edk2-devel/2019-February/036428.html
https://lists.01.org/pipermail/edk2-devel/2018-December/033509.html
)

Nothing has changed since, to my knowledge, so I don't see a reason to
reopen the investigation.


Thanks
Laszlo

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42945): https://edk2.groups.io/g/devel/message/42945
Mute This Topic: https://groups.io/mt/32232368/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v3 4/4] OvmfPkg: don't assign PCI BARs above 4GiB when CSM enabled

2019-06-27 Thread Laszlo Ersek
On 06/27/19 20:43, Laszlo Ersek wrote:
> On 06/27/19 18:36, Alexander Graf wrote:

>> That way we could have CSM enabled OVMF for everyone ;)
> 
> Well, as long as we're discussing "everyone": we should forget about the
> CSM altogether, in the long term. The CSM is a concession towards OSes
> that are stuck in the past; a concession that is hugely complex and
> difficult to debug & maintain. It is also incompatible with Secure Boot.
> Over time, we should spend less and less time & energy on the CSM. Just
> my opinion, of course. :)

To clarify -- this is by no means to say that *SeaBIOS* is a relic. I
absolutely don't imply that. Users should use the firmware they need,
especially in the virtual world, where choosing is really easy.

But the *CSM* is just an elaborate workaround for the user, to
circumvent a decision that a platform vendor made for him/her
unsolicitedly. In the virtual world in particular, I don't think such
workarounds should be necessary; the platform vendor should *please* the
user, and give them SeaBIOS directly, if they want that.

(Again, just my opinion -- I just wanted to clarify that I wasn't taking
a stab at SeaBIOS. That would be *foolish*.)

Thanks
Laszlo

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42946): https://edk2.groups.io/g/devel/message/42946
Mute This Topic: https://groups.io/mt/32213812/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v3 4/4] OvmfPkg: don't assign PCI BARs above 4GiB when CSM enabled

2019-06-27 Thread David Woodhouse
On Thu, 2019-06-27 at 21:01 +0200, Laszlo Ersek wrote:
> 
> To clarify -- this is by no means to say that *SeaBIOS* is a relic. I
> absolutely don't imply that. Users should use the firmware they need,
> especially in the virtual world, where choosing is really easy.

Choosing is easy if you're running qemu on your desktop box.

If the owner of the guest doesn't also own the host, then you're into
"configurability", which means guests either having to *explicitly*
manage which firmware they get which is a pain for the customer, or
some kind of half-arsed guessing about which firmware to use, based on
poking around in the image that's being booted. Which doesn't generally
go well either.

There's a reason Intel went for the one-size-fits-all on real hardware,
and it applies just as well to (some, but not all) virtual hosting too.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42947): https://edk2.groups.io/g/devel/message/42947
Mute This Topic: https://groups.io/mt/32213812/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



smime.p7s
Description: S/MIME cryptographic signature


Re: [edk2-devel][Patch] MdeModulePkg/DxeCapsuleLibFmp: Add missing NULL pointer check.

2019-06-27 Thread Zhang, Chao B
Reviewed-by: Chao Zhang 

-Original Message-
From: Xu, Wei6 
Sent: Friday, June 28, 2019 12:26 AM
To: devel@edk2.groups.io
Cc: Wang, Jian J ; Wu, Hao A ; 
Zhang, Chao B 
Subject: [edk2-devel][Patch] MdeModulePkg/DxeCapsuleLibFmp: Add missing NULL 
pointer check.

Add missing NULL pointer check for CapsuleNameBufStart.
Also add comments to notice that capsule name integrity check assumes the 
capsule has been validated by IsValidCapsuleHeader().

Cc: Jian J Wang 
Cc: Hao A Wu 
Cc: Chao B Zhang 
Signed-off-by: Wei6 Xu 
---
 MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c 
b/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c
index 66c9be8e1f..3193ca8f4d 100644
--- a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c
+++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c
@@ -23,10 +23,13 @@ IsCapsuleNameCapsule (
 
 /**
   Check the integrity of the capsule name capsule.
   If the capsule is vaild, return the physical address of each capsule name 
string.
 
+  This routine assumes the capsule has been validated by 
+ IsValidCapsuleHeader(), so  capsule memory overflow is not going to happen in 
this routine.
+
   @param[in]  CapsuleHeader   Pointer to the capsule header of a capsule name 
capsule.
   @param[out] CapsuleNameNum  Number of capsule name.
 
   @retval NULLCapsule name capsule is not valid.
   @retval CapsuleNameBuf  Array of capsule name physical address.
@@ -63,10 +66,13 @@ ValidateCapsuleNameCapsuleIntegrity (
   //
   // If strings are not aligned on a 16-bit boundary, reallocate memory for it.
   //
   if (((UINTN) CapsuleNameBufStart & BIT0) != 0) {
 CapsuleNameBufStart = AllocateCopyPool (CapsuleHeader->CapsuleImageSize - 
CapsuleHeader->HeaderSize, CapsuleNameBufStart);
+if (CapsuleNameBufStart == NULL) {
+  return NULL;
+}
   }
 
   CapsuleNameBufEnd = CapsuleNameBufStart + CapsuleHeader->CapsuleImageSize - 
CapsuleHeader->HeaderSize;
 
   CapsuleNamePtr = CapsuleNameBufStart;
--
2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42948): https://edk2.groups.io/g/devel/message/42948
Mute This Topic: https://groups.io/mt/32232931/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] Upcoming Event: TianoCore Bug Triage - APAC / NAMO - Thu, 06/27/2019 5:00pm-5:30pm #cal-reminder

2019-06-27 Thread devel@edk2.groups.io Calendar
*Reminder:* TianoCore Bug Triage - APAC / NAMO

*When:* Thursday, 27 June 2019, 5:00pm to 5:30pm, (GMT-07:00) America/Los 
Angeles

*Where:* https://zoom.us/j/251103409

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=458032 )

*Organizer:* Stephano Cetola stephano.cet...@intel.com ( 
stephano.cet...@intel.com?subject=Re:%20Event:%20TianoCore%20Bug%20Triage%20-%20APAC%20%2F%20NAMO
 )

*Description:*

Join Zoom Meeting

https://zoom.us/j/251103409 ( https://zoom.us/j/251103409 )

One tap mobile

+17207072699,,251103409# US

+16465588656,,251103409# US (New York)

Dial by your location

+1 720 707 2699 US

+1 646 558 8656 US (New York)

Meeting ID: 251 103 409

Find your local number: https://zoom.us/u/acEIbOAUyA ( 
https://zoom.us/u/acEIbOAUyA )

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42949): https://edk2.groups.io/g/devel/message/42949
Mute This Topic: https://groups.io/mt/32237084/21656
Mute #cal-reminder: https://groups.io/mk?hashtag=cal-reminder&subid=3846945
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel][Patch] MdeModulePkg/DxeCapsuleLibFmp: Add missing NULL pointer check.

2019-06-27 Thread Wu, Hao A
> -Original Message-
> From: Xu, Wei6
> Sent: Friday, June 28, 2019 12:26 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J; Wu, Hao A; Zhang, Chao B
> Subject: [edk2-devel][Patch] MdeModulePkg/DxeCapsuleLibFmp: Add
> missing NULL pointer check.
> 
> Add missing NULL pointer check for CapsuleNameBufStart.
> Also add comments to notice that capsule name integrity check assumes
> the capsule has been validated by IsValidCapsuleHeader().


The patch is doing 2 things. Please help to split it into 2 commits.

With this handled,
Reviewed-by: Hao A Wu 

Best Regards,
Hao Wu


> 
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Cc: Chao B Zhang 
> Signed-off-by: Wei6 Xu 
> ---
>  MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c
> b/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c
> index 66c9be8e1f..3193ca8f4d 100644
> --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c
> +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c
> @@ -23,10 +23,13 @@ IsCapsuleNameCapsule (
> 
>  /**
>Check the integrity of the capsule name capsule.
>If the capsule is vaild, return the physical address of each capsule name
> string.
> 
> +  This routine assumes the capsule has been validated by
> IsValidCapsuleHeader(), so
> +  capsule memory overflow is not going to happen in this routine.
> +
>@param[in]  CapsuleHeader   Pointer to the capsule header of a capsule
> name capsule.
>@param[out] CapsuleNameNum  Number of capsule name.
> 
>@retval NULLCapsule name capsule is not valid.
>@retval CapsuleNameBuf  Array of capsule name physical address.
> @@ -63,10 +66,13 @@ ValidateCapsuleNameCapsuleIntegrity (
>//
>// If strings are not aligned on a 16-bit boundary, reallocate memory for 
> it.
>//
>if (((UINTN) CapsuleNameBufStart & BIT0) != 0) {
>  CapsuleNameBufStart = AllocateCopyPool (CapsuleHeader-
> >CapsuleImageSize - CapsuleHeader->HeaderSize, CapsuleNameBufStart);
> +if (CapsuleNameBufStart == NULL) {
> +  return NULL;
> +}
>}
> 
>CapsuleNameBufEnd = CapsuleNameBufStart + CapsuleHeader-
> >CapsuleImageSize - CapsuleHeader->HeaderSize;
> 
>CapsuleNamePtr = CapsuleNameBufStart;
> --
> 2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42950): https://edk2.groups.io/g/devel/message/42950
Mute This Topic: https://groups.io/mt/32232931/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v4 0/2] MdeModulePkg/SdMmcHcDxe: Implement revision 3 of SdMmcOverrideProtocol

2019-06-27 Thread Wu, Hao A
> -Original Message-
> From: Sumit Garg [mailto:sumit.g...@linaro.org]
> Sent: Thursday, June 27, 2019 9:39 PM
> To: Ard Biesheuvel
> Cc: edk2-devel-groups-io; Wu, Hao A; Marcin Wojtas; Albecki, Mateusz
> Subject: Re: [edk2-devel] [PATCH v4 0/2] MdeModulePkg/SdMmcHcDxe:
> Implement revision 3 of SdMmcOverrideProtocol
> 
> On Thu, 27 Jun 2019 at 13:40, Ard Biesheuvel 
> wrote:
> >
> > (+ Sumit)
> >
> > On Thu, 27 Jun 2019 at 08:29, Wu, Hao A  wrote:
> > >
> > > > -Original Message-
> > > > From: Marcin Wojtas [mailto:m...@semihalf.com]
> > > > Sent: Thursday, June 27, 2019 2:25 PM
> > > > To: Albecki, Mateusz
> > > > Cc: edk2-devel-groups-io; Wu, Hao A
> > > > Subject: Re: [edk2-devel] [PATCH v4 0/2]
> MdeModulePkg/SdMmcHcDxe:
> > > > Implement revision 3 of SdMmcOverrideProtocol
> > > >
> > > > Hi Mateusz,
> > > >
> > > > Can you please push those patches somewhere (github?) so that I can
> > > > easily do a quick check for regression?
> > > >
> > > > Thanks,
> > > > Marcin
> > >
> > >
> > > Hello Marcin,
> > >
> > > I have just pushed the series at:
> > > https://github.com/hwu25/edk2/tree/sdmmc_override_extend_v4
> > >
> > > Please help to check.
> > >
> >
> > I have cc'ed my colleague Sumit, who has kindly agreed to regression
> > test this branch on Socionext SynQuacer, which also uses the SD/MMC
> > override infrastructure.
> >
> > Sumit, please reply here with your results. And thanks again!
> 
> I did picked this patch-set and applied on top of edk2 master branch.
> It works well on SynQuacer with eMMC device enumerated properly and
> all three eMMC partitions are visible:
> 
>  BLK4: Alias(s):
>   VenHw(0D51905B-B77E-452A-A2C0-
> ECA0CC8D514A,305200)/eMMC(0x
> 0)/Ctrl(0x0)
>  BLK5: Alias(s):
>   VenHw(0D51905B-B77E-452A-A2C0-
> ECA0CC8D514A,305200)/eMMC(0x
> 0)/Ctrl(0x1)
>  BLK6: Alias(s):
>   VenHw(0D51905B-B77E-452A-A2C0-
> ECA0CC8D514A,305200)/eMMC(0x
> 0)/Ctrl(0x2)
> 
> Shell> devices
> 
>   E9 D - -  1  1   0 VenHw(0D51905B-B77E-452A-A2C0-
> ECA0CC8D514A,3052
> 00)/eMMC(0x0)/Ctrl(0x0)
>   EA D - -  1  1   0 VenHw(0D51905B-B77E-452A-A2C0-
> ECA0CC8D514A,3052
> 00)/eMMC(0x0)/Ctrl(0x1)
>   EB D - -  1  1   0 VenHw(0D51905B-B77E-452A-A2C0-
> ECA0CC8D514A,3052
> 00)/eMMC(0x0)/Ctrl(0x2)
> 
> So you can add following:
> 
> Regression-tested-by: Sumit Garg 


Thanks a lot for the testing.

Best Regards,
Hao Wu


> 
> -Sumit

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42951): https://edk2.groups.io/g/devel/message/42951
Mute This Topic: https://groups.io/mt/32214570/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel][Patch] MdeModulePkg/DxeCapsuleLibFmp: Add missing NULL pointer check.

2019-06-27 Thread Zhang, Chao B
HI Hao:
   I think the patch is to complete the security check both in info and code 
logic to ValidateCapsuleNameCapsuleIntegrity .
It is OK to keep it in one patch.


From: Wu, Hao A
Sent: Friday, June 28, 2019 8:54 AM
To: Xu, Wei6 ; devel@edk2.groups.io
Cc: Wang, Jian J ; Zhang, Chao B 
Subject: RE: [edk2-devel][Patch] MdeModulePkg/DxeCapsuleLibFmp: Add missing 
NULL pointer check.

> -Original Message-
> From: Xu, Wei6
> Sent: Friday, June 28, 2019 12:26 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J; Wu, Hao A; Zhang, Chao B
> Subject: [edk2-devel][Patch] MdeModulePkg/DxeCapsuleLibFmp: Add
> missing NULL pointer check.
>
> Add missing NULL pointer check for CapsuleNameBufStart.
> Also add comments to notice that capsule name integrity check assumes
> the capsule has been validated by IsValidCapsuleHeader().


The patch is doing 2 things. Please help to split it into 2 commits.

With this handled,
Reviewed-by: Hao A Wu mailto:hao.a...@intel.com>>

Best Regards,
Hao Wu


>
> Cc: Jian J Wang mailto:jian.j.w...@intel.com>>
> Cc: Hao A Wu mailto:hao.a...@intel.com>>
> Cc: Chao B Zhang mailto:chao.b.zh...@intel.com>>
> Signed-off-by: Wei6 Xu mailto:wei6...@intel.com>>
> ---
>  MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c | 6 ++
>  1 file changed, 6 insertions(+)
>
> diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c
> b/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c
> index 66c9be8e1f..3193ca8f4d 100644
> --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c
> +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c
> @@ -23,10 +23,13 @@ IsCapsuleNameCapsule (
>
>  /**
>Check the integrity of the capsule name capsule.
>If the capsule is vaild, return the physical address of each capsule name
> string.
>
> +  This routine assumes the capsule has been validated by
> IsValidCapsuleHeader(), so
> +  capsule memory overflow is not going to happen in this routine.
> +
>@param[in]  CapsuleHeader   Pointer to the capsule header of a capsule
> name capsule.
>@param[out] CapsuleNameNum  Number of capsule name.
>
>@retval NULLCapsule name capsule is not valid.
>@retval CapsuleNameBuf  Array of capsule name physical address.
> @@ -63,10 +66,13 @@ ValidateCapsuleNameCapsuleIntegrity (
>//
>// If strings are not aligned on a 16-bit boundary, reallocate memory for 
> it.
>//
>if (((UINTN) CapsuleNameBufStart & BIT0) != 0) {
>  CapsuleNameBufStart = AllocateCopyPool (CapsuleHeader-
> >CapsuleImageSize - CapsuleHeader->HeaderSize, CapsuleNameBufStart);
> +if (CapsuleNameBufStart == NULL) {
> +  return NULL;
> +}
>}
>
>CapsuleNameBufEnd = CapsuleNameBufStart + CapsuleHeader-
> >CapsuleImageSize - CapsuleHeader->HeaderSize;
>
>CapsuleNamePtr = CapsuleNameBufStart;
> --
> 2.16.2.windows.1

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42952): https://edk2.groups.io/g/devel/message/42952
Mute This Topic: https://groups.io/mt/32232931/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [patch 0/2] Edk2Setup: Enahnce edk2setup batch files

2019-06-27 Thread Dandan Bi
Hi Liming and Bob,

Thanks for the review. So we reach the agreement that remove the --nt32 flag, 
right? If so, I will address Liming's comments and then push these two patches.


Thanks,
Dandan

> -Original Message-
> From: Gao, Liming
> Sent: Thursday, June 27, 2019 11:17 PM
> To: Feng, Bob C ; Bi, Dandan
> ; devel@edk2.groups.io
> Subject: RE: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
> 
> Yes. Those script needs to be updated together.
> 
> > -Original Message-
> > From: Feng, Bob C
> > Sent: Thursday, June 27, 2019 11:14 PM
> > To: Gao, Liming ; Bi, Dandan
> > ; devel@edk2.groups.io
> > Subject: RE: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
> >
> > OK.  I think it may break some pre-build script if the pre-build script have
> "edksetup --nt32"...
> >
> > -Original Message-
> > From: Gao, Liming
> > Sent: Thursday, June 27, 2019 10:48 PM
> > To: Feng, Bob C ; Bi, Dandan
> > ; devel@edk2.groups.io
> > Subject: RE: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
> >
> > Bob:
> >   --nt32 option is added for Nt32Pkg. Now, Nt32Pkg has been removed. So,
> I think it is fine to remove --nt32 option.
> >
> > > -Original Message-
> > > From: Feng, Bob C
> > > Sent: Thursday, June 27, 2019 7:56 PM
> > > To: Bi, Dandan ; devel@edk2.groups.io
> > > Cc: Gao, Liming 
> > > Subject: RE: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
> > >
> > > The patches look good.
> > >
> > > I think removing --nt32 option is incompatible change. What about keep
> the --nt32 ?
> > >
> > > For the Patch 2 setup for different VS tool chains.
> > > Reviewed-by: Bob Feng 
> > >
> > > Thanks,
> > > Bob
> > >
> > > -Original Message-
> > > From: Bi, Dandan
> > > Sent: Sunday, June 23, 2019 9:59 PM
> > > To: devel@edk2.groups.io
> > > Cc: Feng, Bob C ; Gao, Liming
> > > 
> > > Subject: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
> > >
> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1693
> > >
> > > Patch 1 remove nt32 related flags in bat files.
> > > Patch 2 setup for different VS tool chains.
> > >
> > > Cc: Bob Feng 
> > > Cc: Liming Gao  Dandan Bi (2):
> > >   Edk2: Remove nt32 related flag in bat files
> > >   Edk2Setup: Support different VS tool chain setup
> > >
> > >  BaseTools/get_vsvars.bat| 42 +
> > >  BaseTools/set_vsprefix_envs.bat | 47 +--
> -
> > >  BaseTools/toolsetup.bat | 68
> ++---
> > >  edksetup.bat| 32 ++-
> > >  4 files changed, 145 insertions(+), 44 deletions(-)
> > >
> > > --
> > > 1.9.5.msysgit.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42954): https://edk2.groups.io/g/devel/message/42954
Mute This Topic: https://groups.io/mt/32177263/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel][Patch] MdeModulePkg/DxeCapsuleLibFmp: Add missing NULL pointer check.

2019-06-27 Thread Wu, Hao A
Okay.

Best Regards,
Hao Wu

From: Zhang, Chao B
Sent: Friday, June 28, 2019 9:07 AM
To: Wu, Hao A; Xu, Wei6; devel@edk2.groups.io
Cc: Wang, Jian J
Subject: RE: [edk2-devel][Patch] MdeModulePkg/DxeCapsuleLibFmp: Add missing 
NULL pointer check.

HI Hao:
   I think the patch is to complete the security check both in info and code 
logic to ValidateCapsuleNameCapsuleIntegrity .
It is OK to keep it in one patch.


From: Wu, Hao A
Sent: Friday, June 28, 2019 8:54 AM
To: Xu, Wei6 ; devel@edk2.groups.io
Cc: Wang, Jian J ; Zhang, Chao B 
Subject: RE: [edk2-devel][Patch] MdeModulePkg/DxeCapsuleLibFmp: Add missing 
NULL pointer check.

> -Original Message-
> From: Xu, Wei6
> Sent: Friday, June 28, 2019 12:26 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J; Wu, Hao A; Zhang, Chao B
> Subject: [edk2-devel][Patch] MdeModulePkg/DxeCapsuleLibFmp: Add
> missing NULL pointer check.
>
> Add missing NULL pointer check for CapsuleNameBufStart.
> Also add comments to notice that capsule name integrity check assumes
> the capsule has been validated by IsValidCapsuleHeader().


The patch is doing 2 things. Please help to split it into 2 commits.

With this handled,
Reviewed-by: Hao A Wu mailto:hao.a...@intel.com>>

Best Regards,
Hao Wu


>
> Cc: Jian J Wang mailto:jian.j.w...@intel.com>>
> Cc: Hao A Wu mailto:hao.a...@intel.com>>
> Cc: Chao B Zhang mailto:chao.b.zh...@intel.com>>
> Signed-off-by: Wei6 Xu mailto:wei6...@intel.com>>
> ---
>  MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c | 6 ++
>  1 file changed, 6 insertions(+)
>
> diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c
> b/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c
> index 66c9be8e1f..3193ca8f4d 100644
> --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c
> +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c
> @@ -23,10 +23,13 @@ IsCapsuleNameCapsule (
>
>  /**
>Check the integrity of the capsule name capsule.
>If the capsule is vaild, return the physical address of each capsule name
> string.
>
> +  This routine assumes the capsule has been validated by
> IsValidCapsuleHeader(), so
> +  capsule memory overflow is not going to happen in this routine.
> +
>@param[in]  CapsuleHeader   Pointer to the capsule header of a capsule
> name capsule.
>@param[out] CapsuleNameNum  Number of capsule name.
>
>@retval NULLCapsule name capsule is not valid.
>@retval CapsuleNameBuf  Array of capsule name physical address.
> @@ -63,10 +66,13 @@ ValidateCapsuleNameCapsuleIntegrity (
>//
>// If strings are not aligned on a 16-bit boundary, reallocate memory for 
> it.
>//
>if (((UINTN) CapsuleNameBufStart & BIT0) != 0) {
>  CapsuleNameBufStart = AllocateCopyPool (CapsuleHeader-
> >CapsuleImageSize - CapsuleHeader->HeaderSize, CapsuleNameBufStart);
> +if (CapsuleNameBufStart == NULL) {
> +  return NULL;
> +}
>}
>
>CapsuleNameBufEnd = CapsuleNameBufStart + CapsuleHeader-
> >CapsuleImageSize - CapsuleHeader->HeaderSize;
>
>CapsuleNamePtr = CapsuleNameBufStart;
> --
> 2.16.2.windows.1

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42953): https://edk2.groups.io/g/devel/message/42953
Mute This Topic: https://groups.io/mt/32232931/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [patch 0/2] Edk2Setup: Enahnce edk2setup batch files

2019-06-27 Thread Liming Gao
Dandan:

 If you find any pre script to use --nt32 option, please remove them first, 
then do this change.

>-Original Message-
>From: Bi, Dandan
>Sent: Friday, June 28, 2019 9:11 AM
>To: Gao, Liming ; Feng, Bob C
>; devel@edk2.groups.io
>Subject: RE: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
>
>Hi Liming and Bob,
>
>Thanks for the review. So we reach the agreement that remove the --nt32
>flag, right? If so, I will address Liming's comments and then push these two
>patches.
>
>
>Thanks,
>Dandan
>
>> -Original Message-
>> From: Gao, Liming
>> Sent: Thursday, June 27, 2019 11:17 PM
>> To: Feng, Bob C ; Bi, Dandan
>> ; devel@edk2.groups.io
>> Subject: RE: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
>>
>> Yes. Those script needs to be updated together.
>>
>> > -Original Message-
>> > From: Feng, Bob C
>> > Sent: Thursday, June 27, 2019 11:14 PM
>> > To: Gao, Liming ; Bi, Dandan
>> > ; devel@edk2.groups.io
>> > Subject: RE: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
>> >
>> > OK.  I think it may break some pre-build script if the pre-build script 
>> > have
>> "edksetup --nt32"...
>> >
>> > -Original Message-
>> > From: Gao, Liming
>> > Sent: Thursday, June 27, 2019 10:48 PM
>> > To: Feng, Bob C ; Bi, Dandan
>> > ; devel@edk2.groups.io
>> > Subject: RE: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
>> >
>> > Bob:
>> >   --nt32 option is added for Nt32Pkg. Now, Nt32Pkg has been removed. So,
>> I think it is fine to remove --nt32 option.
>> >
>> > > -Original Message-
>> > > From: Feng, Bob C
>> > > Sent: Thursday, June 27, 2019 7:56 PM
>> > > To: Bi, Dandan ; devel@edk2.groups.io
>> > > Cc: Gao, Liming 
>> > > Subject: RE: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
>> > >
>> > > The patches look good.
>> > >
>> > > I think removing --nt32 option is incompatible change. What about keep
>> the --nt32 ?
>> > >
>> > > For the Patch 2 setup for different VS tool chains.
>> > > Reviewed-by: Bob Feng 
>> > >
>> > > Thanks,
>> > > Bob
>> > >
>> > > -Original Message-
>> > > From: Bi, Dandan
>> > > Sent: Sunday, June 23, 2019 9:59 PM
>> > > To: devel@edk2.groups.io
>> > > Cc: Feng, Bob C ; Gao, Liming
>> > > 
>> > > Subject: [patch 0/2] Edk2Setup: Enahnce edk2setup batch files
>> > >
>> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1693
>> > >
>> > > Patch 1 remove nt32 related flags in bat files.
>> > > Patch 2 setup for different VS tool chains.
>> > >
>> > > Cc: Bob Feng 
>> > > Cc: Liming Gao  Dandan Bi (2):
>> > >   Edk2: Remove nt32 related flag in bat files
>> > >   Edk2Setup: Support different VS tool chain setup
>> > >
>> > >  BaseTools/get_vsvars.bat| 42 +
>> > >  BaseTools/set_vsprefix_envs.bat | 47 +-
>-
>> -
>> > >  BaseTools/toolsetup.bat | 68
>> ++---
>> > >  edksetup.bat| 32 ++-
>> > >  4 files changed, 145 insertions(+), 44 deletions(-)
>> > >
>> > > --
>> > > 1.9.5.msysgit.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42955): https://edk2.groups.io/g/devel/message/42955
Mute This Topic: https://groups.io/mt/32177263/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] Upcoming Event: TianoCore Design Meeting - APAC/NAMO - Thu, 06/27/2019 6:30pm-7:30pm #cal-reminder

2019-06-27 Thread devel@edk2.groups.io Calendar
*Reminder:* TianoCore Design Meeting - APAC/NAMO

*When:* Thursday, 27 June 2019, 6:30pm to 7:30pm, (GMT-07:00) America/Los 
Angeles

*Where:* https://zoom.us/j/969264410

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=458029 )

*Organizer:* Stephano Cetola stephano.cet...@intel.com ( 
stephano.cet...@intel.com?subject=Re:%20Event:%20TianoCore%20Design%20Meeting%20-%20APAC%2FNAMO
 )

*Description:*

BaseTools: Multiple-thread AutoGen ( 
https://edk2.groups.io/g/devel/files/Designs/2019/0627/Multiple-thread-AutoGen.pdf
 )

Join Zoom Meeting

https://zoom.us/j/969264410 ( https://zoom.us/j/969264410 )

One tap mobile

+16465588656,,969264410# US (New York)

+17207072699,,969264410# US

Dial by your location

+1 646 558 8656 US (New York)

+1 720 707 2699 US

Meeting ID: 969 264 410

Find your local number: https://zoom.us/u/abOtdJckxL

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42956): https://edk2.groups.io/g/devel/message/42956
Mute This Topic: https://groups.io/mt/32237793/21656
Mute #cal-reminder: https://groups.io/mk?hashtag=cal-reminder&subid=3846945
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [edk2-platofrms] [patch] Platform/PurleyOpenBoardPkg: Remove --nt32 flag of edkseup

2019-06-27 Thread Dandan Bi
Since Nt32Pkg has been removed from edk2 repo, and
we will also remove the --nt32 flag in edksetup.bat.
So here update platform to pass build.

Cc: Shifei A Lu 
Cc: Xiaohu Zhou 
Cc: Isaac W Oram 
Signed-off-by: Dandan Bi 
---
 .../PurleyOpenBoardPkg/BoardMtOlympus/GitEdk2MinMtOlympus.bat   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/GitEdk2MinMtOlympus.bat 
b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/GitEdk2MinMtOlympus.bat
index 02ed458236..6cda954fc9 100644
--- a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/GitEdk2MinMtOlympus.bat
+++ b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/GitEdk2MinMtOlympus.bat
@@ -46,11 +46,11 @@ set EDK_TOOLS_BIN=%WORKSPACE%\edk2-BaseTools-win32
 
 set EDK_SETUP_OPTION=
 @rem if python is installed, disable the binary base tools.
 if defined PYTHON_HOME (
   set EDK_TOOLS_BIN=
-  set EDK_SETUP_OPTION=--nt32
+  set EDK_SETUP_OPTION=Rebuild
 )
 pushd %WORKSPACE%\edk2
 call edksetup.bat %EDK_SETUP_OPTION%
 popd
 pushd %WORKSPACE%
-- 
2.18.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42957): https://edk2.groups.io/g/devel/message/42957
Mute This Topic: https://groups.io/mt/32238141/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-platofrms] [patch] Platform/PurleyOpenBoardPkg: Remove --nt32 flag of edkseup

2019-06-27 Thread Liming Gao
If use Rebuild option, below nmake is not required. 

@if defined PYTHON_HOME (
  nmake -f %BASE_TOOLS_PATH%\Makefile
)

>-Original Message-
>From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
>Dandan Bi
>Sent: Friday, June 28, 2019 10:03 AM
>To: devel@edk2.groups.io
>Cc: Lu, Shifei A ; Zhou, Bowen
>; Oram, Isaac W 
>Subject: [edk2-devel] [edk2-platofrms] [patch]
>Platform/PurleyOpenBoardPkg: Remove --nt32 flag of edkseup
>
>Since Nt32Pkg has been removed from edk2 repo, and
>we will also remove the --nt32 flag in edksetup.bat.
>So here update platform to pass build.
>
>Cc: Shifei A Lu 
>Cc: Xiaohu Zhou 
>Cc: Isaac W Oram 
>Signed-off-by: Dandan Bi 
>---
> .../PurleyOpenBoardPkg/BoardMtOlympus/GitEdk2MinMtOlympus.bat   | 2
>+-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git
>a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/GitEdk2MinMtOly
>mpus.bat
>b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/GitEdk2MinMtOly
>mpus.bat
>index 02ed458236..6cda954fc9 100644
>---
>a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/GitEdk2MinMtOly
>mpus.bat
>+++
>b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/GitEdk2MinMtOly
>mpus.bat
>@@ -46,11 +46,11 @@ set EDK_TOOLS_BIN=%WORKSPACE%\edk2-
>BaseTools-win32
>
> set EDK_SETUP_OPTION=
> @rem if python is installed, disable the binary base tools.
> if defined PYTHON_HOME (
>   set EDK_TOOLS_BIN=
>-  set EDK_SETUP_OPTION=--nt32
>+  set EDK_SETUP_OPTION=Rebuild
> )
> pushd %WORKSPACE%\edk2
> call edksetup.bat %EDK_SETUP_OPTION%
> popd
> pushd %WORKSPACE%
>--
>2.18.0.windows.1
>
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42958): https://edk2.groups.io/g/devel/message/42958
Mute This Topic: https://groups.io/mt/32238141/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH] IntelFsp2Pkg: FSP Python scripts to support 3.x.

2019-06-27 Thread Zeng, Star
It is ok to directly use below code without python version check?

+for loop in range(int(unit)):
+bytearray.append("0x%02X" % (value & 0xFF))
+value = value >> 8


Thanks,
Star
-Original Message-
From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Chiu, 
Chasel
Sent: Monday, June 24, 2019 10:35 PM
To: devel@edk2.groups.io
Cc: Ma, Maurice ; Desimone, Nathaniel L 
; Zeng, Star 
Subject: [edk2-devel] [PATCH] IntelFsp2Pkg: FSP Python scripts to support 3.x.

https://bugzilla.tianocore.org/show_bug.cgi?id=1930

Updated FSP Python scripts to support both 2.x and 3.x.

Test:
  . Verified with Python 2.7.12 and 3.6.6.
  . Verified tool result is the same before the change.
  . Both py -2 and py -3 built binary can boot.

Cc: Maurice Ma 
Cc: Nate DeSimone 
Cc: Star Zeng 
Signed-off-by: Chasel Chiu 
---
 IntelFsp2Pkg/Tools/GenCfgOpt.py   | 70 
++
 IntelFsp2Pkg/Tools/PatchFv.py | 36 +++-
 IntelFsp2Pkg/Tools/SplitFspBin.py | 74 
+++---
 3 files changed, 116 insertions(+), 64 deletions(-)

diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py b/IntelFsp2Pkg/Tools/GenCfgOpt.py 
index 450c4e3eb9..e0441966ac 100644
--- a/IntelFsp2Pkg/Tools/GenCfgOpt.py
+++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py
@@ -1,6 +1,6 @@
 ## @ GenCfgOpt.py
 #
-# Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2014 - 2019, Intel Corporation. All rights 
+reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent  #  ## @@ -10,6 +10,7 @@ import 
re  import sys  import struct
 from   datetime import date
+from functools import reduce
 
 # Generated file copyright header
 
@@ -90,11 +91,11 @@ class CLogicalExpression:
 self.string   = ''
 
 def errExit(self, err = ''):
-print "ERROR: Express parsing for:"
-print "   %s" % self.string
-print "   %s^" % (' ' * self.index)
+print ("ERROR: Express parsing for:")
+print ("   %s" % self.string)
+print ("   %s^" % (' ' * self.index))
 if err:
-print "INFO : %s" % err
+print ("INFO : %s" % err)
 raise SystemExit
 
 def getNonNumber (self, n1, n2):
@@ -338,15 +339,15 @@ EndList
 else:
 Error = 0
 if self.Debug:
-print "INFO : Macro dictionary:"
+print ("INFO : Macro dictionary:")
 for Each in self._MacroDict:
-print "   $(%s) = [ %s ]" % (Each , 
self._MacroDict[Each])
+print ("   $(%s) = [ %s ]" % (Each , 
self._MacroDict[Each]))
 return Error
 
 def EvaulateIfdef   (self, Macro):
 Result = Macro in self._MacroDict
 if self.Debug:
-print "INFO : Eval Ifdef [%s] : %s" % (Macro, Result)
+print ("INFO : Eval Ifdef [%s] : %s" % (Macro, Result))
 return  Result
 
 def ExpandMacros (self, Input):
@@ -359,7 +360,7 @@ EndList
   Line = Line.replace(Each, self._MacroDict[Variable])
   else:
   if self.Debug:
-  print "WARN : %s is not defined" % Each
+  print ("WARN : %s is not defined" % Each)
   Line = Line.replace(Each, Each[2:-1])
 return Line
 
@@ -372,7 +373,7 @@ EndList
   Line = Line.replace(PcdName, self._PcdsDict[PcdName])
   else:
   if self.Debug:
-  print "WARN : %s is not defined" % PcdName
+  print ("WARN : %s is not defined" % PcdName)
 return Line
 
 def EvaluateExpress (self, Expr):
@@ -381,7 +382,7 @@ EndList
 LogExpr = CLogicalExpression()
 Result  = LogExpr.evaluateExpress (ExpExpr)
 if self.Debug:
-print "INFO : Eval Express [%s] : %s" % (Expr, Result)
+print ("INFO : Eval Express [%s] : %s" % (Expr, Result))
 return Result
 
 def FormatListValue(self, ConfigDict):
@@ -406,9 +407,14 @@ EndList
 bytearray = []
 for each in dataarray:
 value = each
-for loop in xrange(unit):
-bytearray.append("0x%02X" % (value & 0xFF))
-value = value >> 8
+if sys.version_info < (3,0):
+for loop in xrange(unit):
+bytearray.append("0x%02X" % (value & 0xFF))
+value = value >> 8
+else:
+for loop in range(int(unit)):
+bytearray.append("0x%02X" % (value & 0xFF))
+value = value >> 8
 newvalue  = '{'  + ','.join(bytearray) + '}'
 ConfigDict['value'] = newvalue
 return ""
@@ -548,7 +554,7 @@ EndList
 if Match:
 self._MacroDict[

[edk2-devel] [edk2-platofrms] [patch v2] Platform/PurleyOpenBoardPkg: Remove --nt32 flag of edkseup

2019-06-27 Thread Dandan Bi
V2: Remove nmake -f %BASE_TOOLS_PATH%\Makefile, since it
has been covered by edksetup.bat Rebuild option.

Since Nt32Pkg has been removed from edk2 repo, and
we will also remove the --nt32 flag in edksetup.bat.
So here update platform to pass build.

Cc: Shifei A Lu 
Cc: Xiaohu Zhou 
Cc: Isaac W Oram 
Cc: Liming Gao 
Signed-off-by: Dandan Bi 
---
 .../BoardMtOlympus/GitEdk2MinMtOlympus.bat  | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git 
a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/GitEdk2MinMtOlympus.bat 
b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/GitEdk2MinMtOlympus.bat
index 02ed458236..6b4e90294b 100644
--- a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/GitEdk2MinMtOlympus.bat
+++ b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/GitEdk2MinMtOlympus.bat
@@ -46,20 +46,16 @@ set EDK_TOOLS_BIN=%WORKSPACE%\edk2-BaseTools-win32
 
 set EDK_SETUP_OPTION=
 @rem if python is installed, disable the binary base tools.
 if defined PYTHON_HOME (
   set EDK_TOOLS_BIN=
-  set EDK_SETUP_OPTION=--nt32
+  set EDK_SETUP_OPTION=Rebuild
 )
 pushd %WORKSPACE%\edk2
 call edksetup.bat %EDK_SETUP_OPTION%
 popd
 pushd %WORKSPACE%
-@rem if python is installed, nmake BaseTools source and enable BaseTools 
source build
-@if defined PYTHON_HOME (
-  nmake -f %BASE_TOOLS_PATH%\Makefile
-)
 popd
 
 set openssl_path=%WORKSPACE%
 
 popd
-- 
2.18.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42960): https://edk2.groups.io/g/devel/message/42960
Mute This Topic: https://groups.io/mt/32238555/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-platofrms] [patch v2] Platform/PurleyOpenBoardPkg: Remove --nt32 flag of edkseup

2019-06-27 Thread Liming Gao
Dandan:
  Don't need to add version info in the commit log. And, please also remove 
pushd %WORKSPACE% & popd. They are not used after nmake is removed. With those 
changes, Reviewed-by: Liming Gao 

Thanks
Liming
>-Original Message-
>From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
>Dandan Bi
>Sent: Friday, June 28, 2019 10:55 AM
>To: devel@edk2.groups.io
>Cc: Lu, Shifei A ; Zhou, Bowen
>; Oram, Isaac W ; Gao,
>Liming 
>Subject: [edk2-devel] [edk2-platofrms] [patch v2]
>Platform/PurleyOpenBoardPkg: Remove --nt32 flag of edkseup
>
>V2: Remove nmake -f %BASE_TOOLS_PATH%\Makefile, since it
>has been covered by edksetup.bat Rebuild option.
>
>Since Nt32Pkg has been removed from edk2 repo, and
>we will also remove the --nt32 flag in edksetup.bat.
>So here update platform to pass build.
>
>Cc: Shifei A Lu 
>Cc: Xiaohu Zhou 
>Cc: Isaac W Oram 
>Cc: Liming Gao 
>Signed-off-by: Dandan Bi 
>---
> .../BoardMtOlympus/GitEdk2MinMtOlympus.bat  | 6 +-
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
>diff --git
>a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/GitEdk2MinMtOly
>mpus.bat
>b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/GitEdk2MinMtOly
>mpus.bat
>index 02ed458236..6b4e90294b 100644
>---
>a/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/GitEdk2MinMtOly
>mpus.bat
>+++
>b/Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/GitEdk2MinMtOly
>mpus.bat
>@@ -46,20 +46,16 @@ set EDK_TOOLS_BIN=%WORKSPACE%\edk2-
>BaseTools-win32
>
> set EDK_SETUP_OPTION=
> @rem if python is installed, disable the binary base tools.
> if defined PYTHON_HOME (
>   set EDK_TOOLS_BIN=
>-  set EDK_SETUP_OPTION=--nt32
>+  set EDK_SETUP_OPTION=Rebuild
> )
> pushd %WORKSPACE%\edk2
> call edksetup.bat %EDK_SETUP_OPTION%
> popd
> pushd %WORKSPACE%
>-@rem if python is installed, nmake BaseTools source and enable BaseTools
>source build
>-@if defined PYTHON_HOME (
>-  nmake -f %BASE_TOOLS_PATH%\Makefile
>-)
> popd
>
> set openssl_path=%WORKSPACE%
>
> popd
>--
>2.18.0.windows.1
>
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42961): https://edk2.groups.io/g/devel/message/42961
Mute This Topic: https://groups.io/mt/32238555/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH] IntelFsp2Pkg: FSP Python scripts to support 3.x.

2019-06-27 Thread Chiu, Chasel


Yes. It works! I will update patch.

Thanks!
Chasel


> -Original Message-
> From: Zeng, Star
> Sent: Friday, June 28, 2019 10:28 AM
> To: devel@edk2.groups.io; Chiu, Chasel 
> Cc: Ma, Maurice ; Desimone, Nathaniel L
> ; Zeng, Star 
> Subject: RE: [edk2-devel] [PATCH] IntelFsp2Pkg: FSP Python scripts to support
> 3.x.
> 
> It is ok to directly use below code without python version check?
> 
> +for loop in range(int(unit)):
> +bytearray.append("0x%02X" % (value & 0xFF))
> +value = value >> 8
> 
> 
> Thanks,
> Star
> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Chiu,
> Chasel
> Sent: Monday, June 24, 2019 10:35 PM
> To: devel@edk2.groups.io
> Cc: Ma, Maurice ; Desimone, Nathaniel L
> ; Zeng, Star 
> Subject: [edk2-devel] [PATCH] IntelFsp2Pkg: FSP Python scripts to support 3.x.
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1930
> 
> Updated FSP Python scripts to support both 2.x and 3.x.
> 
> Test:
>   . Verified with Python 2.7.12 and 3.6.6.
>   . Verified tool result is the same before the change.
>   . Both py -2 and py -3 built binary can boot.
> 
> Cc: Maurice Ma 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> Signed-off-by: Chasel Chiu 
> ---
>  IntelFsp2Pkg/Tools/GenCfgOpt.py   | 70
> ++
>  IntelFsp2Pkg/Tools/PatchFv.py | 36 +++-
>  IntelFsp2Pkg/Tools/SplitFspBin.py | 74
> +++--
> -
>  3 files changed, 116 insertions(+), 64 deletions(-)
> 
> diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py
> b/IntelFsp2Pkg/Tools/GenCfgOpt.py index 450c4e3eb9..e0441966ac 100644
> --- a/IntelFsp2Pkg/Tools/GenCfgOpt.py
> +++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py
> @@ -1,6 +1,6 @@
>  ## @ GenCfgOpt.py
>  #
> -# Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
> +# Copyright (c) 2014 - 2019, Intel Corporation. All rights
> +reserved.
>  # SPDX-License-Identifier: BSD-2-Clause-Patent  #  ## @@ -10,6 +10,7 @@
> import re  import sys  import struct
>  from   datetime import date
> +from functools import reduce
> 
>  # Generated file copyright header
> 
> @@ -90,11 +91,11 @@ class CLogicalExpression:
>  self.string   = ''
> 
>  def errExit(self, err = ''):
> -print "ERROR: Express parsing for:"
> -print "   %s" % self.string
> -print "   %s^" % (' ' * self.index)
> +print ("ERROR: Express parsing for:")
> +print ("   %s" % self.string)
> +print ("   %s^" % (' ' * self.index))
>  if err:
> -print "INFO : %s" % err
> +print ("INFO : %s" % err)
>  raise SystemExit
> 
>  def getNonNumber (self, n1, n2):
> @@ -338,15 +339,15 @@ EndList
>  else:
>  Error = 0
>  if self.Debug:
> -print "INFO : Macro dictionary:"
> +print ("INFO : Macro dictionary:")
>  for Each in self._MacroDict:
> -print "   $(%s) = [ %s ]" % (Each , 
> self._MacroDict[Each])
> +print ("   $(%s) = [ %s ]" % (Each , 
> self._MacroDict[Each]))
>  return Error
> 
>  def EvaulateIfdef   (self, Macro):
>  Result = Macro in self._MacroDict
>  if self.Debug:
> -print "INFO : Eval Ifdef [%s] : %s" % (Macro, Result)
> +print ("INFO : Eval Ifdef [%s] : %s" % (Macro, Result))
>  return  Result
> 
>  def ExpandMacros (self, Input):
> @@ -359,7 +360,7 @@ EndList
>Line = Line.replace(Each, self._MacroDict[Variable])
>else:
>if self.Debug:
> -  print "WARN : %s is not defined" % Each
> +  print ("WARN : %s is not defined" % Each)
>Line = Line.replace(Each, Each[2:-1])
>  return Line
> 
> @@ -372,7 +373,7 @@ EndList
>Line = Line.replace(PcdName, self._PcdsDict[PcdName])
>else:
>if self.Debug:
> -  print "WARN : %s is not defined" % PcdName
> +  print ("WARN : %s is not defined" % PcdName)
>  return Line
> 
>  def EvaluateExpress (self, Expr):
> @@ -381,7 +382,7 @@ EndList
>  LogExpr = CLogicalExpression()
>  Result  = LogExpr.evaluateExpress (ExpExpr)
>  if self.Debug:
> -print "INFO : Eval Express [%s] : %s" % (Expr, Result)
> +print ("INFO : Eval Express [%s] : %s" % (Expr, Result))
>  return Result
> 
>  def FormatListValue(self, ConfigDict):
> @@ -406,9 +407,14 @@ EndList
>  bytearray = []
>  for each in dataarray:
>  value = each
> -for loop in xrange(unit):
> -bytearray.append("0x%02X" % (value & 0xFF))
> -value = val

Re: [edk2-devel] [PATCH] SecurityPkg/DxeDeferImageLoadLib: Remove DxeDeferImageLoadLib

2019-06-27 Thread Wang, Jian J
Reviewed-by: Jian J Wang 

> -Original Message-
> From: Zhang, Shenglei
> Sent: Thursday, June 20, 2019 9:31 AM
> To: devel@edk2.groups.io
> Cc: Zhang, Chao B ; Yao, Jiewen
> ; Wang, Jian J 
> Subject: [PATCH] SecurityPkg/DxeDeferImageLoadLib: Remove
> DxeDeferImageLoadLib
> 
> The library DxeDeferImageLoadLib supports UID feature and it is conflicted
> with the driver SecurityStubDxe (Defer3rdPartyImageLoad.c).
> And the UID feature is dropped. So it should be removed from SecurityPkg.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1919
> 
> Cc: Chao Zhang 
> Cc: Jiewen Yao 
> Cc: Jian Wang 
> Signed-off-by: Shenglei Zhang 
> ---
>  .../DxeDeferImageLoadLib.c| 927 --
>  .../DxeDeferImageLoadLib.h|  99 --
>  .../DxeDeferImageLoadLib.inf  |  63 --
>  .../DxeDeferImageLoadLib.uni  |  18 -
>  SecurityPkg/SecurityPkg.dsc   |   1 -
>  5 files changed, 1108 deletions(-)
>  delete mode 100644
> SecurityPkg/Library/DxeDeferImageLoadLib/DxeDeferImageLoadLib.c
>  delete mode 100644
> SecurityPkg/Library/DxeDeferImageLoadLib/DxeDeferImageLoadLib.h
>  delete mode 100644
> SecurityPkg/Library/DxeDeferImageLoadLib/DxeDeferImageLoadLib.inf
>  delete mode 100644
> SecurityPkg/Library/DxeDeferImageLoadLib/DxeDeferImageLoadLib.uni
> 
> diff --git
> a/SecurityPkg/Library/DxeDeferImageLoadLib/DxeDeferImageLoadLib.c
> b/SecurityPkg/Library/DxeDeferImageLoadLib/DxeDeferImageLoadLib.c
> deleted file mode 100644
> index a6a3fe3cfc68..
> --- a/SecurityPkg/Library/DxeDeferImageLoadLib/DxeDeferImageLoadLib.c
> +++ /dev/null
> @@ -1,927 +0,0 @@
> -/** @file
> -  Implement defer image load services for user identification in UEFI2.2.
> -
> -Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
> -SPDX-License-Identifier: BSD-2-Clause-Patent
> -
> -**/
> -
> -#include "DxeDeferImageLoadLib.h"
> -
> -//
> -// Handle for the Deferred Image Load Protocol instance produced by this
> driver.
> -//
> -EFI_HANDLE   mDeferredImageHandle = NULL;
> -BOOLEAN  mIsProtocolInstalled = FALSE;
> -EFI_USER_MANAGER_PROTOCOL*mUserManager= NULL;
> -DEFERRED_IMAGE_TABLE mDeferredImage   = {
> -  0,   // Deferred image count
> -  NULL // The deferred image info
> -};
> -
> -EFI_DEFERRED_IMAGE_LOAD_PROTOCOL gDeferredImageLoad   = {
> -  GetDefferedImageInfo
> -};
> -
> -/**
> -  Get the image type.
> -
> -  @param[in]FileThis is a pointer to the device path of the file
> -that is being dispatched.
> -
> -  @return   UINT32  Image Type
> -
> -**/
> -UINT32
> -GetFileType (
> -  IN  CONST EFI_DEVICE_PATH_PROTOCOL   *File
> -  )
> -{
> -  EFI_STATUSStatus;
> -  EFI_HANDLEDeviceHandle;
> -  EFI_DEVICE_PATH_PROTOCOL  *TempDevicePath;
> -  EFI_BLOCK_IO_PROTOCOL *BlockIo;
> -
> -  //
> -  // First check to see if File is from a Firmware Volume
> -  //
> -  DeviceHandle  = NULL;
> -  TempDevicePath = (EFI_DEVICE_PATH_PROTOCOL *)File;
> -  Status = gBS->LocateDevicePath (
> -  &gEfiFirmwareVolume2ProtocolGuid,
> -  &TempDevicePath,
> -  &DeviceHandle
> -  );
> -  if (!EFI_ERROR (Status)) {
> -Status = gBS->OpenProtocol (
> -DeviceHandle,
> -&gEfiFirmwareVolume2ProtocolGuid,
> -NULL,
> -NULL,
> -NULL,
> -EFI_OPEN_PROTOCOL_TEST_PROTOCOL
> -);
> -if (!EFI_ERROR (Status)) {
> -  return IMAGE_FROM_FV;
> -}
> -  }
> -
> -  //
> -  // Next check to see if File is from a Block I/O device
> -  //
> -  DeviceHandle   = NULL;
> -  TempDevicePath = (EFI_DEVICE_PATH_PROTOCOL *)File;
> -  Status = gBS->LocateDevicePath (
> -  &gEfiBlockIoProtocolGuid,
> -  &TempDevicePath,
> -  &DeviceHandle
> -  );
> -  if (!EFI_ERROR (Status)) {
> -BlockIo = NULL;
> -Status = gBS->OpenProtocol (
> -DeviceHandle,
> -&gEfiBlockIoProtocolGuid,
> -(VOID **) &BlockIo,
> -NULL,
> -NULL,
> -EFI_OPEN_PROTOCOL_GET_PROTOCOL
> -);
> -if (!EFI_ERROR (Status) && BlockIo != NULL) {
> -  if (BlockIo->Media != NULL) {
> -if (BlockIo->Media->RemovableMedia) {
> -  //
> -  // Block I/O is present and specifies the media is removable
> -  //
> -  return IMAGE_FROM_REMOVABLE_MEDIA;
> -} else {
> -  //
> -  // Block I/O is present and specifies the media is not removable
> -  //
> -  return IMAGE_FROM_FIXED_MEDIA;
> -}
> -  }
> -}
> -  }
> -
> -  //
> -  // File is 

[edk2-devel] [PATCH] ArmPkg: Fix various typos

2019-06-27 Thread Cœur
Fix various typos in ArmPkg.
Same as https://github.com/tianocore/edk2/pull/143/files

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42964): https://edk2.groups.io/g/devel/message/42964
Mute This Topic: https://groups.io/mt/32238697/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



patch.diff
Description: Binary data


[edk2-devel] [Patch 1/1] BaseTools: Detect the change of env variable used in tooldef.txt

2019-06-27 Thread Bob Feng
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1921

Add TOOLS_DEF.ARCH file to all workspace meta files list.
TOOLS_DEF.ARCH include the evaluated Tool definition information
which is filtered by current tool_chain.

With this change, when the environment variable which
is used in ToolDef.txt is changed, build tool will
rebuild the platform.

Signed-off-by: Bob Feng 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Steven Shi 
---
 BaseTools/Source/Python/AutoGen/AutoGen.py | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index e8e09dc8a366..24592593c868 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -792,10 +792,13 @@ class WorkspaceAutoGen(AutoGen):
 
 # add PcdToken Number file for Dynamic/DynamicEx Pcd
 #
 AllWorkSpaceMetaFiles.add(os.path.join(self.BuildDir, 
'PcdTokenNumber'))
 
+for Pa in self.AutoGenObjectList:
+AllWorkSpaceMetaFiles.add(Pa.ToolDefinitionFile)
+
 for Arch in self.ArchList:
 #
 # add dec
 #
 for Package in PlatformAutoGen(self, self.MetaFile, Target, 
Toolchain, Arch).PackageList:
@@ -1859,11 +1862,11 @@ class PlatformAutoGen(AutoGen):
 def ToolDefinition(self):
 ToolDefinition = self.Workspace.ToolDef.ToolsDefTxtDictionary
 if TAB_TOD_DEFINES_COMMAND_TYPE not in 
self.Workspace.ToolDef.ToolsDefTxtDatabase:
 EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, "No tools found 
in configuration",
 ExtraData="[%s]" % self.MetaFile)
-RetVal = {}
+RetVal = OrderedDict()
 DllPathList = set()
 for Def in ToolDefinition:
 Target, Tag, Arch, Tool, Attr = Def.split("_")
 if Target != self.BuildTarget or Tag != self.ToolChain or Arch != 
self.Arch:
 continue
@@ -1873,11 +1876,11 @@ class PlatformAutoGen(AutoGen):
 if Attr == "DLL":
 DllPathList.add(Value)
 continue
 
 if Tool not in RetVal:
-RetVal[Tool] = {}
+RetVal[Tool] = OrderedDict()
 RetVal[Tool][Attr] = Value
 
 ToolsDef = ''
 if GlobalData.gOptions.SilentMode and "MAKE" in RetVal:
 if "FLAGS" not in RetVal["MAKE"]:
-- 
2.20.1.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42965): https://edk2.groups.io/g/devel/message/42965
Mute This Topic: https://groups.io/mt/32238757/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH] ArmPlatformPkg: Fix various typos

2019-06-27 Thread Cœur
>From 0fdb05b34e5bfdcbd92d21cdf446eec06cf9035f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Antoine=20C=C5=93ur?= 
Date: Wed, 6 Feb 2019 23:40:38 +0800
Subject: [PATCH] ArmPlatformPkg: Fix various typos

Fix various typos in ArmPlatformPkg.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Coeur 
---
ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c   | 4 ++--
ArmPlatformPkg/Include/Library/ArmPlatformLib.h    | 2 +-
ArmPlatformPkg/Include/Library/PL011UartLib.h      | 2 +-
ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c | 2 +-
ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c      | 2 +-
ArmPlatformPkg/PlatformPei/PlatformPeim.c          | 2 +-
ArmPlatformPkg/PrePeiCore/PrePeiCore.c             | 2 +-
ArmPlatformPkg/PrePi/PrePi.c                       | 2 +-
8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c 
b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
index 468dd00ae8..d9e196cbf1 100644
--- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
+++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
@@ -1109,7 +1109,7 @@ NorFlashWriteSingleBlock (
@retval EFI_SUCCESS           The data was read correctly from the device.
@retval EFI_DEVICE_ERROR      The device reported an error while performing the 
read.
@retval EFI_NO_MEDIA          There is no media in the device.
-  @retval EFI_MEDIA_CHNAGED     The MediaId does not matched the current 
device.
+  @retval EFI_MEDIA_CHANGED     The MediaId does not match the current device.
@retval EFI_INVALID_PARAMETER The read request contains device addresses that 
are not
valid for the device.

@@ -1154,7 +1154,7 @@ NorFlashDiskIoReadDisk (
@retval EFI_WRITE_PROTECTED   The device can not be written to.
@retval EFI_DEVICE_ERROR      The device reported an error while performing the 
write.
@retval EFI_NO_MEDIA          There is no media in the device.
-  @retval EFI_MEDIA_CHNAGED     The MediaId does not matched the current 
device.
+  @retval EFI_MEDIA_CHANGED     The MediaId does not match the current device.
@retval EFI_INVALID_PARAMETER The write request contains device addresses that 
are not
valid for the device.

diff --git a/ArmPlatformPkg/Include/Library/ArmPlatformLib.h 
b/ArmPlatformPkg/Include/Library/ArmPlatformLib.h
index b6cd647d05..225183af2c 100644
--- a/ArmPlatformPkg/Include/Library/ArmPlatformLib.h
+++ b/ArmPlatformPkg/Include/Library/ArmPlatformLib.h
@@ -14,7 +14,7 @@
//
#include 
//
-// The protocols, PPI and GUID defintions for this module
+// The protocols, PPI and GUID definitions for this module
//
#include 
#include 
diff --git a/ArmPlatformPkg/Include/Library/PL011UartLib.h 
b/ArmPlatformPkg/Include/Library/PL011UartLib.h
index 7108587350..3bd2e294b0 100644
--- a/ArmPlatformPkg/Include/Library/PL011UartLib.h
+++ b/ArmPlatformPkg/Include/Library/PL011UartLib.h
@@ -112,7 +112,7 @@ PL011UartSetControl (
. EFI_SERIAL_OUTPUT_BUFFER_EMPTY : equal to one if the
transmit buffer is empty, 0 otherwise.
. EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE : equal to one if
-                           the hardware loopback is enabled (the ouput feeds 
the
+                           the hardware loopback is enabled (the output feeds 
the
receive buffer), 0 otherwise.
. EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE : equal to one if
a loopback is accomplished by software, 0 otherwise.
diff --git a/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c 
b/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c
index 20a53be02e..801990d955 100644
--- a/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c
+++ b/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c
@@ -321,7 +321,7 @@ PL011UartSetControl (
. EFI_SERIAL_OUTPUT_BUFFER_EMPTY : equal to one if the
transmit buffer is empty, 0 otherwise.
. EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE : equal to one if
-                           the hardware loopback is enabled (the ouput feeds 
the
+                           the hardware loopback is enabled (the output feeds 
the
receive buffer), 0 otherwise.
. EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE : equal to one if
a loopback is accomplished by software, 0 otherwise.
diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c 
b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c
index 485dad0ac8..027fa11a89 100644
--- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c
+++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c
@@ -9,7 +9,7 @@
#include 

//
-// The protocols, PPI and GUID defintions for this module
+// The protocols, PPI and GUID definitions for this module
//
#include 
#include 
diff --git a/ArmPlatformPkg/PlatformPei/PlatformPeim.c 
b/ArmPlatformPkg/PlatformPei/PlatformPeim.c
index 27687e9c7e..ca5a31116a 100644
--- a/ArmPlatformPkg/PlatformPei/PlatformPeim.c
+++ b/ArmPlatformPkg/PlatformPei/PlatformPeim.c
@@ -9,7 +9,7 @@
#include 

//
-// The protocols, PPI and GUID defintions for this module
+// The protocols, PPI and GUID definitions for this module
//
#include 
#include 
diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c 

[edk2-devel] [PATCH] EmbeddedPkg: Fix various typos

2019-06-27 Thread Cœur
Fix various typos in EmbeddedPkg.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Coeur 
---
.../AndroidFastboot/AndroidBootImg.c          |  2 +-
.../AndroidFastboot/AndroidFastbootApp.c      |  2 +-
.../Drivers/ConsolePrefDxe/ConsolePrefDxe.c   |  2 +-
.../Drivers/DtPlatformDxe/DtPlatformDxe.c     |  2 +-
.../Drivers/Isp1761UsbDxe/Isp1761UsbDxe.c     |  4 ++--
EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118Dxe.c   |  2 +-
EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118DxeHw.h |  2 +-
.../Drivers/Lan9118Dxe/Lan9118DxeUtil.c       |  2 +-
EmbeddedPkg/Drivers/Lan91xDxe/Lan91xDxe.c     |  2 +-
EmbeddedPkg/Drivers/Lan91xDxe/Lan91xDxeHw.h   |  2 +-
.../SataSiI3132Dxe/SiI3132AtaPassThru.c       |  2 +-
EmbeddedPkg/EmbeddedPkg.dsc                   |  2 +-
EmbeddedPkg/GdbStub/Arm/Processor.c           |  2 +-
EmbeddedPkg/GdbStub/GdbStub.c                 | 20 
EmbeddedPkg/GdbStub/GdbStubInternal.h         | 24 +--
EmbeddedPkg/GdbStub/Ia32/Processor.c          |  4 ++--
EmbeddedPkg/GdbStub/SerialIo.c                | 24 +--
EmbeddedPkg/GdbStub/X64/Processor.c           |  4 ++--
.../Include/Library/DebugAgentTimerLib.h      |  2 +-
EmbeddedPkg/Include/Library/EfiFileLib.h      |  6 ++---
EmbeddedPkg/Include/Library/GdbSerialLib.h    |  8 +++
EmbeddedPkg/Include/Library/PrePiLib.h        |  4 ++--
.../Protocol/AndroidFastbootPlatform.h        |  4 ++--
.../Include/Protocol/HardwareInterrupt.h      |  2 +-
EmbeddedPkg/Include/Protocol/PeCoffLoader.h   |  4 ++--
.../DebugAgentTimerLib.c                      |  2 +-
.../GdbSerialDebugPortLib.c                   |  8 +++
.../Library/GdbSerialLib/GdbSerialLib.c       |  8 +++
EmbeddedPkg/Library/PrePiHobLib/Hob.c         |  2 +-
EmbeddedPkg/Library/PrePiLib/FwVol.c          |  4 ++--
.../MemoryAllocationLib.c                     |  2 +-
.../RealTimeClockLib.c                        |  4 ++--
.../SimpleTextInOutSerial/SimpleTextInOut.c   |  2 +-
EmbeddedPkg/Universal/MmcDxe/Mmc.h            |  2 +-
34 files changed, 84 insertions(+), 84 deletions(-)

diff --git a/EmbeddedPkg/Application/AndroidFastboot/AndroidBootImg.c 
b/EmbeddedPkg/Application/AndroidFastboot/AndroidBootImg.c
index 896ad29afc..54b7bee162 100644
--- a/EmbeddedPkg/Application/AndroidFastboot/AndroidBootImg.c
+++ b/EmbeddedPkg/Application/AndroidFastboot/AndroidBootImg.c
@@ -9,7 +9,7 @@
#include "AndroidFastbootApp.h"

// Find the kernel and ramdisk in an Android boot.img.
-// return EFI_INVALID_PARAMTER if the boot.img is invalid (i.e. doesn't have 
the
+// return EFI_INVALID_PARAMETER if the boot.img is invalid (i.e. doesn't have 
the
//  right magic value),
// return EFI_NOT_FOUND if there was no kernel in the boot.img.
// Note that the Ramdisk is optional - *Ramdisk won't be touched if it isn't
diff --git a/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c 
b/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c
index c8e89173e6..3e3f4b7eb2 100644
--- a/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c
+++ b/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c
@@ -300,7 +300,7 @@ AcceptCmd (
} else if (IS_LOWERCASE_ASCII (Command[0])) {
// Commands starting with lowercase ASCII characters are reserved for the
// Fastboot protocol. If we don't recognise it, it's probably the future
-    // and there are new commmands in the protocol.
+    // and there are new commands in the protocol.
// (By the way, the "oem" command mentioned above makes this reservation
//  redundant, but we handle it here to be spec-compliant)
SEND_LITERAL ("FAILCommand not recognised. Check Fastboot version.");
diff --git a/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c 
b/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c
index 8d0ffbe88d..c250844eda 100644
--- a/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c
+++ b/EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefDxe.c
@@ -224,7 +224,7 @@ OnReadyToBoot (
@retval EFI_ALREADY_STARTED     The driver already exists in system.
@retval EFI_OUT_OF_RESOURCES    Fail to execute entry point due to lack of
resources.
-  @retval EFI_SUCCES              All the related protocols are installed on
+  @retval EFI_SUCCESS             All the related protocols are installed on
the driver.

**/
diff --git a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c 
b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c
index 5ec95f7491..907d46a495 100644
--- a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c
+++ b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c
@@ -92,7 +92,7 @@ InstallHiiPages (
@retval EFI_ALREADY_STARTED     The driver already exists in system.
@retval EFI_OUT_OF_RESOURCES    Fail to execute entry point due to lack of
resources.
-  @retval EFI_SUCCES              All the related protocols are installed on
+  @retval EFI_SUCCESS             All the related protocols are installed on
the driver.

**/
diff --git a/EmbeddedPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.c 
b/EmbeddedPkg/D

[edk2-devel] [PATCH 3/3] MdePkg/BaseLib: Base64Decode: Add decription for RETURN_SUCCESS

2019-06-27 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1891

While the convertion Base64 ascii string is null string (the
string only contain white space would be regard as null string),
there would be no decodeable data. Set *DestinationSize to zero
and return RETURN_SUCCESS. But it is not mention in the comment
of the function. So add this decription.

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Laszlo Ersek 
Signed-off-by: Zhichao Gao 
---
 MdePkg/Library/BaseLib/String.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c
index 7ebc2ecddd..8829d2cbbf 100644
--- a/MdePkg/Library/BaseLib/String.c
+++ b/MdePkg/Library/BaseLib/String.c
@@ -1929,7 +1929,8 @@ Base64Encode (
   @param DestinationSize   Caller is responsible for passing in buffer of at 
least DestinationSize.
Set 0 to get the size needed. Set to bytes stored 
on return.
 
-  @retval RETURN_SUCCESS When binary buffer is filled in.
+  @retval RETURN_SUCCESS When binary buffer is filled in. Or if 
the Base64 ascii string is empty, set
+ *DestinationSize to zero to indicate this 
case.
   @retval RETURN_INVALID_PARAMETER   If Source is NULL or DestinationSize is 
NULL.
   @retval RETURN_INVALID_PARAMETER   If SourceLength or DestinationSize is 
bigger than (MAX_ADDRESS -(UINTN)Destination ).
   @retval RETURN_INVALID_PARAMETER   If there is any invalid character in 
input stream.
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42971): https://edk2.groups.io/g/devel/message/42971
Mute This Topic: https://groups.io/mt/32238990/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 1/3] MdePkg/BaseLib: Adjust the coding style in Base64Decode

2019-06-27 Thread Gao, Zhichao
Adjust the code style for better view.

Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Zhichao Gao 
---
 MdePkg/Library/BaseLib/String.c | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c
index 32e189791c..b86e7e9436 100644
--- a/MdePkg/Library/BaseLib/String.c
+++ b/MdePkg/Library/BaseLib/String.c
@@ -1993,8 +1993,7 @@ Base64Decode (
   if (BufferSize < -2) {
 return RETURN_INVALID_PARAMETER;
   }
-}
-else {
+} else {
   Chr = Source[SourceIndex];
   if (BAD_V != DecodingTable[(UINT8) Chr]) {
 
@@ -2006,8 +2005,7 @@ Base64Decode (
   return RETURN_INVALID_PARAMETER;
 }
   ActualSourceLength++;
-  }
-else {
+  } else {
 
 //
 // The reset of the decoder will ignore all invalid characters allowed 
here.
@@ -2029,8 +2027,8 @@ Base64Decode (
   }
 
   BufferSize += ActualSourceLength / 4 * 3;
-if (BufferSize < 0) {
-  return RETURN_INVALID_PARAMETER;
+  if (BufferSize < 0) {
+return RETURN_INVALID_PARAMETER;
   }
 
   //
@@ -2061,7 +2059,7 @@ Base64Decode (
 //
 for (Index = 0; Index < 4; Index++) {
   do {
-  Chr = DecodingTable[(UINT8) Source[SourceIndex++]];
+Chr = DecodingTable[(UINT8) Source[SourceIndex++]];
   } while (Chr == BAD_V);
   Value <<= 6;
   Value |= (UINT32)Chr;
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42969): https://edk2.groups.io/g/devel/message/42969
Mute This Topic: https://groups.io/mt/32238988/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 0/3] MdePkg/BaseLib: Base64Decode: Make it follow its specification

2019-06-27 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1891

Adjust the coding style.
Set DestinationSize before return.
Add addition decription for the RETURN_SUCCESS case.

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Marvin Hauser 
Cc: Laszlo Ersek 

Zhichao Gao (3):
  MdePkg/BaseLib: Adjust the coding style in Base64Decode
  MdePkg/BaseLib: Base64Decode: Make DestinationSize complied to spec
  MdePkg/BaseLib: Base64Decode: Add decription for RETURN_SUCCESS

 MdePkg/Library/BaseLib/String.c | 28 ++--
 1 file changed, 18 insertions(+), 10 deletions(-)

-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42968): https://edk2.groups.io/g/devel/message/42968
Mute This Topic: https://groups.io/mt/32238987/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 2/3] MdePkg/BaseLib: Base64Decode: Make DestinationSize complied to spec

2019-06-27 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1891

DestinationSize is decripted as 'Set to bytes stored on return'.
Before return the status, set its converted bytes to be complied
to the decriptions.
DestinationIndex may be overflow if the *DestinationSize is bigger
than (MAX_ADDRESS - 1). Move its incrementation under condition
'DestinationIndex < *DestinationSize' to make sure it wouldn't be
overflow.

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Marvin Hauser 
Cc: Laszlo Ersek 
Signed-off-by: Zhichao Gao 
---
 MdePkg/Library/BaseLib/String.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c
index b86e7e9436..7ebc2ecddd 100644
--- a/MdePkg/Library/BaseLib/String.c
+++ b/MdePkg/Library/BaseLib/String.c
@@ -1964,6 +1964,7 @@ Base64Decode (
   // Check if SourceLength or  DestinationSize is valid
   //
   if ((SourceLength >= (MAX_ADDRESS - (UINTN)Source)) || (*DestinationSize >= 
(MAX_ADDRESS - (UINTN)Destination))){
+*DestinationSize = 0;
 return RETURN_INVALID_PARAMETER;
   }
 
@@ -1991,6 +1992,7 @@ Base64Decode (
   // Only two '=' characters can be valid.
   //
   if (BufferSize < -2) {
+*DestinationSize = 0;
 return RETURN_INVALID_PARAMETER;
   }
 } else {
@@ -2002,6 +2004,7 @@ Base64Decode (
 // valid character after an '=', will be flagged as an error.
 //
 if (BufferSize < 0) {
+  *DestinationSize = 0;
   return RETURN_INVALID_PARAMETER;
 }
   ActualSourceLength++;
@@ -2013,6 +2016,7 @@ Base64Decode (
 // ignore ' ', '\t', '\n', and '\r'.
 //
 if ((Chr != ' ') &&(Chr != '\t') &&(Chr != '\n') &&(Chr != '\r')) {
+  *DestinationSize = 0;
   return RETURN_INVALID_PARAMETER;
 }
   }
@@ -2023,11 +2027,13 @@ Base64Decode (
   // The Base64 character string must be a multiple of 4 character quantums.
   //
   if (ActualSourceLength % 4 != 0) {
+*DestinationSize = 0;
 return RETURN_INVALID_PARAMETER;
   }
 
   BufferSize += ActualSourceLength / 4 * 3;
   if (BufferSize < 0) {
+*DestinationSize = 0;
 return RETURN_INVALID_PARAMETER;
   }
 
@@ -2075,13 +2081,16 @@ Base64Decode (
 // Due to the '=' special cases for the two bytes at the end,
 // we have to check the length and not store the padding data
 //
-if (DestinationIndex++ < *DestinationSize) {
+if (DestinationIndex < *DestinationSize) {
+  DestinationIndex++;
   *Destination++ = (UINT8) (Value >>  8);
 }
-if (DestinationIndex++ < *DestinationSize) {
+if (DestinationIndex < *DestinationSize) {
+  DestinationIndex++;
   *Destination++ = (UINT8) Value;
 }
   }
+  *DestinationSize = DestinationIndex;
 
   return RETURN_SUCCESS;
 }
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42970): https://edk2.groups.io/g/devel/message/42970
Mute This Topic: https://groups.io/mt/32238989/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH] ArmVirtPkg: handle NETWORK_TLS_ENABLE in ArmVirtQemu*

2019-06-27 Thread Gary Lin
On Mon, Jun 24, 2019 at 09:13:36PM +0200, Laszlo Ersek wrote:
> Port the [LibraryClasses], [PcdsFixedAtBuild] and [Components] settings
> that are related to NETWORK_TLS_ENABLE from OvmfPkg to ArmVirtPkg.
> ArmVirtXen is not modified because it doesn't include the edk2 network
> stack.
> 
> (This change is now simpler than it would have been when TianoCore#1009
> was originally filed, due to ArmVirtPkg consuming the NetworkPkg include
> fragments meanwhile, from TianoCore#1293 / commit 157a3b1aa50f.)
> 
> The usage hints from "OvmfPkg/README", section "HTTPS Boot", apply.
> 
I tested both HTTPS IPv4 and IPv6, and it worked as expected.
The bootloader was loaded after enrolling the correct certificate, and
the firmware rejected the connection when enrolling the wrong
certificate.

Tested-by: Gary Lin 

> Cc: Ard Biesheuvel 
> Cc: Gary Lin 
> Cc: Guillaume GARDET 
> Cc: Julien Grall 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1009
> Signed-off-by: Laszlo Ersek 
> ---
> 
> Notes:
> Repo:   https://github.com/lersek/edk2.git
> Branch: armvirt_tls_bz1009
> 
>  ArmVirtPkg/ArmVirt.dsc.inc   |  7 +++
>  ArmVirtPkg/ArmVirtQemu.dsc   | 18 ++
>  ArmVirtPkg/ArmVirtQemuKernel.dsc | 18 ++
>  3 files changed, 35 insertions(+), 8 deletions(-)
> 
> diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
> index 20bf011617a1..a4ae25d982a2 100644
> --- a/ArmVirtPkg/ArmVirt.dsc.inc
> +++ b/ArmVirtPkg/ArmVirt.dsc.inc
> @@ -71,6 +71,9 @@ [LibraryClasses.common]
>
># Networking Requirements
>  !include NetworkPkg/NetworkLibs.dsc.inc
> +!if $(NETWORK_TLS_ENABLE) == TRUE
> +  TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
> +!endif
>
>
>#
> @@ -136,7 +139,11 @@ [LibraryClasses.common]
># CryptoPkg libraries needed by multiple firmware features
>#
>IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> +!if $(NETWORK_TLS_ENABLE) == TRUE
> +  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> +!else
>OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
> +!endif
>BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
>
>#
> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
> index cf28478977e1..7ae6702ac1f0 100644
> --- a/ArmVirtPkg/ArmVirtQemu.dsc
> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
> @@ -43,10 +43,6 @@ [Defines]
>!error "NETWORK_SNP_ENABLE is IA32/X64/EBC only"
>  !endif
>
> -!if $(NETWORK_TLS_ENABLE) == TRUE
> -  !error "NETWORK_TLS_ENABLE is tracked at 
> "
> -!endif
> -
>  !include NetworkPkg/NetworkDefines.dsc.inc
>
>  !include ArmVirtPkg/ArmVirt.dsc.inc
> @@ -113,6 +109,14 @@ [PcdsFixedAtBuild.common]
>gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize|0x4000
>gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
>gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize|0x2800
> +!if $(NETWORK_TLS_ENABLE) == TRUE
> +  #
> +  # The cumulative and individual VOLATILE variable size limits should be set
> +  # high enough for accommodating several and/or large CA certificates.
> +  #
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0x8
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVolatileVariableSize|0x4
> +!endif
>
># Size of the region used by UEFI in permanent memory (Reserved 64MB)
>gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x0400
> @@ -372,6 +376,12 @@ [Components.common]
># Networking stack
>#
>  !include NetworkPkg/NetworkComponents.dsc.inc
> +!if $(NETWORK_TLS_ENABLE) == TRUE
> +  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf {
> +
> +  NULL|OvmfPkg/Library/TlsAuthConfigLib/TlsAuthConfigLib.inf
> +  }
> +!endif
>
>#
># SCSI Bus and Disk Driver
> diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc 
> b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> index 596e59739cab..3b0f04967a4b 100644
> --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
> +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
> @@ -43,10 +43,6 @@ [Defines]
>!error "NETWORK_SNP_ENABLE is IA32/X64/EBC only"
>  !endif
>
> -!if $(NETWORK_TLS_ENABLE) == TRUE
> -  !error "NETWORK_TLS_ENABLE is tracked at 
> "
> -!endif
> -
>  !include NetworkPkg/NetworkDefines.dsc.inc
>
>  !include ArmVirtPkg/ArmVirt.dsc.inc
> @@ -118,6 +114,14 @@ [PcdsFixedAtBuild.common]
>gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize|0x4000
>gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
>gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize|0x2800
> +!if $(NETWORK_TLS_ENABLE) == TRUE
> +  #
> +  # The cumulative and individual VOLATILE variable size limits should be set
> +  # high enough for accommodating several and/or large CA certificates.
> +  #
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0x8
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVolatileVariableSize|0x4
> +!endif
>
># Size of the region used by UEFI in permanent memory (Reserved 64

Re: [edk2-devel] [PATCH] MinPlatformPkg: FSP Python script to python 3.x.

2019-06-27 Thread Bob Feng
Patch looks good.

Reviewed-by: Bob Feng 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42973): https://edk2.groups.io/g/devel/message/42973
Mute This Topic: https://groups.io/mt/32192703/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v4 0/2] MdeModulePkg/SdMmcHcDxe: Implement revision 3 of SdMmcOverrideProtocol

2019-06-27 Thread Marcin Wojtas
Hi,

I was almost happily sending you email with 'tested-by' information, but I
checked 3 boards:
Board 1 (out of tree): SD - OK, MMC - OK
Board 2: (Armada80x0McBin): SD - OK, MMC - OK
Board 3: (Armada70x0Db): SD - problems, MMC - OK

In the latter case I get stall and booting takes around 3 minutes.
Without "MdeModulePkg/SdMmcHcDxe: Implement revision 3 of
SdMmcOverrideProtocol" patch it works as before.

I enabled debugs, and in theory everything seems fine, the DriverStrength
is set to EDKII_SD_MMC_DRIVER_STRENGTH_IGNORE.
SdCardIdentification: Found a SD device at slot [0]
SdCardSetBusMode: Target bus mode: bus timing = 1, bus width = 4, clock
freq[MHz] = 50, driver strength = 255

However right after Csd register dump the booting stalls until printing
following and continuing:
FatOpenDevice: read of part_lba failed Time out

This is absent from the prints I dumped from vanilla kernel. Despite I
currently really have no time to additional debug, I checked and with
following diff, everything works as before:

--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
@@ -536,8 +536,8 @@ SdCardSwitch (
   AccessMode = 0xF;
   }

-  SdMmcCmdBlk.CommandArgument = (AccessMode & 0xF) | ((CommandSystem &
0xF) << 4) | \
-((DriverStrength & 0xF) << 8) |
((PowerLimit & 0xF) << 12) | \
+  SdMmcCmdBlk.CommandArgument = (AccessMode & 0xF) | ((PowerLimit & 0xF)
<< 4) | \^M
+((DriverStrength & 0xF) << 8) |
((DriverStrength & 0xF) << 12) | \^M
 ModeValue;

Above is restoring SdMmcCmdBlk.CommandArgument to the state from before the
patch in question. Now the question - why the layout of the command
changed? CommandSystem was unused before, and PowerLimit changed its
position. Is this change really related to the rest of the patch? What is
the justification?

Best regards,
Marcin


pt., 28 cze 2019 o 02:57 Wu, Hao A  napisał(a):

> > -Original Message-
> > From: Sumit Garg [mailto:sumit.g...@linaro.org]
> > Sent: Thursday, June 27, 2019 9:39 PM
> > To: Ard Biesheuvel
> > Cc: edk2-devel-groups-io; Wu, Hao A; Marcin Wojtas; Albecki, Mateusz
> > Subject: Re: [edk2-devel] [PATCH v4 0/2] MdeModulePkg/SdMmcHcDxe:
> > Implement revision 3 of SdMmcOverrideProtocol
> >
> > On Thu, 27 Jun 2019 at 13:40, Ard Biesheuvel 
> > wrote:
> > >
> > > (+ Sumit)
> > >
> > > On Thu, 27 Jun 2019 at 08:29, Wu, Hao A  wrote:
> > > >
> > > > > -Original Message-
> > > > > From: Marcin Wojtas [mailto:m...@semihalf.com]
> > > > > Sent: Thursday, June 27, 2019 2:25 PM
> > > > > To: Albecki, Mateusz
> > > > > Cc: edk2-devel-groups-io; Wu, Hao A
> > > > > Subject: Re: [edk2-devel] [PATCH v4 0/2]
> > MdeModulePkg/SdMmcHcDxe:
> > > > > Implement revision 3 of SdMmcOverrideProtocol
> > > > >
> > > > > Hi Mateusz,
> > > > >
> > > > > Can you please push those patches somewhere (github?) so that I can
> > > > > easily do a quick check for regression?
> > > > >
> > > > > Thanks,
> > > > > Marcin
> > > >
> > > >
> > > > Hello Marcin,
> > > >
> > > > I have just pushed the series at:
> > > > https://github.com/hwu25/edk2/tree/sdmmc_override_extend_v4
> > > >
> > > > Please help to check.
> > > >
> > >
> > > I have cc'ed my colleague Sumit, who has kindly agreed to regression
> > > test this branch on Socionext SynQuacer, which also uses the SD/MMC
> > > override infrastructure.
> > >
> > > Sumit, please reply here with your results. And thanks again!
> >
> > I did picked this patch-set and applied on top of edk2 master branch.
> > It works well on SynQuacer with eMMC device enumerated properly and
> > all three eMMC partitions are visible:
> >
> >  BLK4: Alias(s):
> >   VenHw(0D51905B-B77E-452A-A2C0-
> > ECA0CC8D514A,305200)/eMMC(0x
> > 0)/Ctrl(0x0)
> >  BLK5: Alias(s):
> >   VenHw(0D51905B-B77E-452A-A2C0-
> > ECA0CC8D514A,305200)/eMMC(0x
> > 0)/Ctrl(0x1)
> >  BLK6: Alias(s):
> >   VenHw(0D51905B-B77E-452A-A2C0-
> > ECA0CC8D514A,305200)/eMMC(0x
> > 0)/Ctrl(0x2)
> >
> > Shell> devices
> > 
> >   E9 D - -  1  1   0 VenHw(0D51905B-B77E-452A-A2C0-
> > ECA0CC8D514A,3052
> > 00)/eMMC(0x0)/Ctrl(0x0)
> >   EA D - -  1  1   0 VenHw(0D51905B-B77E-452A-A2C0-
> > ECA0CC8D514A,3052
> > 00)/eMMC(0x0)/Ctrl(0x1)
> >   EB D - -  1  1   0 VenHw(0D51905B-B77E-452A-A2C0-
> > ECA0CC8D514A,3052
> > 00)/eMMC(0x0)/Ctrl(0x2)
> >
> > So you can add following:
> >
> > Regression-tested-by: Sumit Garg 
>
>
> Thanks a lot for the testing.
>
> Best Regards,
> Hao Wu
>
>
> >
> > -Sumit
>
> 
>
>

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42974): https://edk2.groups.io/g/devel/message/42974
Mute This Topic: https://groups.io/mt/32214570/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-

Re: [edk2-devel] [PATCH v4 0/2] MdeModulePkg/SdMmcHcDxe: Implement revision 3 of SdMmcOverrideProtocol

2019-06-27 Thread Marcin Wojtas
pt., 28 cze 2019 o 08:32 Marcin Wojtas  napisał(a):
>
> Hi,
>
> I was almost happily sending you email with 'tested-by' information, but I 
> checked 3 boards:
> Board 1 (out of tree): SD - OK, MMC - OK
> Board 2: (Armada80x0McBin): SD - OK, MMC - OK
> Board 3: (Armada70x0Db): SD - problems, MMC - OK
>
> In the latter case I get stall and booting takes around 3 minutes.
> Without "MdeModulePkg/SdMmcHcDxe: Implement revision 3 of 
> SdMmcOverrideProtocol" patch it works as before.
>
> I enabled debugs, and in theory everything seems fine, the DriverStrength is 
> set to EDKII_SD_MMC_DRIVER_STRENGTH_IGNORE.
> SdCardIdentification: Found a SD device at slot [0]
> SdCardSetBusMode: Target bus mode: bus timing = 1, bus width = 4, clock 
> freq[MHz] = 50, driver strength = 255
>
> However right after Csd register dump the booting stalls until printing 
> following and continuing:
> FatOpenDevice: read of part_lba failed Time out
>
> This is absent from the prints I dumped from vanilla kernel. Despite I 
> currently really have no time to additional debug, I
checked and with following diff, everything works as before:

vanilla edk2 of course :)

>
> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
> @@ -536,8 +536,8 @@ SdCardSwitch (
>AccessMode = 0xF;
>}
>
> -  SdMmcCmdBlk.CommandArgument = (AccessMode & 0xF) | ((CommandSystem & 0xF) 
> << 4) | \
> -((DriverStrength & 0xF) << 8) | ((PowerLimit 
> & 0xF) << 12) | \
> +  SdMmcCmdBlk.CommandArgument = (AccessMode & 0xF) | ((PowerLimit & 0xF) << 
> 4) | \^M
> +((DriverStrength & 0xF) << 8) | 
> ((DriverStrength & 0xF) << 12) | \^M
>  ModeValue;
>
> Above is restoring SdMmcCmdBlk.CommandArgument to the state from before the 
> patch in question. Now the question - why the layout of the command changed? 
> CommandSystem was unused before, and PowerLimit changed its position. Is this 
> change really related to the rest of the patch? What is the justification?
>
> Best regards,
> Marcin
>
>
> pt., 28 cze 2019 o 02:57 Wu, Hao A  napisał(a):
>>
>> > -Original Message-
>> > From: Sumit Garg [mailto:sumit.g...@linaro.org]
>> > Sent: Thursday, June 27, 2019 9:39 PM
>> > To: Ard Biesheuvel
>> > Cc: edk2-devel-groups-io; Wu, Hao A; Marcin Wojtas; Albecki, Mateusz
>> > Subject: Re: [edk2-devel] [PATCH v4 0/2] MdeModulePkg/SdMmcHcDxe:
>> > Implement revision 3 of SdMmcOverrideProtocol
>> >
>> > On Thu, 27 Jun 2019 at 13:40, Ard Biesheuvel 
>> > wrote:
>> > >
>> > > (+ Sumit)
>> > >
>> > > On Thu, 27 Jun 2019 at 08:29, Wu, Hao A  wrote:
>> > > >
>> > > > > -Original Message-
>> > > > > From: Marcin Wojtas [mailto:m...@semihalf.com]
>> > > > > Sent: Thursday, June 27, 2019 2:25 PM
>> > > > > To: Albecki, Mateusz
>> > > > > Cc: edk2-devel-groups-io; Wu, Hao A
>> > > > > Subject: Re: [edk2-devel] [PATCH v4 0/2]
>> > MdeModulePkg/SdMmcHcDxe:
>> > > > > Implement revision 3 of SdMmcOverrideProtocol
>> > > > >
>> > > > > Hi Mateusz,
>> > > > >
>> > > > > Can you please push those patches somewhere (github?) so that I can
>> > > > > easily do a quick check for regression?
>> > > > >
>> > > > > Thanks,
>> > > > > Marcin
>> > > >
>> > > >
>> > > > Hello Marcin,
>> > > >
>> > > > I have just pushed the series at:
>> > > > https://github.com/hwu25/edk2/tree/sdmmc_override_extend_v4
>> > > >
>> > > > Please help to check.
>> > > >
>> > >
>> > > I have cc'ed my colleague Sumit, who has kindly agreed to regression
>> > > test this branch on Socionext SynQuacer, which also uses the SD/MMC
>> > > override infrastructure.
>> > >
>> > > Sumit, please reply here with your results. And thanks again!
>> >
>> > I did picked this patch-set and applied on top of edk2 master branch.
>> > It works well on SynQuacer with eMMC device enumerated properly and
>> > all three eMMC partitions are visible:
>> >
>> >  BLK4: Alias(s):
>> >   VenHw(0D51905B-B77E-452A-A2C0-
>> > ECA0CC8D514A,305200)/eMMC(0x
>> > 0)/Ctrl(0x0)
>> >  BLK5: Alias(s):
>> >   VenHw(0D51905B-B77E-452A-A2C0-
>> > ECA0CC8D514A,305200)/eMMC(0x
>> > 0)/Ctrl(0x1)
>> >  BLK6: Alias(s):
>> >   VenHw(0D51905B-B77E-452A-A2C0-
>> > ECA0CC8D514A,305200)/eMMC(0x
>> > 0)/Ctrl(0x2)
>> >
>> > Shell> devices
>> > 
>> >   E9 D - -  1  1   0 VenHw(0D51905B-B77E-452A-A2C0-
>> > ECA0CC8D514A,3052
>> > 00)/eMMC(0x0)/Ctrl(0x0)
>> >   EA D - -  1  1   0 VenHw(0D51905B-B77E-452A-A2C0-
>> > ECA0CC8D514A,3052
>> > 00)/eMMC(0x0)/Ctrl(0x1)
>> >   EB D - -  1  1   0 VenHw(0D51905B-B77E-452A-A2C0-
>> > ECA0CC8D514A,3052
>> > 00)/eMMC(0x0)/Ctrl(0x2)
>> >
>> > So you can add following:
>> >
>> > Regression-tested-by: Sumit Garg 
>>
>>
>> Thanks a lot for the testing.
>>
>> Best Regards,
>> Hao Wu
>>
>>
>> >
>> > -Sumit
>>
>> 
>>

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all m

[edk2-devel] [PATCH 3/3] UefiCpuPkg/PiSmmCpu: Enable 5 level paging when CPU supports

2019-06-27 Thread Ni, Ray
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1946

The patch changes SMM environment to use 5 level paging when CPU
supports it.

Signed-off-by: Ray Ni 
Cc: Eric Dong 
---
 .../PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c   |  20 +-
 UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c| 272 ++
 UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c   | 483 --
 UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm   |  12 +
 .../PiSmmCpuDxeSmm/X64/SmmProfileArch.c   |  72 ++-
 5 files changed, 559 insertions(+), 300 deletions(-)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c 
b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
index 069be3aaa5..55090e9c3e 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
@@ -125,18 +125,36 @@ GetPageTableEntry (
   UINTN Index2;
   UINTN Index3;
   UINTN Index4;
+  UINTN Index5;
   UINT64*L1PageTable;
   UINT64*L2PageTable;
   UINT64*L3PageTable;
   UINT64*L4PageTable;
+  UINT64*L5PageTable;
+  IA32_CR4  Cr4;
+  BOOLEAN   Enable5LevelPaging;
 
+  Index5 = ((UINTN)RShiftU64 (Address, 48)) & PAGING_PAE_INDEX_MASK;
   Index4 = ((UINTN)RShiftU64 (Address, 39)) & PAGING_PAE_INDEX_MASK;
   Index3 = ((UINTN)Address >> 30) & PAGING_PAE_INDEX_MASK;
   Index2 = ((UINTN)Address >> 21) & PAGING_PAE_INDEX_MASK;
   Index1 = ((UINTN)Address >> 12) & PAGING_PAE_INDEX_MASK;
 
+  Cr4.UintN = AsmReadCr4 ();
+  Enable5LevelPaging = (BOOLEAN) (Cr4.Bits.LA57 == 1);
+
   if (sizeof(UINTN) == sizeof(UINT64)) {
-L4PageTable = (UINT64 *)GetPageTableBase ();
+if (Enable5LevelPaging) {
+  L5PageTable = (UINT64 *)GetPageTableBase ();
+  if (L5PageTable[Index5] == 0) {
+*PageAttribute = PageNone;
+return NULL;
+  }
+
+  L4PageTable = (UINT64 *)(UINTN)(L5PageTable[Index5] & ~mAddressEncMask & 
PAGING_4K_ADDRESS_MASK_64);
+} else {
+  L4PageTable = (UINT64 *)GetPageTableBase ();
+}
 if (L4PageTable[Index4] == 0) {
   *PageAttribute = PageNone;
   return NULL;
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c 
b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
index e2b6a2d9b2..c5131526f0 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
@@ -534,43 +534,78 @@ InitPaging (
   VOID
   )
 {
+  UINT64Pml5Entry;
+  UINT64Pml4Entry;
+  UINT64*Pml5;
   UINT64*Pml4;
   UINT64*Pdpt;
   UINT64*Pd;
   UINT64*Pt;
   UINTN Address;
+  UINTN Pml5Index;
   UINTN Pml4Index;
   UINTN PdptIndex;
   UINTN PdIndex;
   UINTN PtIndex;
   UINTN NumberOfPdptEntries;
   UINTN NumberOfPml4Entries;
+  UINTN NumberOfPml5Entries;
   UINTN SizeOfMemorySpace;
   BOOLEAN   Nx;
+  IA32_CR4  Cr4;
+  BOOLEAN   Enable5LevelPaging;
+
+  Cr4.UintN = AsmReadCr4 ();
+  Enable5LevelPaging = (BOOLEAN) (Cr4.Bits.LA57 == 1);
 
   if (sizeof (UINTN) == sizeof (UINT64)) {
-Pml4 = (UINT64*)(UINTN)mSmmProfileCr3;
+if (!Enable5LevelPaging) {
+  Pml5Entry = (UINTN) mSmmProfileCr3 | IA32_PG_P;
+  Pml5 = &Pml5Entry;
+} else {
+  Pml5 = (UINT64*) (UINTN) mSmmProfileCr3;
+}
 SizeOfMemorySpace = HighBitSet64 (gPhyMask) + 1;
 //
 // Calculate the table entries of PML4E and PDPTE.
 //
-if (SizeOfMemorySpace <= 39 ) {
-  NumberOfPml4Entries = 1;
-  NumberOfPdptEntries = (UINT32)LShiftU64 (1, (SizeOfMemorySpace - 30));
-} else {
-  NumberOfPml4Entries = (UINT32)LShiftU64 (1, (SizeOfMemorySpace - 39));
-  NumberOfPdptEntries = 512;
+NumberOfPml5Entries = 1;
+if (SizeOfMemorySpace > 48) {
+  NumberOfPml5Entries = (UINTN) LShiftU64 (1, SizeOfMemorySpace - 48);
+  SizeOfMemorySpace = 48;
 }
-  } else {
+
 NumberOfPml4Entries = 1;
+if (SizeOfMemorySpace > 39) {
+  NumberOfPml4Entries = (UINTN) LShiftU64 (1, SizeOfMemorySpace - 39);
+  SizeOfMemorySpace = 39;
+}
+
+NumberOfPdptEntries = 1;
+ASSERT (SizeOfMemorySpace > 30);
+NumberOfPdptEntries = (UINTN) LShiftU64 (1, SizeOfMemorySpace - 30);
+  } else {
+Pml4Entry = (UINTN) mSmmProfileCr3 | IA32_PG_P;
+Pml4 = &Pml4Entry;
+Pml5Entry = (UINTN) Pml4 | IA32_PG_P;
+Pml5 = &Pml5Entry;
+NumberOfPml5Entries  = 1;
+NumberOfPml4Entries  = 1;
 NumberOfPdptEntries  = 4;
   }
 
   //
   // Go t

[edk2-devel] [PATCH 1/3] UefiCpuPkg/PiSmmCpu: Change variable names and comments to follow SDM

2019-06-27 Thread Ni, Ray
Per SDM, for IA-32e 4-KByte paging, there are four layers in the page
table structure:
1. PML4
2. Page-Directory-Pointer Table (PDPT)
3. Page-Directory (PD)
4. Page Table (PT)

The patch changes the local variable names and comments to use
"PML4", "PDPT", "PD", "PT" to better align to terms used in SDM.

There is no functionality impact for this change.

Signed-off-by: Ray Ni 
Cc: Eric Dong 
---
 UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c | 114 -
 1 file changed, 57 insertions(+), 57 deletions(-)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c 
b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
index 3b2f967355..e2b6a2d9b2 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
@@ -535,15 +535,15 @@ InitPaging (
   )
 {
   UINT64*Pml4;
-  UINT64*Pde;
-  UINT64*Pte;
+  UINT64*Pdpt;
+  UINT64*Pd;
   UINT64*Pt;
   UINTN Address;
-  UINTN Level1;
-  UINTN Level2;
-  UINTN Level3;
-  UINTN Level4;
-  UINTN NumberOfPdpEntries;
+  UINTN Pml4Index;
+  UINTN PdptIndex;
+  UINTN PdIndex;
+  UINTN PtIndex;
+  UINTN NumberOfPdptEntries;
   UINTN NumberOfPml4Entries;
   UINTN SizeOfMemorySpace;
   BOOLEAN   Nx;
@@ -556,143 +556,143 @@ InitPaging (
 //
 if (SizeOfMemorySpace <= 39 ) {
   NumberOfPml4Entries = 1;
-  NumberOfPdpEntries = (UINT32)LShiftU64 (1, (SizeOfMemorySpace - 30));
+  NumberOfPdptEntries = (UINT32)LShiftU64 (1, (SizeOfMemorySpace - 30));
 } else {
   NumberOfPml4Entries = (UINT32)LShiftU64 (1, (SizeOfMemorySpace - 39));
-  NumberOfPdpEntries = 512;
+  NumberOfPdptEntries = 512;
 }
   } else {
 NumberOfPml4Entries = 1;
-NumberOfPdpEntries  = 4;
+NumberOfPdptEntries  = 4;
   }
 
   //
   // Go through page table and change 2MB-page into 4KB-page.
   //
-  for (Level1 = 0; Level1 < NumberOfPml4Entries; Level1++) {
+  for (Pml4Index = 0; Pml4Index < NumberOfPml4Entries; Pml4Index++) {
 if (sizeof (UINTN) == sizeof (UINT64)) {
-  if ((Pml4[Level1] & IA32_PG_P) == 0) {
+  if ((Pml4[Pml4Index] & IA32_PG_P) == 0) {
 //
-// If Pml4 entry does not exist, skip it
+// If PML4 entry does not exist, skip it
 //
 continue;
   }
-  Pde = (UINT64 *)(UINTN)(Pml4[Level1] & ~mAddressEncMask & 
PHYSICAL_ADDRESS_MASK);
+  Pdpt = (UINT64 *)(UINTN)(Pml4[Pml4Index] & ~mAddressEncMask & 
PHYSICAL_ADDRESS_MASK);
 } else {
-  Pde = (UINT64*)(UINTN)mSmmProfileCr3;
+  Pdpt = (UINT64*)(UINTN)mSmmProfileCr3;
 }
-for (Level2 = 0; Level2 < NumberOfPdpEntries; Level2++, Pde++) {
-  if ((*Pde & IA32_PG_P) == 0) {
+for (PdptIndex = 0; PdptIndex < NumberOfPdptEntries; PdptIndex++, Pdpt++) {
+  if ((*Pdpt & IA32_PG_P) == 0) {
 //
-// If PDE entry does not exist, skip it
+// If PDPT entry does not exist, skip it
 //
 continue;
   }
-  if ((*Pde & IA32_PG_PS) != 0) {
+  if ((*Pdpt & IA32_PG_PS) != 0) {
 //
 // This is 1G entry, skip it
 //
 continue;
   }
-  Pte = (UINT64 *)(UINTN)(*Pde & ~mAddressEncMask & PHYSICAL_ADDRESS_MASK);
-  if (Pte == 0) {
+  Pd = (UINT64 *)(UINTN)(*Pdpt & ~mAddressEncMask & PHYSICAL_ADDRESS_MASK);
+  if (Pd == 0) {
 continue;
   }
-  for (Level3 = 0; Level3 < SIZE_4KB / sizeof (*Pte); Level3++, Pte++) {
-if ((*Pte & IA32_PG_P) == 0) {
+  for (PdIndex = 0; PdIndex < SIZE_4KB / sizeof (*Pd); PdIndex++, Pd++) {
+if ((*Pd & IA32_PG_P) == 0) {
   //
-  // If PTE entry does not exist, skip it
+  // If PD entry does not exist, skip it
   //
   continue;
 }
-Address = (((Level2 << 9) + Level3) << 21);
+Address = (((PdptIndex << 9) + PdIndex) << 21);
 
 //
 // If it is 2M page, check IsAddressSplit()
 //
-if (((*Pte & IA32_PG_PS) != 0) && IsAddressSplit (Address)) {
+if (((*Pd & IA32_PG_PS) != 0) && IsAddressSplit (Address)) {
   //
   // Based on current page table, create 4KB page table for split area.
   //
-  ASSERT (Address == (*Pte & PHYSICAL_ADDRESS_MASK));
+  ASSERT (Address == (*Pd & PHYSICAL_ADDRESS_MASK));
 
   Pt = AllocatePageTableMemory (1);
   ASSERT (Pt != NULL);
 
   // Split it
-  for (Level4 = 0; Level4 < SIZE_4KB / sizeof(*Pt); Level4++) {
-   

[edk2-devel] [PATCH 0/3] Enable 5 level paging when CPU supports

2019-06-27 Thread Ni, Ray
Ray Ni (3):
  UefiCpuPkg/PiSmmCpu: Change variable names and comments to follow SDM
  MdePkg/BaseLib.h: Update IA32_CR4 structure for 5-level paging
  UefiCpuPkg/PiSmmCpu: Enable 5 level paging when CPU supports

 MdePkg/Include/Library/BaseLib.h  |   3 +-
 .../PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c   |  20 +-
 UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c| 300 ++-
 UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c   | 483 --
 UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm   |  12 +
 .../PiSmmCpuDxeSmm/X64/SmmProfileArch.c   |  72 ++-
 6 files changed, 575 insertions(+), 315 deletions(-)

-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42976): https://edk2.groups.io/g/devel/message/42976
Mute This Topic: https://groups.io/mt/32239518/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 2/3] MdePkg/BaseLib.h: Update IA32_CR4 structure for 5-level paging

2019-06-27 Thread Ni, Ray
5-level paging is documented in white paper:
https://software.intel.com/sites/default/files/managed/2b/80/5-level_paging_white_paper.pdf

Commit f8113e25001e715390127f23e2197252cbd6d1a2
changed Cpuid.h already.

This patch updates IA32_CR4 structure to include LA57 field.

Signed-off-by: Ray Ni 
Cc: Eric Dong 
---
 MdePkg/Include/Library/BaseLib.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/BaseLib.h
index ebd7dd274c..a22bfc9fad 100644
--- a/MdePkg/Include/Library/BaseLib.h
+++ b/MdePkg/Include/Library/BaseLib.h
@@ -5324,7 +5324,8 @@ typedef union {
 UINT32  OSXMMEXCPT:1;   ///< Operating System Support for
 ///< Unmasked SIMD Floating Point
 ///< Exceptions.
-UINT32  Reserved_0:2;   ///< Reserved.
+UINT32  Reserved_2:1;   ///< Reserved.
+UINT32  LA57:1; ///< Linear Address 57bit.
 UINT32  VMXE:1; ///< VMX Enable
 UINT32  Reserved_1:18;  ///< Reserved.
   } Bits;
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42978): https://edk2.groups.io/g/devel/message/42978
Mute This Topic: https://groups.io/mt/32239520/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [edk2-platform patch V6] Platform/Intel:Add UniTool into edk2-platforms/Platform/Intel/Tools

2019-06-27 Thread Fan, ZhijuX
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1855

UniTool is one python script to generate UQI (Universal Question
Identifier) unicode string for HII question PROMPT string. UQI
string can be used to identify each HII question.
The scripts function will sync up UQI definitions with uni files
based on vfi/vfr/hfr/sd/sdi in the tree.

This script can be run in both Py2 and Py3.

Cc: Liming Gao 
Cc: Bob Feng 
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Signed-off-by: Zhiju.Fan 
---
Updata FileHeader in script

 Platform/Intel/Tools/UniTool/README.txt |  41 +++
 Platform/Intel/Tools/UniTool/UniTool.py | 488 
 2 files changed, 529 insertions(+)
 create mode 100644 Platform/Intel/Tools/UniTool/README.txt
 create mode 100644 Platform/Intel/Tools/UniTool/UniTool.py

diff --git a/Platform/Intel/Tools/UniTool/README.txt 
b/Platform/Intel/Tools/UniTool/README.txt
new file mode 100644
index 00..69da4aca24
--- /dev/null
+++ b/Platform/Intel/Tools/UniTool/README.txt
@@ -0,0 +1,41 @@
+
+How to use UniTool
+-
+The usage of the tool is:
+UniTool.py [-b] [-u] [-l] [-x] [-h] [-d 'rootDirectory1'] [-d 
'rootDirectory2'] [-d 'rootDirectory3']... [-q e|w]
+   'rootDirectory0' 'uqiFile'|'uqiFileDirectory' 
['excludedDirectory1'] ['excludedDirectory2'] ['excludedDirectory3']...
+
+Function will sync up UQI definitions with uni files based on 
vfi/vfr/hfr/sd/sdi in the tree.
+
+Required Arguments:
+  'rootdirectory0'   path to root directory
+  'uqiFileDirectory' path to UQI file(UqiList.uni)
+  'uqiFile'  UQI file
+
+Options:
+  -hShow this help
+  -bBuild option returns error if any new UQI needs 
assigning
+based on vfi/vfr/hfr/sd/sdi when no -u option is 
specified
+  -uCreate new UQIs that does not already exist in uqiFile 
for
+any string requiring a UQI based on vfi/vfr/hfr/sd/sdi
+NOTE: 'uqiFile' cannot be readonly!
+  -lLanguage deletion option (keeps only English and uqi)
+moves all UQIs to 'uqiFile'
+NOTE: Uni files cannot be readonly!
+  -xExclude 'rootDirectory'/'excludedDirectory1' &
+'rootDirectory'/'excludedDirectory2'... from UQI list 
build
+NOTE: Cannot be the same as rootDirectory
+  -dAdd multiple root directories to process
+  -qPrint warning(w) or return error(e) if different HII 
questions
+are referring same string token
+
+Return error if any duplicated UQI string or value in UQI list or if no 
definition
+for any string referred by HII question when -b or -u is specified
+
+NOTE: Options must be specified before parameters
+
+Notice
+-
+- "S" style will be used if uqiFile needs to be new created.
+  Use the same uqi style if uqiFile is existed. For example,
+  if the exist UqiFile use "\x" style, "\x" will be used.
diff --git a/Platform/Intel/Tools/UniTool/UniTool.py 
b/Platform/Intel/Tools/UniTool/UniTool.py
new file mode 100644
index 00..9b51827cdd
--- /dev/null
+++ b/Platform/Intel/Tools/UniTool/UniTool.py
@@ -0,0 +1,488 @@
+## @file
+# generate UQI (Universal Question Identifier) unicode string for HII question 
PROMPT string. UQI string can be used to
+# identify each HII question.
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+import re
+import sys
+import os
+import getopt
+import codecs
+import fnmatch
+import logging
+import argparse
+
+# global variable declarations
+QuestionError = False
+FileHeader = '//\r\n//  FILE auto-generated by UniTool\r\n//\r\n\r\n#langdef 
uqi "uqi"\r\n\r\n'
+UqiList = re.compile('^#string[ \t]+([A-Z_0-9]+)[ \t]+#language[ \t]+uqi[ 
\t\r\n]+"(?:[x\S]{1,2})([0-9a-fA-F]{4,5})"',
+ re.M).findall
+AllUqis = {}
+StringDict = {}
+GlobalVarId = {}
+Options = {}
+
+# Version message
+__prog__ = 'UniTool'
+__description__ = 'The script generate UQI unicode string for HII question 
PROMPT string.\n'
+__copyright__ = 'Copyright (c) 2019, Intel Corporation. All rights 
reserved.'
+__version__ = '%s Version %s' % (__prog__, '0.1 ')
+_Usage = "Syntax:  %s [-b] [-u] [-l] [-x] [-h] [-d 'rootDirectory1'] [-d 
'rootDirectory2'] [-d 'rootDirectory3']... \n[-q e|w]" \
+ "'rootDirectory0' 'uqiFile'|'uqiFileDirectory' ['excludedDirectory1'] 
['excludedDirectory2'] ['excludedDirectory3']...\n" \
+  % (os.path.basename(sys.argv[0]))
+
+# **
+# description: Get uni file encoding
+#
+# arguments:   Filename - name of uni file
+#
+# returns: utf-8 or utf-16
+#
+def GetUniFileEncoding(Filename):
+#
+# Detect Byte Order Mark at beginning of f