Re: [edk2-devel] [PATCH v1 1/1] CodeQL: Update from 2.16.1 to 2.17.3

2024-05-17 Thread Joey Vagedes via groups.io
Reviewed-by: Joey Vagedes 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119060): https://edk2.groups.io/g/devel/message/119060
Mute This Topic: https://groups.io/mt/106161774/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 1/1] Update to CodeQL 2.16.1

2024-04-24 Thread Joey Vagedes via groups.io
Reviewed-by: joey.vage...@gmail.com

On Wed, Apr 24, 2024 at 10:37 AM  wrote:

> From: Michael Kubacki 
>
> Fixes current CI CodeQL failures due to old CodeQL CLI version.
>
> Updates CodeQL to work with the latest queries. Includes functional
> and security fixes within the CodeQL CLI binary.
>
> For more information on release details see:
>
> https://github.com/github/codeql-cli-binaries/releases
>
> For changes between the previous version (2.14.5) and 2.16.1 see:
>
> https://github.com/github/codeql-cli-binaries/compare/v2.14.5...v2.16.1
>
> Cc: Bob Feng 
> Cc: Joey Vagedes 
> Cc: Liming Gao 
> Cc: Michael D Kinney 
> Cc: Rebecca Cran 
> Cc: Sean Brogan 
> Cc: Yuwei Chen 
> Signed-off-by: Michael Kubacki 
> ---
>
> Notes:
> Tested in https://github.com/tianocore/edk2/pull/5597
>
>  BaseTools/Plugin/CodeQL/codeqlcli_ext_dep.yaml | 6 +++---
>  BaseTools/Plugin/CodeQL/codeqlcli_linux_ext_dep.yaml   | 6 +++---
>  BaseTools/Plugin/CodeQL/codeqlcli_windows_ext_dep.yaml | 6 +++---
>  3 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/BaseTools/Plugin/CodeQL/codeqlcli_ext_dep.yaml
> b/BaseTools/Plugin/CodeQL/codeqlcli_ext_dep.yaml
> index 37c7c9f595ca..5ec56c6bf06f 100644
> --- a/BaseTools/Plugin/CodeQL/codeqlcli_ext_dep.yaml
> +++ b/BaseTools/Plugin/CodeQL/codeqlcli_ext_dep.yaml
> @@ -16,9 +16,9 @@
>"scope": "codeql-ext-dep",
>"type": "web",
>"name": "codeql_cli",
> -  "source": "
> https://github.com/github/codeql-cli-binaries/releases/download/v2.12.4/codeql.zip
> ",
> -  "version": "2.12.4",
> -  "sha256":
> "f682f1155d627ad97f10b1bcad97f682011986717bd3823e9cf831ed83ac96e7",
> +  "source": "
> https://github.com/github/codeql-cli-binaries/releases/download/v2.16.1/codeql.zip
> ",
> +  "version": "2.16.1",
> +  "sha256":
> "86a98f6ebb8fd49efadf367f3275c438669fcb8426962c33415129aad8e093e6",
>"compression_type": "zip",
>"internal_path": "/codeql/",
>"flags": ["set_shell_var", ],
> diff --git a/BaseTools/Plugin/CodeQL/codeqlcli_linux_ext_dep.yaml
> b/BaseTools/Plugin/CodeQL/codeqlcli_linux_ext_dep.yaml
> index a6ca5d0f34cc..5b4a919f1de4 100644
> --- a/BaseTools/Plugin/CodeQL/codeqlcli_linux_ext_dep.yaml
> +++ b/BaseTools/Plugin/CodeQL/codeqlcli_linux_ext_dep.yaml
> @@ -14,9 +14,9 @@
>"scope": "codeql-linux-ext-dep",
>"type": "web",
>"name": "codeql_linux_cli",
> -  "source": "
> https://github.com/github/codeql-cli-binaries/releases/download/v2.14.5/codeql-linux64.zip
> ",
> -  "version": "2.14.5",
> -  "sha256":
> "72aa5d748ff9ab57cfd86045560683bdc4897e0fe6d9f9a2786d9394674ae733",
> +  "source": "
> https://github.com/github/codeql-cli-binaries/releases/download/v2.16.1/codeql-linux64.zip
> ",
> +  "version": "2.16.1",
> +  "sha256":
> "40dbb6c0c4064bd14601a02e60c61661fdc0271469f90eb91a2e7d51d4cbc171",
>"compression_type": "zip",
>"internal_path": "/codeql/",
>"flags": ["set_shell_var", ],
> diff --git a/BaseTools/Plugin/CodeQL/codeqlcli_windows_ext_dep.yaml
> b/BaseTools/Plugin/CodeQL/codeqlcli_windows_ext_dep.yaml
> index e706a7cabf9f..c0c018c9538f 100644
> --- a/BaseTools/Plugin/CodeQL/codeqlcli_windows_ext_dep.yaml
> +++ b/BaseTools/Plugin/CodeQL/codeqlcli_windows_ext_dep.yaml
> @@ -14,9 +14,9 @@
>"scope": "codeql-windows-ext-dep",
>"type": "web",
>"name": "codeql_windows_cli",
> -  "source": "
> https://github.com/github/codeql-cli-binaries/releases/download/v2.14.5/codeql-win64.zip
> ",
> -  "version": "2.14.5",
> -  "sha256":
> "861fcb38365cc311efee0c3a28c77494e93c69a969885b72e53173ad473f61aa",
> +  "source": "
> https://github.com/github/codeql-cli-binaries/releases/download/v2.16.1/codeql-win64.zip
> ",
> +  "version": "2.16.1",
> +  "sha256":
> "9ebe5ea8a7d0a77425428d50d49912319117fccee24ecb62f6219c12584f4f28",
>"compression_type": "zip",
>"internal_path": "/codeql/",
>"flags": ["set_shell_var", ],
> --
> 2.44.0.windows.1
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118227): https://edk2.groups.io/g/devel/message/118227
Mute This Topic: https://groups.io/mt/105714919/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 7/9] .pytool/CISettings.py: add libspdm submodule.

2024-04-09 Thread Joey Vagedes via groups.io
Reviewed-by: joey.vage...@gmail.com


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117546): https://edk2.groups.io/g/devel/message/117546
Mute This Topic: https://groups.io/mt/105394121/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 7/9] .pytool/CISettings.py: add libspdm submodule.

2024-04-03 Thread Joey Vagedes via groups.io
Reviewed-By: joey.vage...@gmail.com


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117377): https://edk2.groups.io/g/devel/message/117377
Mute This Topic: https://groups.io/mt/105281054/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v1 1/1] BaseTools: InfBuildData: Fix Private value retrieval

2024-03-13 Thread Joey Vagedes via groups.io
Update retrieval of private guids, protocols, or ppis from a package's
declaration file to use the original path of the module's INF file
rather than the current path. When building the same module multiple
times in the same INF (by override the define's FILE_GUID), a temporary
instance of the module is generated outside the package, causing the
retrieval of private values to fail as the check to access private
values is done by verifying the module to build, is inside the package.

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

Signed-off-by: Joey Vagedes 

Cc: Rebecca Cran 
Cc: Liming Gao 
Cc: Bob Feng 
Cc: Yuwei Chen 
---
 BaseTools/Source/Python/Workspace/InfBuildData.py | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py 
b/BaseTools/Source/Python/Workspace/InfBuildData.py
index e4ff1c668666..6339e494ca87 100644
--- a/BaseTools/Source/Python/Workspace/InfBuildData.py
+++ b/BaseTools/Source/Python/Workspace/InfBuildData.py
@@ -592,7 +592,7 @@ class InfBuildData(ModuleBuildClassObject):
 RecordList = self._RawData[MODEL_EFI_PROTOCOL, self._Arch, 
self._Platform]
 for Record in RecordList:
 CName = Record[0]
-Value = _ProtocolValue(CName, self.Packages, self.MetaFile.Path)
+Value = _ProtocolValue(CName, self.Packages, 
self.MetaFile.OriginalPath.Path)
 if Value is None:
 PackageList = "\n\t".join(str(P) for P in self.Packages)
 EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,
@@ -616,7 +616,7 @@ class InfBuildData(ModuleBuildClassObject):
 RecordList = self._RawData[MODEL_EFI_PPI, self._Arch, self._Platform]
 for Record in RecordList:
 CName = Record[0]
-Value = _PpiValue(CName, self.Packages, self.MetaFile.Path)
+Value = _PpiValue(CName, self.Packages, 
self.MetaFile.OriginalPath.Path)
 if Value is None:
 PackageList = "\n\t".join(str(P) for P in self.Packages)
 EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,
@@ -640,7 +640,7 @@ class InfBuildData(ModuleBuildClassObject):
 RecordList = self._RawData[MODEL_EFI_GUID, self._Arch, self._Platform]
 for Record in RecordList:
 CName = Record[0]
-Value = GuidValue(CName, self.Packages, self.MetaFile.Path)
+Value = GuidValue(CName, self.Packages, 
self.MetaFile.OriginalPath.Path)
 if Value is None:
 PackageList = "\n\t".join(str(P) for P in self.Packages)
 EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,
@@ -655,7 +655,7 @@ class InfBuildData(ModuleBuildClassObject):
 for TokenSpaceGuid, _, _, _, _, _, LineNo in RecordList:
 # get the guid value
 if TokenSpaceGuid not in RetVal:
-Value = GuidValue(TokenSpaceGuid, self.Packages, 
self.MetaFile.Path)
+Value = GuidValue(TokenSpaceGuid, self.Packages, 
self.MetaFile.OriginalPath.Path)
 if Value is None:
 PackageList = "\n\t".join(str(P) for P in 
self.Packages)
 EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,
@@ -818,11 +818,11 @@ class InfBuildData(ModuleBuildClassObject):
 Value = Token
 else:
 # get the GUID value now
-Value = _ProtocolValue(Token, self.Packages, 
self.MetaFile.Path)
+Value = _ProtocolValue(Token, self.Packages, 
self.MetaFile.OriginalPath.Path)
 if Value is None:
-Value = _PpiValue(Token, self.Packages, 
self.MetaFile.Path)
+Value = _PpiValue(Token, self.Packages, 
self.MetaFile.OriginalPath.Path)
 if Value is None:
-Value = GuidValue(Token, self.Packages, 
self.MetaFile.Path)
+Value = GuidValue(Token, self.Packages, 
self.MetaFile.OriginalPath.Path)
 
 if Value is None:
 PackageList = "\n\t".join(str(P) for P in 
self.Packages)
-- 
2.40.1.vfs.0.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116716): https://edk2.groups.io/g/devel/message/116716
Mute This Topic: https://groups.io/mt/104907485/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 0/6] UefiCpuPkg/MpInitLib: Add support for multiple MP_HAND_OFF HOBs

2024-02-26 Thread Joey Vagedes via groups.io
Hi Lazlo,

I just looked at the pipelines - Looks like everything is fine, there is just 
currently a backup of runners of jobs in the runners. It is common for jobs 
that end in CODE_COVERAGE to appear frozen in queued status, but this is 
expected as this job not queued until all others have finished, which means it 
gets put at the end of the list of pipelines to execute.

Taking a look at all the runners 
(https://dev.azure.com/tianocore/edk2-ci/_settings/buildqueue?_a=concurrentJobs 
[Click "Microsoft Hosted", "View in-progress jobs"]), I don't see any runners 
that are frozen, which is why it appears it's just a backup.

I'll continue to monitor.

Thanks,
Joey

-Original Message-
From: Laszlo Ersek 
Sent: Monday, February 26, 2024 7:08 AM
To: devel@edk2.groups.io; kra...@redhat.com
Cc: Ni, Ray ; Rahul Kumar ; Oliver 
Steffen ; Kinney, Michael D ; 
Sean Brogan ; Joey Vagedes 

Subject: [EXTERNAL] Re: [edk2-devel] [PATCH v3 0/6] UefiCpuPkg/MpInitLib: Add 
support for multiple MP_HAND_OFF HOBs

[You don't often get email from ler...@redhat.com. Learn why this is important 
at https://aka.ms/LearnAboutSenderIdentification ]

On 2/22/24 17:01, Gerd Hoffmann wrote:
> Needed to boot guests with thousands of vcpus.
>
> v3:
>  - refine comments and commit messages.
>  - fix MaxCpusPerHob calculation.
>  - pick up review tags.
>  - add patch to speed up GetBspNumber a bit.
> v2:
>  - rework HOB loops for better performance: O(n) instead of O(n^2).
>
> Gerd Hoffmann (6):
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetMpHandOffHob
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetBspNumber()
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to
> SwitchApContext()
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to
> MpInitLibInitialize
>   UefiCpuPkg/MpInitLib: Add support for multiple HOBs to SaveCpuMpData()
>   UefiCpuPkg/MpInitLib: return early in GetBspNumber()
>
>  UefiCpuPkg/Library/MpInitLib/MpLib.h|  14 ++-
>  UefiCpuPkg/Library/MpInitLib/MpLib.c| 157 +++-
>  UefiCpuPkg/Library/MpInitLib/PeiMpLib.c |  44 ---
>  3 files changed, 142 insertions(+), 73 deletions(-)

I created PR  with the "push" 
label set 40 minutes ago, for merging this series; however, the CI system seems 
to be stuck. Everything on Azure seems to be in Queued status, nothing is 
running.

Any ideas?

Thanks!
Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115972): https://edk2.groups.io/g/devel/message/115972
Mute This Topic: https://groups.io/mt/104510905/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 1/1] .pytool/Plugin: UncrustifyCheck: use stat instead of os.stat

2024-01-23 Thread Joey Vagedes via groups.io
Thanks Mike,

I've prepared a Pull request with your Reviewed-By Tag. Feel free to add the 
push tag at your convenience. I appreciate your time!

.pytool/Plugin: UncrustifyCheck: use stat instead of os.stat by Javagedes · 
Pull Request #5287 · tianocore/edk2 (github.com) ( 
https://github.com/tianocore/edk2/pull/5287 )

Thanks,
Joey


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114213): https://edk2.groups.io/g/devel/message/114213
Mute This Topic: https://groups.io/mt/103898982/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v1 1/1] .pytool/Plugin: UncrustifyCheck: use stat instead of os.stat

2024-01-22 Thread Joey Vagedes via groups.io
The UncrustifyCheck plugin passes os.stat.S_IWRITE to os.chmod, when
attempting to change file permissions. os.stat.S_IWRITE does not exist
as os.stat is a function. The correct value is stat.S_IWRITE.

Signed-off-by: Joey Vagedes 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Sean Brogan 
---
 .pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py 
b/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py
index 9aeef5a5a3..73dc03c0dc 100644
--- a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py
+++ b/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py
@@ -12,6 +12,7 @@ import logging
 import os
 import pathlib
 import shutil
+import stat
 import timeit
 from edk2toolext.environment import version_aggregator
 from edk2toolext.environment.plugin_manager import PluginManager
@@ -628,7 +629,7 @@ class UncrustifyCheck(ICiBuildPlugin):
 """
 Private function to attempt to change permissions on file/folder 
being deleted.
 """
-os.chmod(path, os.stat.S_IWRITE)
+os.chmod(path, stat.S_IWRITE)
 func(path)
 
 for _ in range(3):  # retry up to 3 times
-- 
2.40.1.vfs.0.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114153): https://edk2.groups.io/g/devel/message/114153
Mute This Topic: https://groups.io/mt/103898982/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v1 0/1] UncrustifyCheck: use stat instead of os.stat

2024-01-22 Thread Joey Vagedes via groups.io
When UncrustifyCheck attempts to update the permissions of a file
( Only happens when a different error occurs ), it incorrectly uses
os.stat.S_IWRITE, which does not exist. The correct value is 
stat.S_IWRITE.

see os.chmod documentation: https://docs.python.org/3/library/os.html#os.chmod

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Sean Brogan 

Joey Vagedes (1):
  .pytool/Plugin: UncrustifyCheck: use stat instead of os.stat

 .pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.40.1.vfs.0.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114152): https://edk2.groups.io/g/devel/message/114152
Mute This Topic: https://groups.io/mt/103898980/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 1/1] pip-requirements.txt: Update to latest

2024-01-11 Thread Joey Vagedes via groups.io
Thanks Mike,

I've updated the PR / branch with the reviewed-by tag. It is ready to be merged 
at your convenience.

pip-requirements.txt: Update to latest by Javagedes · Pull Request #5256 · 
tianocore/edk2 (github.com) ( https://github.com/tianocore/edk2/pull/5256 )

Thanks,
Joey


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113634): https://edk2.groups.io/g/devel/message/113634
Mute This Topic: https://groups.io/mt/103671350/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] .pytool/Readme.md: Update matrix for DynamicTablesPkg

2024-01-11 Thread Joey Vagedes via groups.io
Hello.

Reviewed-by: Joey Vagedes 

This has been merged via PR 5257 ( https://github.com/tianocore/edk2/pull/5257 
) , commit SHA 58355ec1926563efc954821a2851365182a4ebd4

Thanks,
Joey


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113632): https://edk2.groups.io/g/devel/message/113632
Mute This Topic: https://groups.io/mt/103522062/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v1 1/1] pip-requirements.txt: Update to latest

2024-01-11 Thread Joey Vagedes via groups.io
From: "Joey Vagedes (from Dev Box)" 

Updates edk2-pytool-extensions, edk2-pytool-library, and regex to their
latest respective releases.

Signed-off-by: Joey Vagedes 
Cc: Andrew Fish 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
---
 pip-requirements.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pip-requirements.txt b/pip-requirements.txt
index 8177c60d1808..6420078822b5 100644
--- a/pip-requirements.txt
+++ b/pip-requirements.txt
@@ -12,9 +12,9 @@
 # https://www.python.org/dev/peps/pep-0440/#version-specifiers
 ##
 
-edk2-pytool-library==0.19.3
-edk2-pytool-extensions~=0.25.1
+edk2-pytool-library==0.19.9
+edk2-pytool-extensions==0.26.4
 edk2-basetools==0.1.48
 antlr4-python3-runtime==4.7.1
 lcov-cobertura==2.0.2
-regex==2023.8.8
+regex==2023.12.25
-- 
2.43.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113631): https://edk2.groups.io/g/devel/message/113631
Mute This Topic: https://groups.io/mt/103671350/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] Updates to .mailmap needed for Jeff Brasen, Jake Garver, Joey Vagades and Michael Roth?

2024-01-08 Thread Joey Vagedes via groups.io
Hi Rebecca. I will investigate this for my account. joey.vage...@gmail.com is 
correct on the mail map as it is my preference. Both my personal and 
professional emails are linked to Bugzilla and github and 
joey.vage...@gmail.com is what should be showing up as the author for commits.

Thanks for bringing this to my attention.

Joey

-Original Message-
From: Rebecca Cran  
Sent: Thursday, January 4, 2024 4:06 PM
To: devel@edk2.groups.io; Jeff Brasen ; j...@nvidia.com; 
michael.r...@amd.com; Joey Vagedes 
Subject: [EXTERNAL] Updates to .mailmap needed for Jeff Brasen, Jake Garver, 
Joey Vagades and Michael Roth?

[You don't often get email from rebe...@os.amperecomputing.com. Learn why this 
is important at https://aka.ms/LearnAboutSenderIdentification ]

I noticed recent commits by Jeff Brasen, Jake Garver, Joey Vagades and Michael 
Roth have funky Author lines, which I think means .mailmap needs updated?

commit 7a5823f85be99b9a92751fcf4141f7982fa5cc80
Author: Jeff Brasen via groups.io 
Date:   Thu Dec 28 12:47:08 2023 -0800

 EmbeddedPkg: Add DtPlatformLoaderLib gmock support

 Add Google Mock Library for DtPlatformLoaderDtbLib

 Signed-off-by: Jeff Brasen 



commit 9f0061a03b61d282fbc0ba5be22155d06a5e64a1
Author: Joey Vagedes via groups.io 
Date:   Wed Dec 6 12:27:02 2023 -0800

 BaseTools: Resolve regex syntax warnings

 Switches regex patterns to raw text to resolve python 3.12 syntax
 warnings in regards to invalid escape sequences, as is suggested by the
 re (regex) module in python.

 Cc: Rebecca Cran 
 Cc: Liming Gao 
 Cc: Bob Feng 
 Cc: Yuwei Chen 
 Signed-off-by: Joey Vagedes 
 Reviewed-by: Rebecca Cran 


Author: Jake Garver via groups.io 
Date:   Tue Oct 3 23:04:54 2023 +0800

 MdeModulePkg/RegularExpressinoDxe: Fix clang error

 Ignore old style declaration warnings in oniguruma/src/st.c.  This was
 already ignored for MSFT, but newer versions of clang complain as well.

 Signed-off-by: Jake Garver 
 Reviewed-by: Nhi Pham 
 Tested-by: Nhi Pham 
 Reviewed-by: Liming Gao 

commit f008890ae55929f7f17e7d2f8aff929255007d33
Author: Roth, Michael via groups.io 
Date:   Wed Aug 16 15:11:45 2023 -0500

 OvmfPkg/AmdSev: fix BdsPlatform.c assertion failure during boot

 Booting an SEV guest with AmdSev OVMF package currently triggers the
 following assertion with QEMU:

   InstallQemuFwCfgTables: installed 7 tables
   PcRtc: Write 0x20 to CMOS location 0x32
   [Variable]END_OF_DXE is signaled
   Initialize variable error flag (FF)

   ASSERT_EFI_ERROR (Status = Not Found)
   ASSERT [BdsDxe]
/home/VT_BUILD/ovmf/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c(1711):
!(((INTN)(RETURN_STATUS)(Status)) < 0)

 This seems to be due to commit 81dc0d8b4c, which switched to using
 PlatformBootManagerLib instead of PlatformBootManagerLibGrub. That pulls
 in a dependency on gEfiS3SaveStateProtocolGuid provider being available
 (which is asserted for in
 BdsPlatform.c:PlatformBootManagerBeforeConsole()/SaveS3BootScript()),
 but the libraries that provide it aren't currently included in the
 build. Add them similarly to what's done for OvmfPkg.

 Fixes: 81dc0d8b4c ("OvmfPkg/AmdSev: stop using
PlatformBootManagerLibGrub")
 Signed-off-by: Michael Roth 
 Acked-by: Gerd Hoffmann 
 Acked-by: Jiewen Yao 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113405): https://edk2.groups.io/g/devel/message/113405
Mute This Topic: https://groups.io/mt/103534194/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Fix raw strings containing valid escape characters

2024-01-08 Thread Joey Vagedes via groups.io
Hi Liming,

It was introduced due to the fact that a few of the regex strings with
invalid escape sequences (due to regex using their own escape sequences)
also included valid escape sequences - for handling new lines. I did not
see the valid escape characters in the strings, and the virtual platforms
(Ovmf, etc) did not have the circumstances to catch this, so it slipped
through the cracks.

Some platform DSCs do, and cause the break that the patch is resolving.
I’ve already verified this fix resolves the issue on numerous platforms.

thanks,
Joey

On Mon, Jan 8, 2024 at 5:59 AM Huang, Yanbo  wrote:

> Hi Liming,
>
> This issue is introduced by this commit:
> SHA-1: 9f0061a03b61d282fbc0ba5be22155d06a5e64a1
>
> * BaseTools: Resolve regex syntax warnings
>
> Switches regex patterns to raw text to resolve python 3.12 syntax
> warnings in regards to invalid escape sequences, as is suggested by the
> re (regex) module in python.
>
> Best Regards,
> Yanbo Huang
>
> -Original Message-
> From: gaoliming 
> Sent: Monday, January 8, 2024 9:25 PM
> To: devel@edk2.groups.io; Chen, Christine ; 'Joey
> Vagedes' 
> Cc: 'Rebecca Cran' ; Feng, Bob C ;
> Huang, Yanbo ; Kinney, Michael D <
> michael.d.kin...@intel.com>
> Subject: 回复: [edk2-devel] [PATCH v1 1/1] BaseTools: Fix raw strings
> containing valid escape characters
>
> Christine:
>   Is this a regression issue? Or does it resolve new usage? I am curious
> why it is not reported before.
>
> Thanks
> Liming
> > -邮件原件-
> > 发件人: devel@edk2.groups.io  代表 Yuwei Chen
> > 发送时间: 2024年1月8日 13:37
> > 收件人: devel@edk2.groups.io; Chen, Christine ;
> > Joey Vagedes 
> > 抄送: Rebecca Cran ; Gao, Liming
> > ; Feng, Bob C ; Huang,
> > Yanbo ; Kinney, Michael D
> > 
> > 主题: Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Fix raw strings
> containing
> > valid escape characters
> >
> > Hi Liming and Cran,
> >
> > We should merge this fixing patch asap as it influences BaseTool's usage.
> >
> > Thanks,
> > Christine
> >
> > > -Original Message-
> > > From: devel@edk2.groups.io  On Behalf Of Yuwei
> > > Chen
> > > Sent: Monday, January 8, 2024 9:16 AM
> > > To: Joey Vagedes ; devel@edk2.groups.io
> > > Cc: Rebecca Cran ; Gao, Liming
> > > ; Feng, Bob C 
> > > Subject: Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Fix raw strings
> > containing
> > > valid escape characters
> > >
> > > Hi Joey,
> > >
> > > Thanks for fixing.
> > >
> > > Reviewed-by: Yuwei Chen 
> > >
> > > > -Original Message-
> > > > From: Joey Vagedes 
> > > > Sent: Friday, December 29, 2023 12:48 AM
> > > > To: devel@edk2.groups.io
> > > > Cc: Rebecca Cran ; Gao, Liming
> > > > ; Feng, Bob C ;
> > Chen,
> > > > Christine 
> > > > Subject: [PATCH v1 1/1] BaseTools: Fix raw strings containing
> > > > valid escape characters
> > > >
> > > > Fixes raw regex strings that contain valid (and purposeful) escape
> > > > characters as they are being treated as individual characters
> > > > rather than the single escaped character they represent (i.e. '\t'
> > > > is being
> treated
> > as
> > > a '\' and a 't'
> > > > rather than a single tab character).
> > > >
> > > > Signed-off-by: Joey Vagedes 
> > > > Cc: Rebecca Cran 
> > > > Cc: Liming Gao 
> > > > Cc: Bob Feng 
> > > > Cc: Yuwei Chen 
> > > > ---
> > > >  BaseTools/Source/Python/AutoGen/GenMake.py| 2 +-
> > > >  BaseTools/Source/Python/Common/Misc.py| 2 +-
> > > >  BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++--
> > > >  3 files changed, 4 insertions(+), 4 deletions(-)
> > > >
> > > > diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py
> > > > b/BaseTools/Source/Python/AutoGen/GenMake.py
> > > > index c416fe172fe5..fbd35d498923 100755
> > > > --- a/BaseTools/Source/Python/AutoGen/GenMake.py
> > > > +++ b/BaseTools/Source/Python/AutoGen/GenMake.py
> > > > @@ -28,7 +28,7 @@ from Common.DataType import
> > > TAB_COMPILER_MSFT
> > > > gIncludePattern = re.compile(r"^[ \t]*[#%]?[ \t]*include(?:[
> > > > \t]*(?:\\(?:\r\n|\r|\n))*[ \t]*)*(?:\(?[ \"<]?[ \t]*)([-\w.\\/()
> > > > \t]+)(?:[ \t]*[\">]?\)?)", re.MULTILINE | re.UNICODE |
> > > > re.IGNORECASE)  ## Regular expression for matching macro used in
> > > > header file inclusion-gMacroPattern =
> > > > re.compile(r"([_A-Z][_A-Z0-9]*)[ \t]*\((.+)\)",
> > > > re.UNICODE)+gMacroPattern = re.compile("([_A-Z][_A-Z0-9]*)[
> > > > \t]*\\((.+)\\)",
> > > > re.UNICODE)  gIsFileMap = {} diff --git
> > > > a/BaseTools/Source/Python/Common/Misc.py
> > > > b/BaseTools/Source/Python/Common/Misc.py
> > > > index f87d9dbdba39..34bfc90abd94 100755
> > > > --- a/BaseTools/Source/Python/Common/Misc.py
> > > > +++ b/BaseTools/Source/Python/Common/Misc.py
> > > > @@ -1926,4 +1926,4 @@ def CopyDict(ori_dict):
> > > >  # Remove the c/c++ comments: // and /* */ # def
> > > > RemoveCComments(ctext):-return re.sub(r'//.*?\n|/\*.*?\*/', '\n',
> > ctext,
> > > > flags=re.S)+return re.sub('//.*?\n|/\\*.*?\\*/', '\n', ctext,
> > flags=re.S)diff --
> > > git
> > > > 

Re: [edk2-devel] [PATCH] BaseTools/Workspace: Build fail if structure PCD is referred

2023-12-28 Thread Joey Vagedes via groups.io
I found two other files with similar issues. Here is my patch series to resolve 
all.

[PATCH v1 1/1] BaseTools: Fix raw strings containing valid escape characters 
(groups.io) ( https://edk2.groups.io/g/devel/message/112986 )


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112987): https://edk2.groups.io/g/devel/message/112987
Mute This Topic: https://groups.io/mt/103395845/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v1 1/1] BaseTools: Fix raw strings containing valid escape characters

2023-12-28 Thread Joey Vagedes via groups.io
Fixes raw regex strings that contain valid (and purposeful) escape
characters as they are being treated as individual characters rather
than the single escaped character they represent (i.e. '\t' is being
treated as a '\' and a 't' rather than a single tab character).

Signed-off-by: Joey Vagedes 
Cc: Rebecca Cran 
Cc: Liming Gao 
Cc: Bob Feng 
Cc: Yuwei Chen 
---
 BaseTools/Source/Python/AutoGen/GenMake.py| 2 +-
 BaseTools/Source/Python/Common/Misc.py| 2 +-
 BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py 
b/BaseTools/Source/Python/AutoGen/GenMake.py
index c416fe172fe5..fbd35d498923 100755
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -28,7 +28,7 @@ from Common.DataType import TAB_COMPILER_MSFT
 gIncludePattern = re.compile(r"^[ \t]*[#%]?[ \t]*include(?:[ 
\t]*(?:\\(?:\r\n|\r|\n))*[ \t]*)*(?:\(?[\"<]?[ \t]*)([-\w.\\/() \t]+)(?:[ 
\t]*[\">]?\)?)", re.MULTILINE | re.UNICODE | re.IGNORECASE)
 
 ## Regular expression for matching macro used in header file inclusion
-gMacroPattern = re.compile(r"([_A-Z][_A-Z0-9]*)[ \t]*\((.+)\)", re.UNICODE)
+gMacroPattern = re.compile("([_A-Z][_A-Z0-9]*)[ \t]*\\((.+)\\)", re.UNICODE)
 
 gIsFileMap = {}
 
diff --git a/BaseTools/Source/Python/Common/Misc.py 
b/BaseTools/Source/Python/Common/Misc.py
index f87d9dbdba39..34bfc90abd94 100755
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -1926,4 +1926,4 @@ def CopyDict(ori_dict):
 # Remove the c/c++ comments: // and /* */
 #
 def RemoveCComments(ctext):
-return re.sub(r'//.*?\n|/\*.*?\*/', '\n', ctext, flags=re.S)
+return re.sub('//.*?\n|/\\*.*?\\*/', '\n', ctext, flags=re.S)
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 817cdbe5f19c..4768099343e5 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -2840,7 +2840,7 @@ class DscBuildData(PlatformBuildClassObject):
 # start generating makefile
 MakeApp = PcdMakefileHeader
 if sys.platform == "win32":
-MakeApp = MakeApp + r'APPFILE = %s\%s.exe\n' % (self.OutputPath, 
PcdValueInitName) + r'APPNAME = %s\n' % (PcdValueInitName) + r'OBJECTS = 
%s\%s.obj %s.obj\n' % (self.OutputPath, PcdValueInitName, 
os.path.join(self.OutputPath, PcdValueCommonName)) + 'INC = '
+MakeApp = MakeApp + 'APPFILE = %s\\%s.exe\n' % (self.OutputPath, 
PcdValueInitName) + 'APPNAME = %s\n' % (PcdValueInitName) + 'OBJECTS = 
%s\\%s.obj %s.obj\n' % (self.OutputPath, PcdValueInitName, 
os.path.join(self.OutputPath, PcdValueCommonName)) + 'INC = '
 else:
 MakeApp = MakeApp + PcdGccMakefile
 MakeApp = MakeApp + 'APPFILE = %s/%s\n' % (self.OutputPath, 
PcdValueInitName) + 'APPNAME = %s\n' % (PcdValueInitName) + 'OBJECTS = %s/%s.o 
%s.o\n' % (self.OutputPath, PcdValueInitName, os.path.join(self.OutputPath, 
PcdValueCommonName)) + \
@@ -2950,7 +2950,7 @@ class DscBuildData(PlatformBuildClassObject):
 MakeApp += "$(OBJECTS) : %s\n" % include_file
 if sys.platform == "win32":
 PcdValueCommonPath = 
os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], 
"Source\C\Common\PcdValueCommon.c"))
-MakeApp = MakeApp + r'%s\PcdValueCommon.c : %s\n' % 
(self.OutputPath, PcdValueCommonPath)
+MakeApp = MakeApp + '%s\\PcdValueCommon.c : %s\n' % 
(self.OutputPath, PcdValueCommonPath)
 MakeApp = MakeApp + '\tcopy /y %s $@\n' % (PcdValueCommonPath)
 else:
 PcdValueCommonPath = 
os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], 
"Source/C/Common/PcdValueCommon.c"))
-- 
2.43.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112986): https://edk2.groups.io/g/devel/message/112986
Mute This Topic: https://groups.io/mt/103403582/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v1 0/1] Fix raw strings containing valid escape characters

2023-12-28 Thread Joey Vagedes via groups.io
Commit 9f0061a03b61d282fbc0ba5be22155d06a5e64a1 was intended to fix regex
strings using invalid escape characters. The regex module suggested way to
fix this is to use the raw string modifiler (`r'`). However in doing this,
any strings that also contained valid escape characters that were being used
in the regex strings (mainly \t and \n) were broken. This is because the raw
string modifier converted them from the tab character and newline characters to
the literal character components.

This patch series updates any of the raw strings that contained valid escape
characters to resolve the issue.

Cc: Rebecca Cran 
Cc: Liming Gao 
Cc: Bob Feng 
Cc: Yuwei Chen 

Joey Vagedes (1):
  BaseTools: Fix raw strings containing valid escape characters

 BaseTools/Source/Python/AutoGen/GenMake.py| 2 +-
 BaseTools/Source/Python/Common/Misc.py| 2 +-
 BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

-- 
2.43.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112985): https://edk2.groups.io/g/devel/message/112985
Mute This Topic: https://groups.io/mt/103403581/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] Some unpredictable behavior while parsing the FDF file.

2023-12-28 Thread Joey Vagedes via groups.io
Hello.

It depends on the actual path that you are trying to include. This is the 
requirements for an include statement (coming directly from the FDF 
specification):

> 
> 
> 
> The tools look for  relative to the directory the FDF file
> resides. If the file is not found, and the directory containing this FDF
> file is not the same directory as the directory containing the DSC file,
> the tools must attempt to locate the file relaitive to the directory that
> contains the DSC file.
> 
> 
> 
> If none of these methods find the file, and a directory separator is in 
> 
> , the tools attempt to find the file in a WORKSPACE (or a directory listed
> in the PACKAGES_PATH) relative path. If the file cannot be found, the
> build system must exit with an appropriate error message.
> 
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112984): https://edk2.groups.io/g/devel/message/112984
Mute This Topic: https://groups.io/mt/103394871/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] BaseTools/Workspace: Build fail if structure PCD is referred

2023-12-28 Thread Joey Vagedes via groups.io
Hello,

This is in regard to my recent patch (see commit here: BaseTools: Resolve regex 
syntax warnings · tianocore/edk2@9f0061a (github.com) ( 
https://github.com/tianocore/edk2/commit/9f0061a03b61d282fbc0ba5be22155d06a5e64a1
 ) ) that was resolving the newly introduced syntax warnings (that will become 
syntax errors) in Python3.12 for using invalid escape characters.

A few of the strings that I converted from normal strings to raw strings to 
resolve the issue contained both valid and invalid escape characters. I'm going 
back through the changes I made in the PR to resolve any strings that contain 
both valid and invalid escape characters.

I will send out the patch soon.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112983): https://edk2.groups.io/g/devel/message/112983
Mute This Topic: https://groups.io/mt/103395845/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Resolve regex syntax warnings

2023-12-13 Thread Joey Vagedes via groups.io
Hello!

Raw strings (the r prefix for a string) has been around since python 2, so
this change will not break anything. It just ensures that the backwards
slash is never treated as an escape character, which is what is expected
for regex strings.

The only change that occurred is that python 3.12 now displays a syntax
warning when it sees an invalid escape character. This is expected for
regex strings, which is why it is suggested to use raw strings when
creating regex strings.

Thanks,
Joey

On Mon, Dec 11, 2023 at 4:30 PM gaoliming  wrote:

> Joey:
>   Does this change still work on old python version, such as Python 3.9?
>
> Thanks
> Liming
> > -邮件原件-
> > 发件人: Joey Vagedes 
> > 发送时间: 2023年12月7日 4:27
> > 收件人: devel@edk2.groups.io
> > 抄送: Rebecca Cran ; Liming Gao
> > ; Bob Feng ; Yuwei Chen
> > 
> > 主题: [PATCH v1 1/1] BaseTools: Resolve regex syntax warnings
> >
> > Switches regex patterns to raw text to resolve python 3.12 syntax
> > warnings in regards to invalid escape sequences, as is suggested by the
> > re (regex) module in python.
> >
> > Cc: Rebecca Cran 
> > Cc: Liming Gao 
> > Cc: Bob Feng 
> > Cc: Yuwei Chen 
> > Signed-off-by: Joey Vagedes 
> > ---
> >  BaseTools/Source/Python/AmlToC/AmlToC.py |  2
> > +-
> >  BaseTools/Source/Python/AutoGen/BuildEngine.py   |  2
> > +-
> >  BaseTools/Source/Python/AutoGen/GenDepex.py  |
> > 2 +-
> >  BaseTools/Source/Python/AutoGen/GenMake.py   |
> > 2 +-
> >  BaseTools/Source/Python/AutoGen/IdfClassObject.py|  2 +-
> >  BaseTools/Source/Python/AutoGen/ModuleAutoGen.py |  4
> > ++--
> >  BaseTools/Source/Python/AutoGen/StrGather.py |  2
> > +-
> >  BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py  |  2
> > +-
> >  BaseTools/Source/Python/Common/Expression.py | 16
> > ++---
> >  BaseTools/Source/Python/Common/GlobalData.py |
> > 4 ++--
> >  BaseTools/Source/Python/Common/Misc.py   |
> > 24 ++--
> >  BaseTools/Source/Python/Common/ToolDefClassObject.py |  6
> > ++---
> >  BaseTools/Source/Python/GenFds/FdfParser.py  | 10
> > 
> >  BaseTools/Source/Python/GenFds/GenFds.py |  2
> > +-
> >  BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py | 12
> > +-
> >  BaseTools/Source/Python/Trim/Trim.py | 18
> > +++
> >  BaseTools/Source/Python/Workspace/DscBuildData.py|  8
> > +++
> >  BaseTools/Source/Python/Workspace/MetaFileParser.py  |  2 +-
> >  18 files changed, 60 insertions(+), 60 deletions(-)
> >
> > diff --git a/BaseTools/Source/Python/AmlToC/AmlToC.py
> > b/BaseTools/Source/Python/AmlToC/AmlToC.py
> > index 346de7159de7..63931c9720c9 100644
> > --- a/BaseTools/Source/Python/AmlToC/AmlToC.py
> > +++ b/BaseTools/Source/Python/AmlToC/AmlToC.py
> > @@ -17,7 +17,7 @@ from Common.BuildToolError import *
> >  import sys
> >
> >  import os
> >
> >
> >
> > -__description__ = """
> >
> > +__description__ = r"""
> >
> >  Convert an AML file to a .c file containing the AML bytecode stored in a
> C
> >
> >  array. By default, Tables\Dsdt.aml will generate Tables\Dsdt.c.
> >
> >  Tables\Dsdt.c will contain a C array named "dsdt_aml_code" that contains
> >
> > diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py
> > b/BaseTools/Source/Python/AutoGen/BuildEngine.py
> > index 752a1a1f6a86..45b39d7878d5 100644
> > --- a/BaseTools/Source/Python/AutoGen/BuildEngine.py
> > +++ b/BaseTools/Source/Python/AutoGen/BuildEngine.py
> > @@ -306,7 +306,7 @@ class BuildRule:
> >  _SubSectionList = [_InputFile, _OutputFile, _Command]
> >
> >
> >
> >  _PATH_SEP = "(+)"
> >
> > -_FileTypePattern = re.compile("^[_a-zA-Z][_\-0-9a-zA-Z]*$")
> >
> > +_FileTypePattern = re.compile(r"^[_a-zA-Z][_\-0-9a-zA-Z]*$")
> >
> >  _BinaryFileRule = FileBuildRule(TAB_DEFAULT_BINARY_FILE, [],
> > [os.path.join("$(OUTPUT_DIR)", "${s_name}")],
> >
> >  ["$(CP) ${src} ${dst}"], [])
> >
> >
> >
> > diff --git a/BaseTools/Source/Python/AutoGen/GenDepex.py
> > b/BaseTools/Source/Python/AutoGen/GenDepex.py
> > index f2f2e9d65b5f..b6db6645a4fb 100644
> > --- a/BaseTools/Source/Python/AutoGen/GenDepex.py
> > +++ b/BaseTools/Source/Python/AutoGen/GenDepex.py
> > @@ -126,7 +126,7 @@ class DependencyExpression:
> >  #
> >
> >  # open and close brace must be taken as individual tokens
> >
> >  #
> >
> > -TokenPattern = re.compile("(\(|\)|\{[^{}]+\{?[^{}]+\}?[ ]*\}|\w+)")
> >
> > +TokenPattern = re.compile(r"(\(|\)|\{[^{}]+\{?[^{}]+\}?[ ]*\}|\w+)")
> >
> >
> >
> >  ## Constructor
> >
> >  #
> >
> > diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py
> > b/BaseTools/Source/Python/AutoGen/GenMake.py
> > index daec9c6d54b2..c416fe172fe5 100755
> > --- a/BaseTools/Source/Python/AutoGen/GenMake.py
> > +++ 

[edk2-devel] [PATCH v1 0/1] Resolve regex syntax warnings

2023-12-06 Thread Joey Vagedes via groups.io
Python 3.12 now produces syntax warnings when using an invalid escape
character (\ followed by an unexpected character). This happens
throughout BaseTools due the usage of regular expressions. the re module
in python suggests that when creating regex patterns, to use raw text.
This patch series adds the r prefix to any regex pattern that uses an
invalid escape sequence.

Cc: Rebecca Cran 
Cc: Liming Gao 
Cc: Bob Feng 
Cc: Yuwei Chen 
Signed-off-by: Joey Vagedes 

Joey Vagedes (1):
  BaseTools: Resolve regex syntax warnings

 BaseTools/Source/Python/AmlToC/AmlToC.py |  2 +-
 BaseTools/Source/Python/AutoGen/BuildEngine.py   |  2 +-
 BaseTools/Source/Python/AutoGen/GenDepex.py  |  2 +-
 BaseTools/Source/Python/AutoGen/GenMake.py   |  2 +-
 BaseTools/Source/Python/AutoGen/IdfClassObject.py|  2 +-
 BaseTools/Source/Python/AutoGen/ModuleAutoGen.py |  4 ++--
 BaseTools/Source/Python/AutoGen/StrGather.py |  2 +-
 BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py  |  2 +-
 BaseTools/Source/Python/Common/Expression.py | 16 ++---
 BaseTools/Source/Python/Common/GlobalData.py |  4 ++--
 BaseTools/Source/Python/Common/Misc.py   | 24 
++--
 BaseTools/Source/Python/Common/ToolDefClassObject.py |  6 ++---
 BaseTools/Source/Python/GenFds/FdfParser.py  | 10 
 BaseTools/Source/Python/GenFds/GenFds.py |  2 +-
 BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py | 12 +-
 BaseTools/Source/Python/Trim/Trim.py | 18 
+++
 BaseTools/Source/Python/Workspace/DscBuildData.py|  8 +++
 BaseTools/Source/Python/Workspace/MetaFileParser.py  |  2 +-
 18 files changed, 60 insertions(+), 60 deletions(-)

-- 
2.43.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112139): https://edk2.groups.io/g/devel/message/112139
Mute This Topic: https://groups.io/mt/103021364/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v1 1/1] BaseTools: Resolve regex syntax warnings

2023-12-06 Thread Joey Vagedes via groups.io
Switches regex patterns to raw text to resolve python 3.12 syntax
warnings in regards to invalid escape sequences, as is suggested by the
re (regex) module in python.

Cc: Rebecca Cran 
Cc: Liming Gao 
Cc: Bob Feng 
Cc: Yuwei Chen 
Signed-off-by: Joey Vagedes 
---
 BaseTools/Source/Python/AmlToC/AmlToC.py |  2 +-
 BaseTools/Source/Python/AutoGen/BuildEngine.py   |  2 +-
 BaseTools/Source/Python/AutoGen/GenDepex.py  |  2 +-
 BaseTools/Source/Python/AutoGen/GenMake.py   |  2 +-
 BaseTools/Source/Python/AutoGen/IdfClassObject.py|  2 +-
 BaseTools/Source/Python/AutoGen/ModuleAutoGen.py |  4 ++--
 BaseTools/Source/Python/AutoGen/StrGather.py |  2 +-
 BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py  |  2 +-
 BaseTools/Source/Python/Common/Expression.py | 16 ++---
 BaseTools/Source/Python/Common/GlobalData.py |  4 ++--
 BaseTools/Source/Python/Common/Misc.py   | 24 
++--
 BaseTools/Source/Python/Common/ToolDefClassObject.py |  6 ++---
 BaseTools/Source/Python/GenFds/FdfParser.py  | 10 
 BaseTools/Source/Python/GenFds/GenFds.py |  2 +-
 BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py | 12 +-
 BaseTools/Source/Python/Trim/Trim.py | 18 
+++
 BaseTools/Source/Python/Workspace/DscBuildData.py|  8 +++
 BaseTools/Source/Python/Workspace/MetaFileParser.py  |  2 +-
 18 files changed, 60 insertions(+), 60 deletions(-)

diff --git a/BaseTools/Source/Python/AmlToC/AmlToC.py 
b/BaseTools/Source/Python/AmlToC/AmlToC.py
index 346de7159de7..63931c9720c9 100644
--- a/BaseTools/Source/Python/AmlToC/AmlToC.py
+++ b/BaseTools/Source/Python/AmlToC/AmlToC.py
@@ -17,7 +17,7 @@ from Common.BuildToolError import *
 import sys
 import os
 
-__description__ = """
+__description__ = r"""
 Convert an AML file to a .c file containing the AML bytecode stored in a C
 array. By default, Tables\Dsdt.aml will generate Tables\Dsdt.c.
 Tables\Dsdt.c will contain a C array named "dsdt_aml_code" that contains
diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py 
b/BaseTools/Source/Python/AutoGen/BuildEngine.py
index 752a1a1f6a86..45b39d7878d5 100644
--- a/BaseTools/Source/Python/AutoGen/BuildEngine.py
+++ b/BaseTools/Source/Python/AutoGen/BuildEngine.py
@@ -306,7 +306,7 @@ class BuildRule:
 _SubSectionList = [_InputFile, _OutputFile, _Command]
 
 _PATH_SEP = "(+)"
-_FileTypePattern = re.compile("^[_a-zA-Z][_\-0-9a-zA-Z]*$")
+_FileTypePattern = re.compile(r"^[_a-zA-Z][_\-0-9a-zA-Z]*$")
 _BinaryFileRule = FileBuildRule(TAB_DEFAULT_BINARY_FILE, [], 
[os.path.join("$(OUTPUT_DIR)", "${s_name}")],
 ["$(CP) ${src} ${dst}"], [])
 
diff --git a/BaseTools/Source/Python/AutoGen/GenDepex.py 
b/BaseTools/Source/Python/AutoGen/GenDepex.py
index f2f2e9d65b5f..b6db6645a4fb 100644
--- a/BaseTools/Source/Python/AutoGen/GenDepex.py
+++ b/BaseTools/Source/Python/AutoGen/GenDepex.py
@@ -126,7 +126,7 @@ class DependencyExpression:
 #
 # open and close brace must be taken as individual tokens
 #
-TokenPattern = re.compile("(\(|\)|\{[^{}]+\{?[^{}]+\}?[ ]*\}|\w+)")
+TokenPattern = re.compile(r"(\(|\)|\{[^{}]+\{?[^{}]+\}?[ ]*\}|\w+)")
 
 ## Constructor
 #
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py 
b/BaseTools/Source/Python/AutoGen/GenMake.py
index daec9c6d54b2..c416fe172fe5 100755
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -28,7 +28,7 @@ from Common.DataType import TAB_COMPILER_MSFT
 gIncludePattern = re.compile(r"^[ \t]*[#%]?[ \t]*include(?:[ 
\t]*(?:\\(?:\r\n|\r|\n))*[ \t]*)*(?:\(?[\"<]?[ \t]*)([-\w.\\/() \t]+)(?:[ 
\t]*[\">]?\)?)", re.MULTILINE | re.UNICODE | re.IGNORECASE)
 
 ## Regular expression for matching macro used in header file inclusion
-gMacroPattern = re.compile("([_A-Z][_A-Z0-9]*)[ \t]*\((.+)\)", re.UNICODE)
+gMacroPattern = re.compile(r"([_A-Z][_A-Z0-9]*)[ \t]*\((.+)\)", re.UNICODE)
 
 gIsFileMap = {}
 
diff --git a/BaseTools/Source/Python/AutoGen/IdfClassObject.py 
b/BaseTools/Source/Python/AutoGen/IdfClassObject.py
index a6b8123c2539..bb413c6a26e3 100644
--- a/BaseTools/Source/Python/AutoGen/IdfClassObject.py
+++ b/BaseTools/Source/Python/AutoGen/IdfClassObject.py
@@ -18,7 +18,7 @@ import os
 from Common.GlobalData import gIdentifierPattern
 from .UniClassObject import StripComments
 
-IMAGE_TOKEN = re.compile('IMAGE_TOKEN *\(([A-Z0-9_]+) *\)', re.MULTILINE | 
re.UNICODE)
+IMAGE_TOKEN = re.compile(r'IMAGE_TOKEN *\(([A-Z0-9_]+) *\)', re.MULTILINE | 
re.UNICODE)
 
 #
 # Value of different image information block types
diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py 
b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
index d05410b32966..65a2176ca982 100755
--- 

Re: [edk2-devel] [PATCH v1 1/1] .github/workflows/codeql.yml: Add emacs output

2023-11-29 Thread Joey Vagedes via groups.io
Reviewed-by: Joey Vagedes 

On Wed, Nov 29, 2023 at 9:01 AM  wrote:

> From: Michael Kubacki 
>
> Updates the workflow to also output files that can be loaded in emacs
> to show CodeQL issues (in addition to the existing SARIF output for
> standard SARIF viewers).
>
> The emacs files are in the SARIF zip file attached to each "CodeQL"
> run (https://github.com/tianocore/edk2/actions/workflows/codeql.yml).
>
> The file name ends with "-emacs.txt". An MdePkg example:
>   "codeql-db-mdepkg-debug-0-emacs.txt".
>
> Cc: Joey Vagedes 
> Cc: Laszlo Ersek 
> Cc: Michael D Kinney 
> Cc: Sean Brogan 
> Signed-off-by: Michael Kubacki 
> ---
>
> Notes:
> An example CodeQL run with this change:
>
> https://github.com/tianocore/edk2/actions/runs/7035482184
>
>  .github/workflows/codeql.yml | 20 
>  1 file changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
> index 72ece9dcb446..e826e67eb912 100644
> --- a/.github/workflows/codeql.yml
> +++ b/.github/workflows/codeql.yml
> @@ -92,7 +92,7 @@ jobs:
>  git config --system core.longpaths true
>
>  - name: Install/Upgrade pip Modules
> -  run: pip install -r pip-requirements.txt --upgrade requests
> +  run: pip install -r pip-requirements.txt --upgrade requests
> sarif-tools
>
>  - name: Determine CI Settings File Supported Operations
>id: get_ci_file_operations
> @@ -304,16 +304,26 @@ jobs:
>  PACKAGE_NAME: ${{ matrix.Package }}
>shell: python
>run: |
> +import logging
>  import os
> +from edk2toollib.utility_functions import RunCmd
> +from io import StringIO
> +from pathlib import Path
>
>  package = os.environ['PACKAGE_NAME'].strip().lower()
>  directory_name = 'codeql-analysis-' + package + '-debug'
>  file_name = 'codeql-db-' + package + '-debug-0.sarif'
> -sarif_path = os.path.join('Build', directory_name, file_name)
> +sarif_path = Path('Build', directory_name, file_name)
>
>  with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
> -if os.path.isfile(sarif_path):
> +if sarif_path.is_file():
> +emacs_file_path = sarif_path.with_name(sarif_path.stem +
> "-emacs.txt")
> +out_stream_buffer = StringIO()
> +exit_code = RunCmd("sarif", f"emacs {sarif_path} --output
> {emacs_file_path}",
> +   outstream=out_stream_buffer,
> +   logging_level=logging.NOTSET)
>  print(f'upload_sarif_file=true', file=fh)
> +print(f'emacs_file_path={emacs_file_path}', file=fh)
>  print(f'sarif_file_path={sarif_path}', file=fh)
>  else:
>  print(f'upload_sarif_file=false', file=fh)
> @@ -323,7 +333,9 @@ jobs:
>if: steps.env_data.outputs.upload_sarif_file == 'true'
>with:
>  name: ${{ matrix.Package }}-CodeQL-SARIF
> -path: ${{ steps.env_data.outputs.sarif_file_path }}
> +path: |
> +  ${{ steps.env_data.outputs.emacs_file_path }}
> +  ${{ steps.env_data.outputs.sarif_file_path }}
>  retention-days: 14
>  if-no-files-found: warn
>
> --
> 2.43.0.windows.1
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111853): https://edk2.groups.io/g/devel/message/111853
Mute This Topic: https://groups.io/mt/102875700/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 0/2] Automatically set NXCOMPAT bit if requirements are met

2023-11-06 Thread Joey Vagedes via groups.io
Thank you, Rebecca!


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110770): https://edk2.groups.io/g/devel/message/110770
Mute This Topic: https://groups.io/mt/100122559/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 0/1] Edk2ToolsBuild.py: Clarify make error

2023-11-06 Thread Joey Vagedes via groups.io
I made a recent change to how I use git send-email:

I follow Laszlo's unkempt git guide for edk2 contributors and maintainers. 
There was a recent update to add --transfer-encoding=base64 to the git 
send-email command. My guess is that caused the random data. I do not see that 
data on the "send" side in my outbox, however.

https://github.com/tianocore/tianocore.github.io/wiki/Laszlo's-unkempt-git-guide-for-edk2-contributors-and-maintainers/_compare/385073186afb8dd7cb8af4c9fcd96d86423fd9d3

Joey

-Original Message-
From: Kinney, Michael D  
Sent: Monday, November 6, 2023 1:54 PM
To: devel@edk2.groups.io; Joey Vagedes 
Cc: Kinney, Michael D 
Subject: [EXTERNAL] RE: [edk2-devel] [PATCH v1 0/1] Edk2ToolsBuild.py: Clarify 
make error

What is the random data at the end of your path emails???

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Joey 
> Vagedes via groups.io
> Sent: Monday, November 6, 2023 12:09 PM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [PATCH v1 0/1] Edk2ToolsBuild.py: Clarify make 
> error
> 
> When make or nmake fails to build the basetools, Edk2ToolsBuild.py 
> currently prints a generic error message "Failed to build." and raises 
> an exception. This has two issues: The first is that it raises an 
> exception, which leads people to believe it is a python issue, and not 
> a build issue. The second is that users don't necessarily know to 
> check the build log if this error occurs.
> 
> This has been reported many times through many different avenues:
> 
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> ub.com%2Ftianocore%2Fedk2%2Fdiscussions%2F4611=05%7C01%7Cjoeyvage
> des%40microsoft.com%7C271dfa9b91c844696b5808dbdf12e82c%7C72f988bf86f14
> 1af91ab2d7cd011db47%7C1%7C0%7C638349044524508743%7CUnknown%7CTWFpbGZsb
> 3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%
> 7C3000%7C%7C%7C=5aewZruHiYbB9dBtbVegXeJmDdMre5oWasFWCnSmYDc%3D
> eserved=0
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstac
> koverflow.com%2Fquestions%2F77421168%2Fedkii-base-tools-fails-=05
> %7C01%7Cjoeyvagedes%40microsoft.com%7C271dfa9b91c844696b5808dbdf12e82c
> %7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638349044524515634%7CUnk
> nown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWw
> iLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=P2GDkAZrpm1pZHE9Vl4RKLszDTEzAGW7
> xF5Wh%2Byakkw%3D=0
> to-build
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> ub.com%2Ftianocore%2Fedk2-pytool-extensions%2Fissues%2F180=05%7C0
> 1%7Cjoeyvagedes%40microsoft.com%7C271dfa9b91c844696b5808dbdf12e82c%7C7
> 2f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638349044524521511%7CUnknown
> %7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJ
> XVCI6Mn0%3D%7C3000%7C%7C%7C=uahh%2FKPyyLsf19R0WLszjkWGRg6x3jVLq7
> GDGuBdS4o%3D=0
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> ub.com%2Ftianocore%2Fedk2-pytool-extensions%2Fissues%2F207=05%7C0
> 1%7Cjoeyvagedes%40microsoft.com%7C271dfa9b91c844696b5808dbdf12e82c%7C7
> 2f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638349044524526191%7CUnknown
> %7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJ
> XVCI6Mn0%3D%7C3000%7C%7C%7C=MvX3P5bYPvwI7z%2BDiy%2Bbezj0kBEx51RQ
> GTkoS6WUiDI%3D=0
> 
> This patch series changes the exception to a error log so that the 
> invocable completes and returns a non-zero exit code and also logs a 
> more descriptive error that informs the user to review the build log, 
> and where to find it.
> 
> Joey Vagedes (1):
>   BaseTools: Edk2ToolsBuild.py: Clarify make error
> 
>  BaseTools/Source/C/Common/BinderFuncs.c | 2 +-
>  BaseTools/Edk2ToolsBuild.py | 8 ++--
>  2 files changed, 7 insertions(+), 3 deletions(-)
> 
> --
> 2.34.1
> 
> ®‹©²*
> Šy,b‹«yÇ¢½æ¥–g¬±¨²Ç§¶Ú-†+ ®‹©V'°ý©—#§–)Þ×];çˆm¶›?ýçdÚ èº›"£ø?uëÞ— 
> ùž²Æ {ýuÓ¾x2ë^N¬NŠbrm¦Ïÿ‚º.¦È¨þk×M¸ÛÎüïýzã~=èj躓°êÝz÷¥úŒ'z·“h+¢ê
> lŠ…'²æìr¸›zm¦ÏÿyÙ6‚º.¦È¨þÝz÷¥þéì¹¹¢rž•Ù"žw²Š{^•Ê&


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110769): https://edk2.groups.io/g/devel/message/110769
Mute This Topic: https://groups.io/mt/102428787/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v1 1/1] BaseTools: Edk2ToolsBuild.py: Clarify make error

2023-11-06 Thread Joey Vagedes via groups.io
Clarify to users that they should review the build log when make
(POSIX-like system) or nmake (Windows) fails to compile basetools.

Cc: Rebecca Cran 
Cc: Liming Gao 
Cc: Bob Feng 
Cc: Yuwei Chen 
Signed-off-by: Joey Vagedes 
---
 BaseTools/Edk2ToolsBuild.py | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Edk2ToolsBuild.py b/BaseTools/Edk2ToolsBuild.py
index 425bb1b63963..4776c583080f 100644
--- a/BaseTools/Edk2ToolsBuild.py
+++ b/BaseTools/Edk2ToolsBuild.py
@@ -141,7 +141,9 @@ class Edk2ToolsBuild(BaseAbstractInvocable):
 for level, problem in problems:
 logging.log(level, problem)
 if ret != 0:
-raise Exception("Failed to build.")
+e = "Failed to run nmake.exe. Review Buildlog at 
BaseTools/BaseToolsBuild/BASETOOLS_BUILD.txt for nmake.exe error."
+logging.error(e)
+return ret
 
 self.WritePathEnvFile(self.OutputDir)
 return ret
@@ -156,7 +158,9 @@ class Edk2ToolsBuild(BaseAbstractInvocable):
 for level, problem in problems:
 logging.log(level, problem)
 if ret != 0:
-raise Exception("Failed to build.")
+e = "Failed to run make. Review Buildlog at 
BaseTools/BaseToolsBuild/BASETOOLS_BUILD.txt for make error."
+logging.error(e)
+return ret
 
 self.OutputDir = os.path.join(
 shell_env.get_shell_var("EDK_TOOLS_PATH"), "Source", "C", 
"bin")
-- 
2.34.1



[edk2-devel] [PATCH v2 0/1] Edk2ToolsBuild.py: Clarify make error

2023-11-06 Thread Joey Vagedes via groups.io
When make or nmake fails to build the basetools, Edk2ToolsBuild.py
currently prints a generic error message "Failed to build." and
raises an exception. This has two issues: The first is that it raises
an exception, which leads people to believe it is a python issue, and
not a build issue. The second is that users don't necessarily know to
check the build log if this error occurs.

This has been reported many times through many different avenues:

https://github.com/tianocore/edk2/discussions/4611
https://stackoverflow.com/questions/77421168/edkii-base-tools-fails-to-build
https://github.com/tianocore/edk2-pytool-extensions/issues/180
https://github.com/tianocore/edk2-pytool-extensions/issues/207

This patch series changes the exception to a error log so that the invocable
completes and returns a non-zero exit code and also logs a more descriptive
error that informs the user to review the build log, and where to find it.

Cc: Rebecca Cran 
Cc: Liming Gao 
Cc: Bob Feng 
Cc: Yuwei Chen 

Joey Vagedes (1):
  BaseTools: Edk2ToolsBuild.py: Clarify make error

 BaseTools/Edk2ToolsBuild.py | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

-- 
2.34.1



[edk2-devel] [PATCH v1 1/1] BaseTools: Edk2ToolsBuild.py: Clarify make error

2023-11-06 Thread Joey Vagedes via groups.io
Clarify to users that they should review the build log when make
(POSIX-like system) or nmake (Windows) fails to compile basetools.

Cc: Rebecca Cran 
Cc: Liming Gao 
Cc: Bob Feng 
Cc: Yuwei Chen 
Signed-off-by: Joey Vagedes 
---
 BaseTools/Source/C/Common/BinderFuncs.c | 2 +-
 BaseTools/Edk2ToolsBuild.py | 8 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/BaseTools/Source/C/Common/BinderFuncs.c 
b/BaseTools/Source/C/Common/BinderFuncs.c
index de835287e95c..8c08bef7a0f0 100644
--- a/BaseTools/Source/C/Common/BinderFuncs.c
+++ b/BaseTools/Source/C/Common/BinderFuncs.c
@@ -21,7 +21,7 @@ CommonLibBinderAllocate (
   )
 {
   return (VOID *) malloc (Size);
-}
+}asdf
 
 VOID
 CommonLibBinderFree (
diff --git a/BaseTools/Edk2ToolsBuild.py b/BaseTools/Edk2ToolsBuild.py
index 425bb1b63963..4776c583080f 100644
--- a/BaseTools/Edk2ToolsBuild.py
+++ b/BaseTools/Edk2ToolsBuild.py
@@ -141,7 +141,9 @@ class Edk2ToolsBuild(BaseAbstractInvocable):
 for level, problem in problems:
 logging.log(level, problem)
 if ret != 0:
-raise Exception("Failed to build.")
+e = "Failed to run nmake.exe. Review Buildlog at 
BaseTools/BaseToolsBuild/BASETOOLS_BUILD.txt for nmake.exe error."
+logging.error(e)
+return ret
 
 self.WritePathEnvFile(self.OutputDir)
 return ret
@@ -156,7 +158,9 @@ class Edk2ToolsBuild(BaseAbstractInvocable):
 for level, problem in problems:
 logging.log(level, problem)
 if ret != 0:
-raise Exception("Failed to build.")
+e = "Failed to run make. Review Buildlog at 
BaseTools/BaseToolsBuild/BASETOOLS_BUILD.txt for make error."
+logging.error(e)
+return ret
 
 self.OutputDir = os.path.join(
 shell_env.get_shell_var("EDK_TOOLS_PATH"), "Source", "C", 
"bin")
-- 
2.34.1



[edk2-devel] [PATCH v1 0/1] Edk2ToolsBuild.py: Clarify make error

2023-11-06 Thread Joey Vagedes via groups.io
When make or nmake fails to build the basetools, Edk2ToolsBuild.py
currently prints a generic error message "Failed to build." and 
raises an exception. This has two issues: The first is that it raises
an exception, which leads people to believe it is a python issue, and
not a build issue. The second is that users don't necessarily know to
check the build log if this error occurs. 

This has been reported many times through many different avenues:

https://github.com/tianocore/edk2/discussions/4611
https://stackoverflow.com/questions/77421168/edkii-base-tools-fails-to-build
https://github.com/tianocore/edk2-pytool-extensions/issues/180
https://github.com/tianocore/edk2-pytool-extensions/issues/207

This patch series changes the exception to a error log so that the invocable
completes and returns a non-zero exit code and also logs a more descriptive
error that informs the user to review the build log, and where to find it.

Joey Vagedes (1):
  BaseTools: Edk2ToolsBuild.py: Clarify make error

 BaseTools/Source/C/Common/BinderFuncs.c | 2 +-
 BaseTools/Edk2ToolsBuild.py | 8 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

-- 
2.34.1



[edk2-devel] [PATCH v1 1/1] BaseTools: Resolve invalid escape sequence

2023-10-31 Thread Joey Vagedes via groups.io
Resolves an invalid escape sequence in a regex string that occurs
because the string was not marked as a raw string, so backslash
characters create unexpected escape sequences.

This was brought to light due to Python 3.12 now detecting invalid
escape sequences and generates a warning. It is best practice to
always use raw strings for regex strings.

Cc: Rebecca Cran 
Cc: Liming Gao 
Cc: Bob Feng 
Cc: Yuwei Chen 
Signed-off-by: Joey Vagedes 
---
 BaseTools/Scripts/BinToPcd.py | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/BaseTools/Scripts/BinToPcd.py b/BaseTools/Scripts/BinToPcd.py
index 460c08b7f7cd..43fc458b0426 100644
--- a/BaseTools/Scripts/BinToPcd.py
+++ b/BaseTools/Scripts/BinToPcd.py
@@ -10,13 +10,12 @@ BinToPcd
 '''
 from __future__ import print_function
 
-import sys
 import argparse
-import re
-import xdrlib
 import io
-import struct
 import math
+import re
+import struct
+import sys
 
 #
 # Globals for help information
@@ -38,13 +37,13 @@ if __name__ == '__main__':
 return Value
 
 def ValidatePcdName (Argument):
-if re.split ('[a-zA-Z\_][a-zA-Z0-9\_]*\.[a-zA-Z\_][a-zA-Z0-9\_]*', 
Argument) != ['', '']:
+if re.split (r'[a-zA-Z\_][a-zA-Z0-9\_]*\.[a-zA-Z\_][a-zA-Z0-9\_]*', 
Argument) != ['', '']:
 Message = '{Argument} is not in the form 
.'.format (Argument = Argument)
 raise argparse.ArgumentTypeError (Message)
 return Argument
 
 def ValidateGuidName (Argument):
-if re.split ('[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) != ['', '']:
+if re.split (r'[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) != ['', '']:
 Message = '{Argument} is not a valid GUID C name'.format (Argument 
= Argument)
 raise argparse.ArgumentTypeError (Message)
 return Argument
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110448): https://edk2.groups.io/g/devel/message/110448
Mute This Topic: https://groups.io/mt/102305837/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 0/2] Upgrade edk2-pytools to latest

2023-10-27 Thread Joey Vagedes via groups.io
Thank you for the reviews. Pending any reviews other maintainers of these 
packages would like to do, this patch series is ready to merge. I've updated 
the PR with the reviewed-by tags:

https://github.com/tianocore/edk2/pull/4966

Joey

-Original Message-
From: Michael Kubacki  
Sent: Friday, October 27, 2023 10:32 AM
To: devel@edk2.groups.io; Joey Vagedes 
Cc: Sean Brogan ; Kinney, Michael D 
; Liming Gao 
Subject: Re: [edk2-devel] [PATCH v1 0/2] Upgrade edk2-pytools to latest

Series:

Reviewed-by: Michael Kubacki 

On 10/27/2023 11:15 AM, Joey Vagedes via groups.io wrote:
> Upgrades edk2-pytool-library to v0.19.3 and edk2-pytool-extensions to 
> v0.25.1 and performs all necessary integrations as noted in the 
> individual package commits.
> 
> Cc: Sean Brogan 
> Cc: Michael Kubacki 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> 
> Joey Vagedes (2):
>.pytool: Integration of edk2-pytools
>BaseTools: Plugin: Integration of edk2-pytools
> 
>   .pytool/Plugin/HostUnitTestDscCompleteCheck/HostUnitTestDscCompleteCheck.py 
> |  7 ---
>   .pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py   
> | 12 ++--
>   BaseTools/Plugin/DebugMacroCheck/BuildPlugin/DebugMacroCheckBuildPlugin.py  
> | 10 +-
>   pip-requirements.txt
> |  4 ++--
>   4 files changed, 17 insertions(+), 16 deletions(-)
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110225): https://edk2.groups.io/g/devel/message/110225
Mute This Topic: https://groups.io/mt/102223493/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v2 12/12] IntelFsp2WrapperPkg: CI: Add PrEval entry

2023-10-23 Thread Joey Vagedes via groups.io
From: Joey Vagedes 

Adds a PrEval entry to the package's ci.yaml file which is used to
verify if the package uses a particular library instance when that
library instance file (INF) is updated.

When a library instance file (INF) is updated, PrEval will review each
package's DSC as described in the ci.yaml file to determine if the
package uses said library instance. If the package does use the library
instance, it will be built and tested to ensure the package is not
broken from the change.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Duggapu Chinni B 
Cc: Chen Gang C 
Cc: Star Zeng 
Cc: Ted Kuo 
Cc: Ashraf Ali S 
Cc: Susovan Mohapatra 
Signed-off-by: Joey Vagedes 

Reviewed-by: Nate DeSimone 
---
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.ci.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.ci.yaml 
b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.ci.yaml
index 45cb5a7d6f32..2d32bc65b415 100644
--- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.ci.yaml
+++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.ci.yaml
@@ -6,6 +6,9 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 {
+"PrEval": {
+"DscPath": "IntelFsp2WrapperPkg.dsc",
+},
 ## options defined .pytool/Plugin/LicenseCheck
 "LicenseCheck": {
 "IgnoreFiles": []
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109947): https://edk2.groups.io/g/devel/message/109947
Mute This Topic: https://groups.io/mt/102140981/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v2 10/12] MdePkg: CI: Add PrEval entry

2023-10-23 Thread Joey Vagedes via groups.io
From: Joey Vagedes 

Adds a PrEval entry to the package's ci.yaml file which is used to
verify if the package uses a particular library instance when that
library instance file (INF) is updated.

When a library instance file (INF) is updated, PrEval will review each
package's DSC as described in the ci.yaml file to determine if the
package uses said library instance. If the package does use the library
instance, it will be built and tested to ensure the package is not
broken from the change.

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Signed-off-by: Joey Vagedes 

Reviewed-by: Liming Gao 
---
 MdePkg/MdePkg.ci.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/MdePkg/MdePkg.ci.yaml b/MdePkg/MdePkg.ci.yaml
index f024b48685ef..8d9c63b0e535 100644
--- a/MdePkg/MdePkg.ci.yaml
+++ b/MdePkg/MdePkg.ci.yaml
@@ -8,6 +8,9 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 {
+"PrEval": {
+"DscPath": "MdePkg.dsc",
+},
 ## options defined .pytool/Plugin/LicenseCheck
 "LicenseCheck": {
 "IgnoreFiles": [
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109945): https://edk2.groups.io/g/devel/message/109945
Mute This Topic: https://groups.io/mt/102140978/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v2 11/12] MdeModulePkg: CI: Add PrEval entry

2023-10-23 Thread Joey Vagedes via groups.io
From: Joey Vagedes 

Adds a PrEval entry to the package's ci.yaml file which is used to
verify if the package uses a particular library instance when that
library instance file (INF) is updated.

When a library instance file (INF) is updated, PrEval will review each
package's DSC as described in the ci.yaml file to determine if the
package uses said library instance. If the package does use the library
instance, it will be built and tested to ensure the package is not
broken from the change.

Cc: Jian J Wang 
Cc: Liming Gao 
Signed-off-by: Joey Vagedes 

Reviewed-by: Liming Gao 
---
 MdeModulePkg/MdeModulePkg.ci.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/MdeModulePkg/MdeModulePkg.ci.yaml 
b/MdeModulePkg/MdeModulePkg.ci.yaml
index f69989087b4c..669f54e33c0d 100644
--- a/MdeModulePkg/MdeModulePkg.ci.yaml
+++ b/MdeModulePkg/MdeModulePkg.ci.yaml
@@ -7,6 +7,9 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 {
+"PrEval": {
+"DscPath": "MdeModulePkg.dsc",
+},
 ## options defined .pytool/Plugin/LicenseCheck
 "LicenseCheck": {
 "IgnoreFiles": []
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109946): https://edk2.groups.io/g/devel/message/109946
Mute This Topic: https://groups.io/mt/102140979/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v2 08/12] RedfishPkg: CI: Add PrEval entry

2023-10-23 Thread Joey Vagedes via groups.io
From: Joey Vagedes 

Adds a PrEval entry to the package's ci.yaml file which is used to
verify if the package uses a particular library instance when that
library instance file (INF) is updated.

When a library instance file (INF) is updated, PrEval will review each
package's DSC as described in the ci.yaml file to determine if the
package uses said library instance. If the package does use the library
instance, it will be built and tested to ensure the package is not
broken from the change.

Cc: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Signed-off-by: Joey Vagedes 

Reviewed-by: Abner Chang https://edk2.groups.io/g/devel/message/109943
Mute This Topic: https://groups.io/mt/102140976/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v2 07/12] IntelFsp2Pkg: CI: Add PrEval entry

2023-10-23 Thread Joey Vagedes via groups.io
From: Joey Vagedes 

Adds a PrEval entry to the package's ci.yaml file which is used to
verify if the package uses a particular library instance when that
library instance file (INF) is updated.

When a library instance file (INF) is updated, PrEval will review each
package's DSC as described in the ci.yaml file to determine if the
package uses said library instance. If the package does use the library
instance, it will be built and tested to ensure the package is not
broken from the change.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Duggapu Chinni B 
Cc: Ray Han Lim Ng 
Cc: Star Zeng 
Cc: Ted Kuo 
Cc: Ashraf Ali S 
Cc: Susovan Mohapatra 
Signed-off-by: Joey Vagedes 

Reviewed-by: Nate DeSimone 
---
 IntelFsp2Pkg/IntelFsp2Pkg.ci.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/IntelFsp2Pkg/IntelFsp2Pkg.ci.yaml 
b/IntelFsp2Pkg/IntelFsp2Pkg.ci.yaml
index 95d18cfcde1f..bd6f4cc961b0 100644
--- a/IntelFsp2Pkg/IntelFsp2Pkg.ci.yaml
+++ b/IntelFsp2Pkg/IntelFsp2Pkg.ci.yaml
@@ -6,6 +6,9 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 {
+"PrEval": {
+"DscPath": "IntelFsp2Pkg.dsc",
+},
 ## options defined .pytool/Plugin/LicenseCheck
 "LicenseCheck": {
 "IgnoreFiles": []
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109942): https://edk2.groups.io/g/devel/message/109942
Mute This Topic: https://groups.io/mt/102140975/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v2 06/12] FmpDevicePkg: CI: Add PrEval entry

2023-10-23 Thread Joey Vagedes via groups.io
From: Joey Vagedes 

Adds a PrEval entry to the package's ci.yaml file which is used to
verify if the package uses a particular library instance when that
library instance file (INF) is updated.

When a library instance file (INF) is updated, PrEval will review each
package's DSC as described in the ci.yaml file to determine if the
package uses said library instance. If the package does use the library
instance, it will be built and tested to ensure the package is not
broken from the change.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Guomin Jiang 
Cc: Wei6 Xu 
Signed-off-by: Joey Vagedes 

Reviewed-by: Liming Gao 
---
 FmpDevicePkg/FmpDevicePkg.ci.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/FmpDevicePkg/FmpDevicePkg.ci.yaml 
b/FmpDevicePkg/FmpDevicePkg.ci.yaml
index 1b3e2187356d..1e687a53fa8f 100644
--- a/FmpDevicePkg/FmpDevicePkg.ci.yaml
+++ b/FmpDevicePkg/FmpDevicePkg.ci.yaml
@@ -6,6 +6,9 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 {
+"PrEval": {
+"DscPath": "FmpDevicePkg.dsc",
+},
 "LicenseCheck": {
 "IgnoreFiles": []
 },
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109941): https://edk2.groups.io/g/devel/message/109941
Mute This Topic: https://groups.io/mt/102140974/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v2 05/12] EmbeddedPkg: CI: Add PrEval entry

2023-10-23 Thread Joey Vagedes via groups.io
From: Joey Vagedes 

Adds a PrEval entry to the package's ci.yaml file which is used to
verify if the package uses a particular library instance when that
library instance file (INF) is updated.

When a library instance file (INF) is updated, PrEval will review each
package's DSC as described in the ci.yaml file to determine if the
package uses said library instance. If the package does use the library
instance, it will be built and tested to ensure the package is not
broken from the change.

Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
Cc: Abner Chang 
Cc: Daniel Schaefer 
Signed-off-by: Joey Vagedes 

Reviewed-by: Abner Chang 
---
 EmbeddedPkg/EmbeddedPkg.ci.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/EmbeddedPkg/EmbeddedPkg.ci.yaml b/EmbeddedPkg/EmbeddedPkg.ci.yaml
index 21f30108a29f..96a60a6f8b4d 100644
--- a/EmbeddedPkg/EmbeddedPkg.ci.yaml
+++ b/EmbeddedPkg/EmbeddedPkg.ci.yaml
@@ -6,6 +6,9 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 {
+"PrEval": {
+"DscPath": "EmbeddedPkg.dsc",
+},
 ## options defined .pytool/Plugin/LicenseCheck
 "LicenseCheck": {
 "IgnoreFiles": []
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109940): https://edk2.groups.io/g/devel/message/109940
Mute This Topic: https://groups.io/mt/102140973/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v2 04/12] DynamicTablesPkg: CI: Add PrEval entry

2023-10-23 Thread Joey Vagedes via groups.io
From: Joey Vagedes 

Adds a PrEval entry to the package's ci.yaml file which is used to
verify if the package uses a particular library instance when that
library instance file (INF) is updated.

When a library instance file (INF) is updated, PrEval will review each
package's DSC as described in the ci.yaml file to determine if the
package uses said library instance. If the package does use the library
instance, it will be built and tested to ensure the package is not
broken from the change.

Cc: Sami Mujawar 
Cc: Alexei Fedorov 
Cc: Pierre Gondois 
Signed-off-by: Joey Vagedes 

Reviewed-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTablesPkg.ci.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTablesPkg.ci.yaml 
b/DynamicTablesPkg/DynamicTablesPkg.ci.yaml
index 5addf8626841..f37842f65246 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.ci.yaml
+++ b/DynamicTablesPkg/DynamicTablesPkg.ci.yaml
@@ -5,6 +5,9 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 {
+"PrEval": {
+"DscPath": "DynamicTablesPkg.dsc",
+},
 "EccCheck": {
 ## Exception sample looks like below:
 ## "ExceptionList": [
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109939): https://edk2.groups.io/g/devel/message/109939
Mute This Topic: https://groups.io/mt/102140971/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v2 03/12] CryptoPkg: CI: Add PrEval entry

2023-10-23 Thread Joey Vagedes via groups.io
From: Joey Vagedes 

Adds a PrEval entry to the package's ci.yaml file which is used to
verify if the package uses a particular library instance when that
library instance file (INF) is updated.

When a library instance file (INF) is updated, PrEval will review each
package's DSC as described in the ci.yaml file to determine if the
package uses said library instance. If the package does use the library
instance, it will be built and tested to ensure the package is not
broken from the change.

Cc: Jiewen Yao 
Cc: Yi Li 
Cc: Xiaoyu Lu 
Cc: Guomin Jiang 
Signed-off-by: Joey Vagedes 

Reviewed-by: Yi Li 
---
 CryptoPkg/CryptoPkg.ci.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CryptoPkg/CryptoPkg.ci.yaml b/CryptoPkg/CryptoPkg.ci.yaml
index 47f29759676d..4cec206477bc 100644
--- a/CryptoPkg/CryptoPkg.ci.yaml
+++ b/CryptoPkg/CryptoPkg.ci.yaml
@@ -6,6 +6,9 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 {
+"PrEval": {
+"DscPath": "CryptoPkg.dsc",
+},
 "LicenseCheck": {
 "IgnoreFiles": [
 # These directories contain auto-generated OpenSSL content
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109938): https://edk2.groups.io/g/devel/message/109938
Mute This Topic: https://groups.io/mt/102140970/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v2 00/12] *** Update Edk2-pytools to latest versions ***

2023-10-23 Thread Joey Vagedes via groups.io
**Update: Version 2 of this patch series contains only packages that have
reviewed this change. This patch series is ready to be merged. Maintainers of
other packages may add these changes in a follow up patch series.

Updates Edk2-pytools to the latest versions, which introduces a new Policy
for detecting which packages must be built given a set of changes. This policy
is used when a library class instance INF is changed. When this occurs, it will
review the PrEval:DscPath provided in the CI YAML file and determine if the
package uses the library instance or not. If it does, it will build and test
the package.

Due to these changes, each package must now include an entry in it's CI YAML
file (PrEval:DscPath). If the package does not provide this entry, this policy
will be skipped.


Cc: Jiewen Yao 
Cc: Yi Li 
Cc: Sami Mujawar 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Duggapu Chinni B 
Cc: Ray Han Lim Ng 
Cc: Jian J Wang 
Cc: Liming Gao 


Joey Vagedes (12):
  Edk2: edk2-pytools: Update to latest versions
  UnitTestFrameworkPkg: CI: Add PrEval entry
  CryptoPkg: CI: Add PrEval entry
  DynamicTablesPkg: CI: Add PrEval entry
  EmbeddedPkg: CI: Add PrEval entry
  FmpDevicePkg: CI: Add PrEval entry
  IntelFsp2Pkg: CI: Add PrEval entry
  RedfishPkg: CI: Add PrEval entry
  PrmPkg: CI: Add PrEval entry
  MdePkg: CI: Add PrEval entry
  MdeModulePkg: CI: Add PrEval entry
  IntelFsp2WrapperPkg: CI: Add PrEval entry

 CryptoPkg/CryptoPkg.ci.yaml   | 3 +++
 DynamicTablesPkg/DynamicTablesPkg.ci.yaml | 3 +++
 EmbeddedPkg/EmbeddedPkg.ci.yaml   | 3 +++
 FmpDevicePkg/FmpDevicePkg.ci.yaml | 3 +++
 IntelFsp2Pkg/IntelFsp2Pkg.ci.yaml | 3 +++
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.ci.yaml   | 3 +++
 MdeModulePkg/MdeModulePkg.ci.yaml | 3 +++
 MdePkg/MdePkg.ci.yaml | 3 +++
 PrmPkg/PrmPkg.ci.yaml | 3 +++
 RedfishPkg/RedfishPkg.ci.yaml | 3 +++
 UnitTestFrameworkPkg/UnitTestFrameworkPkg.ci.yaml | 3 +++
 pip-requirements.txt  | 4 ++--
 12 files changed, 35 insertions(+), 2 deletions(-)

-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109935): https://edk2.groups.io/g/devel/message/109935
Mute This Topic: https://groups.io/mt/102140967/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 13/24] StandaloneMmPkg: CI: Add PrEval entry

2023-10-09 Thread Joey Vagedes via groups.io
Hello All,

Due to a Subject Line mistake, this particular patch was labeled as a
CryptoPkg change. I'm resending this out to the package maintainers with
the correct package (StandaloneMmPkg).

Please review this change to your package's ci.yaml file ~ This change will
ensure your package is properly tested if another package changes an INF
that your package depends on to build, making sure it is not broken from
another's change. If you wish for this to be merged into your package,
please review.

If not, I will be re-sending this patch series out with only the package's
I have reviews on, to get it merged so that we can update edk2-pytools
further. You will always be able to add this yourself at a later date if
you wish.

Thanks,
Joey


On Mon, Jun 26, 2023 at 2:35 PM Joey Vagedes  wrote:

> Adds a PrEval entry to the package's ci.yaml file which is used to
> verify if the package uses a particular library instance when that
> library instance file (INF) is updated.
>
> When a library instance file (INF) is updated, PrEval will review each
> package's DSC as described in the ci.yaml file to determine if the
> package uses said library instance. If the package does use the library
> instance, it will be built and tested to ensure the package is not
> broken from the change.
>
> Cc: Ard Biesheuvel 
> Cc: Sami Mujawar 
> Cc: Ray Ni 
> Signed-off-by: Joey Vagedes 
> ---
>  StandaloneMmPkg/StandaloneMmPkg.ci.yaml | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/StandaloneMmPkg/StandaloneMmPkg.ci.yaml
> b/StandaloneMmPkg/StandaloneMmPkg.ci.yaml
> index 4777532a7ede..f23f5f2c4db2 100644
> --- a/StandaloneMmPkg/StandaloneMmPkg.ci.yaml
> +++ b/StandaloneMmPkg/StandaloneMmPkg.ci.yaml
> @@ -5,6 +5,9 @@
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  ##
>  {
> +"PrEval": {
> +"DscPath": "StandaloneMmPkg.dsc",
> +},
>  "EccCheck": {
>  ## Exception sample looks like below:
>  ## "ExceptionList": [
> --
> 2.41.0.windows.1
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109463): https://edk2.groups.io/g/devel/message/109463
Mute This Topic: https://groups.io/mt/101856788/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 07/24] CryptoPkg: CI: Add PrEval entry

2023-10-09 Thread Joey Vagedes via groups.io
Thank you for catching this! I will correct it.

Thanks,
Joey

On Fri, Oct 6, 2023 at 8:07 PM Li, Yi1  wrote:

> Joey:
>
> I already give feedback for CryptoPkg part.
>
> Seems there are two Crypto patch 07/24 and 13/24, but actually 13 is
> StandaloneMmPkg changes. Please check.
> [PATCH v1 13/24] CryptoPkg: CI: Add PrEval entry
>
> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Li, Yi
> Sent: Wednesday, August 2, 2023 12:42 PM
> To: Joey Vagedes ; devel@edk2.groups.io
> Cc: Yao, Jiewen ; Lu, Xiaoyu1 ;
> Jiang, Guomin 
> Subject: Re: [edk2-devel] [PATCH v1 07/24] CryptoPkg: CI: Add PrEval entry
>
>
> Looks good to me.
> Reviewed-by: Yi Li 
>
> -Original Message-
> From: Joey Vagedes 
> Sent: Tuesday, June 27, 2023 5:34 AM
> To: devel@edk2.groups.io
> Cc: Yao, Jiewen ; Li, Yi1 ; Lu,
> Xiaoyu1 ; Jiang, Guomin 
> Subject: [PATCH v1 07/24] CryptoPkg: CI: Add PrEval entry
>
> Adds a PrEval entry to the package's ci.yaml file which is used to verify
> if the package uses a particular library instance when that library
> instance file (INF) is updated.
>
> When a library instance file (INF) is updated, PrEval will review each
> package's DSC as described in the ci.yaml file to determine if the package
> uses said library instance. If the package does use the library instance,
> it will be built and tested to ensure the package is not broken from the
> change.
>
> Cc: Jiewen Yao 
> Cc: Yi Li 
> Cc: Xiaoyu Lu 
> Cc: Guomin Jiang 
> Signed-off-by: Joey Vagedes 
> ---
>  CryptoPkg/CryptoPkg.ci.yaml | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/CryptoPkg/CryptoPkg.ci.yaml b/CryptoPkg/CryptoPkg.ci.yaml
> index 47f29759676d..4cec206477bc 100644
> --- a/CryptoPkg/CryptoPkg.ci.yaml
> +++ b/CryptoPkg/CryptoPkg.ci.yaml
> @@ -6,6 +6,9 @@
>  # SPDX-License-Identifier: BSD-2-Clause-Patent ## {+"PrEval": {+
>   "DscPath": "CryptoPkg.dsc",+}, "LicenseCheck": {
>  "IgnoreFiles": [ # These directories contain auto-generated
> OpenSSL content--
> 2.41.0.windows.1
>
>
>
> 
>
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109462): https://edk2.groups.io/g/devel/message/109462
Mute This Topic: https://groups.io/mt/99798040/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 1/1] BaseTools: BinToPcd: Resolve xdrlib deprecation

2023-07-13 Thread Joey Vagedes via groups.io
Thank you for the review Michael. @Rebecca Cran , @Liming
Gao  have you had time to take a look at this? It
is a fairly simple change, following the same logic as xdrlib with a few
modifications to use some newer python functionality.

Thanks,
Joey

On Tue, Jun 27, 2023 at 10:21 AM Kinney, Michael D <
michael.d.kin...@intel.com> wrote:

> Thank you for fixing this.
>
> Reviewed-by: Michael D Kinney 
>
> > -Original Message-
> > From: Joey Vagedes 
> > Sent: Tuesday, June 27, 2023 9:27 AM
> > To: devel@edk2.groups.io
> > Cc: Rebecca Cran ; Gao, Liming
> > ; Feng, Bob C ; Chen,
> > Christine ; Kinney, Michael D
> > 
> > Subject: [PATCH v1 1/1] BaseTools: BinToPcd: Resolve xdrlib deprecation
> >
> > Removes the dependency on xdrlib and replaces it with custom logic to
> > pack a per the xdr requirements. Necessary as xdrlib is being deprecated
> > in python 3.13.
> >
> > Cc: Rebecca Cran 
> > Cc: Liming Gao 
> > Cc: Bob Feng 
> > Cc: Yuwei Chen 
> > Cc: Michael D Kinney 
> > Signed-off-by: Joey Vagedes 
> > ---
> >  BaseTools/Scripts/BinToPcd.py | 19 +++
> >  1 file changed, 15 insertions(+), 4 deletions(-)
> >
> > diff --git a/BaseTools/Scripts/BinToPcd.py
> b/BaseTools/Scripts/BinToPcd.py
> > index 3bc557b8412c..460c08b7f7cd 100644
> > --- a/BaseTools/Scripts/BinToPcd.py
> > +++ b/BaseTools/Scripts/BinToPcd.py
> > @@ -14,6 +14,9 @@ import sys
> >  import argparse
> >
> >  import re
> >
> >  import xdrlib
> >
> > +import io
> >
> > +import struct
> >
> > +import math
> >
> >
> >
> >  #
> >
> >  # Globals for help information
> >
> > @@ -46,16 +49,24 @@ if __name__ == '__main__':
> >  raise argparse.ArgumentTypeError (Message)
> >
> >  return Argument
> >
> >
> >
> > +def XdrPackBuffer (buffer):
> >
> > +packed_bytes = io.BytesIO()
> >
> > +for unpacked_bytes in buffer:
> >
> > +n = len(unpacked_bytes)
> >
> > +packed_bytes.write(struct.pack('>L',n))
> >
> > +data = unpacked_bytes[:n]
> >
> > +n = math.ceil(n/4)*4
> >
> > +data = data + (n - len(data)) * b'\0'
> >
> > +packed_bytes.write(data)
> >
> > +return packed_bytes.getvalue()
> >
> > +
> >
> >  def ByteArray (Buffer, Xdr = False):
> >
> >  if Xdr:
> >
> >  #
> >
> >  # If Xdr flag is set then encode data using the Variable-
> > Length Opaque
> >
> >  # Data format of RFC 4506 External Data Representation
> > Standard (XDR).
> >
> >  #
> >
> > -XdrEncoder = xdrlib.Packer ()
> >
> > -for Item in Buffer:
> >
> > -XdrEncoder.pack_bytes (Item)
> >
> > -Buffer = bytearray (XdrEncoder.get_buffer ())
> >
> > +Buffer = bytearray (XdrPackBuffer (Buffer))
> >
> >  else:
> >
> >  #
> >
> >  # If Xdr flag is not set, then concatenate all the data
> >
> > --
> > 2.41.0.windows.1
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106911): https://edk2.groups.io/g/devel/message/106911
Mute This Topic: https://groups.io/mt/99813913/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v3 2/2] BaseTools: GenFw: auto-set nxcompat flag

2023-07-13 Thread Joey Vagedes via groups.io
Automatically set the nxcompat flag in the DLL Characteristics field of
the Optional Header of the PE32+ image. For this flag to be set
automatically, the section alignment must be evenly divisible
by 4K (EFI_PAGE_SIZE) and no section must be executable and writable.

Adds a command line flag to GenFw, --nonxcompat, to ensure the
IMAGE_DLLCHARACTERISTICS_NX_COMPAT bit is not set, even if all
requirements are met. Updates the manual for GenFw to include the new
flag.

Cc: Rebecca Cran 
Cc: Liming Gao 
Cc: Bob Feng 
Cc: Yuwei Chen 
Signed-off-by: Joey Vagedes 
---
 BaseTools/Source/C/GenFw/GenFw.c |  69 
 BaseTools/UserManuals/GenFw_Utility_Man_Page.rtf | 420 +++-
 2 files changed, 292 insertions(+), 197 deletions(-)

diff --git a/BaseTools/Source/C/GenFw/GenFw.c b/BaseTools/Source/C/GenFw/GenFw.c
index 0289c8ef8a5c..bd635b375a99 100644
--- a/BaseTools/Source/C/GenFw/GenFw.c
+++ b/BaseTools/Source/C/GenFw/GenFw.c
@@ -86,6 +86,7 @@ UINT32 mImageSize = 0;
 UINT32 mOutImageType = FW_DUMMY_IMAGE;
 BOOLEAN mIsConvertXip = FALSE;
 BOOLEAN mExportFlag = FALSE;
+BOOLEAN mNoNxCompat = FALSE;
 
 STATIC
 EFI_STATUS
@@ -281,6 +282,9 @@ Returns:
 write export table into PE-COFF.\n\
 This option can be used together with -e.\n\
 It doesn't work for other options.\n");
+  fprintf (stdout, "  --nonxcompat  Do not set the 
IMAGE_DLLCHARACTERISTICS_NX_COMPAT bit \n\
+of the optional header in the PE header even if the \n\
+requirements are met.\n");
   fprintf (stdout, "  -v, --verbose Turn on verbose output with 
informational messages.\n");
   fprintf (stdout, "  -q, --quiet   Disable all messages except key 
message and fatal error\n");
   fprintf (stdout, "  -d, --debug level Enable debug messages, at input 
debug level.\n");
@@ -441,6 +445,59 @@ Returns:
   return STATUS_SUCCESS;
 }
 
+/**
+
+  Checks if the Pe image is nxcompat compliant.
+
+  Must meet the following conditions:
+  1. The PE is 64bit
+  2. The section alignment is evenly divisible by 4k
+  3. No section is writable and executable.
+
+  @param  PeHdr - The PE header
+
+  @retval TRUE  - The PE is nx compat compliant
+  @retval FALSE - The PE is not nx compat compliant
+
+**/
+STATIC
+BOOLEAN
+IsNxCompatCompliant (
+  EFI_IMAGE_OPTIONAL_HEADER_UNION  *PeHdr
+  )
+{
+  EFI_IMAGE_SECTION_HEADER *SectionHeader;
+  UINT32   Index;
+  UINT32   Mask;
+
+  // Must have an optional header to perform verification
+  if (PeHdr->Pe32.FileHeader.SizeOfOptionalHeader == 0) {
+return FALSE;
+  }
+
+  // Verify PE is 64 bit
+  if (!(PeHdr->Pe32.OptionalHeader.Magic == 
EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC)) {
+return FALSE;
+  }
+
+  // Verify Section Alignment is divisible by 4K
+  if (!((PeHdr->Pe32Plus.OptionalHeader.SectionAlignment % EFI_PAGE_SIZE) == 
0)) {
+return FALSE;
+  }
+
+  // Verify sections are not Write & Execute
+  Mask = EFI_IMAGE_SCN_MEM_EXECUTE | EFI_IMAGE_SCN_MEM_WRITE;
+  SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) 
&(PeHdr->Pe32Plus.OptionalHeader) + 
PeHdr->Pe32Plus.FileHeader.SizeOfOptionalHeader);
+  for (Index = 0; Index < PeHdr->Pe32Plus.FileHeader.NumberOfSections; Index 
++, SectionHeader ++) {
+if ((SectionHeader->Characteristics & Mask) == Mask) {
+  return FALSE;
+}
+  }
+
+  // Passed all requirements, return TRUE
+  return TRUE;
+}
+
 VOID
 SetHiiResourceHeader (
   UINT8   *HiiBinData,
@@ -1452,6 +1509,13 @@ Returns:
   continue;
 }
 
+if (stricmp (argv[0], "--nonxcompat") == 0) {
+  mNoNxCompat = TRUE;
+  argc --;
+  argv ++;
+  continue;
+}
+
 if (argv[0][0] == '-') {
   Error (NULL, 0, 1000, "Unknown option", argv[0]);
   goto Finish;
@@ -2458,6 +2522,11 @@ Returns:
 TEImageHeader.BaseOfCode  = Optional64->BaseOfCode;
 TEImageHeader.ImageBase   = (UINT64) (Optional64->ImageBase);
 
+// Set NxCompat flag
+if (IsNxCompatCompliant (PeHdr) && !mNoNxCompat) {
+  Optional64->DllCharacteristics |= IMAGE_DLLCHARACTERISTICS_NX_COMPAT;
+}
+
 if (Optional64->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC) 
{
   
TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress
 = 
Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress;
   TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size 
= Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size;
diff --git a/BaseTools/UserManuals/GenFw_Utility_Man_Page.rtf 
b/BaseTools/UserManuals/GenFw_Utility_Man_Page.rtf
index f4235b77fbce..6046b9fefd65 100644
--- a/BaseTools/UserManuals/GenFw_Utility_Man_Page.rtf
+++ b/BaseTools/UserManuals/GenFw_Utility_Man_Page.rtf
@@ -1,28 +1,29 @@

[edk2-devel] [PATCH v3 0/2] Automatically set NXCOMPAT bit if requirements are met

2023-07-13 Thread Joey Vagedes via groups.io
v3: Updates function to be Doxygen compliant
v3: Updates commit message

v2: Adds --nonxcompat flag to GenFw; updates man page
v2: Updates PeImage.h to reference spec 9.3 rather then 8.3

Utilize GenFw to automatically set the NXCOMPAT bit of the DLL Characteristics
field of the Optional Header if the following requirements are met:

1. It is a 64bit PE
2. The section alignment is evently divisible by 4K
3. No section is both EFI_IMAGE_SCN_MEM_EXECUTE and EFI_IMAGE_SCN_MEM_WRITE

Cc: Rebecca Cran 
Cc: Liming Gao 
Cc: Bob Feng 
Cc: Yuwei Chen 

Joey Vagedes (2):
  MdePkg: IndustryStandard: Add DLL Characteristics
  BaseTools: GenFw: auto-set nxcompat flag

 MdePkg/Include/IndustryStandard/PeImage.h|  17 +-
 BaseTools/Source/C/GenFw/GenFw.c |  69 
 BaseTools/UserManuals/GenFw_Utility_Man_Page.rtf | 420 +++-
 3 files changed, 308 insertions(+), 198 deletions(-)

-- 
2.41.0.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106908): https://edk2.groups.io/g/devel/message/106908
Mute This Topic: https://groups.io/mt/100122559/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v3 1/2] MdePkg: IndustryStandard: Add DLL Characteristics

2023-07-13 Thread Joey Vagedes via groups.io
Add the bit masks for DLL Characteristics, used within the optional
header of a PE, to the PeImage.h header file.

Update the Visual Studio, Microsoft Portable Executable and Common
Object File Format Specification, and the PE/COFF Specification to the
latest version.

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Signed-off-by: Joey Vagedes 

Reviewed-by: Michael D Kinney 
---
 MdePkg/Include/IndustryStandard/PeImage.h | 17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Include/IndustryStandard/PeImage.h 
b/MdePkg/Include/IndustryStandard/PeImage.h
index 47037049348c..9fdbfb9c4944 100644
--- a/MdePkg/Include/IndustryStandard/PeImage.h
+++ b/MdePkg/Include/IndustryStandard/PeImage.h
@@ -4,7 +4,7 @@
   EFI_IMAGE_NT_HEADERS64 is for PE32+.
 
   This file is coded to the Visual Studio, Microsoft Portable Executable and
-  Common Object File Format Specification, Revision 8.3 - February 6, 2013.
+  Common Object File Format Specification, Revision 9.3 - December 29, 2015.
   This file also includes some definitions in PI Specification, Revision 1.0.
 
 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
@@ -269,6 +269,21 @@ typedef struct {
 #define EFI_IMAGE_SUBSYSTEM_OS2_CUI  5
 #define EFI_IMAGE_SUBSYSTEM_POSIX_CUI7
 
+//
+// DLL Characteristics
+//
+#define IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA0x0020
+#define IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE   0x0040
+#define IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY0x0080
+#define IMAGE_DLLCHARACTERISTICS_NX_COMPAT  0x0100
+#define IMAGE_DLLCHARACTERISTICS_NO_ISOLATION   0x0200
+#define IMAGE_DLLCHARACTERISTICS_NO_SEH 0x0400
+#define IMAGE_DLLCHARACTERISTICS_NO_BIND0x0800
+#define IMAGE_DLLCHARACTERISTICS_APPCONTAINER   0x1000
+#define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER 0x2000
+#define IMAGE_DLLCHARACTERISTICS_GUARD_CF   0x4000
+#define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE  0x8000
+
 ///
 /// Length of ShortName.
 ///
-- 
2.41.0.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106909): https://edk2.groups.io/g/devel/message/106909
Mute This Topic: https://groups.io/mt/100122560/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 1/1] BaseTools: scan Edk2ToolsBuild.py make output

2023-07-10 Thread Joey Vagedes via groups.io
Thanks Rebecca! Let me know if you need anything else from me before you
get it merged. I appreciate your time!

Joey

On Sun, Jul 9, 2023 at 4:18 PM Rebecca Cran  wrote:

> Sorry for the delay.
>
>
> Reviewed-by: Rebecca Cran 
>
>
> On 6/21/23 9:59 AM, Joey Vagedes wrote:
> > Adds edk2_logging.scan_compiler_output() to Edk2ToolsBuild.py to catch
> > some compilation errors and log them as an error.
> >
> > Cc: Rebecca Cran 
> > Cc: Liming Gao 
> > Cc: Bob Feng 
> > Cc: Yuwei Chen 
> > Signed-off-by: Joey Vagedes 
> > ---
> >   BaseTools/Edk2ToolsBuild.py | 11 +++
> >   1 file changed, 11 insertions(+)
> >
> > diff --git a/BaseTools/Edk2ToolsBuild.py b/BaseTools/Edk2ToolsBuild.py
> > index f862468ce275..425bb1b63963 100644
> > --- a/BaseTools/Edk2ToolsBuild.py
> > +++ b/BaseTools/Edk2ToolsBuild.py
> > @@ -133,8 +133,13 @@ class Edk2ToolsBuild(BaseAbstractInvocable):
> >   shell_env.insert_path(self.OutputDir)
> >
> >   # Actually build the tools.
> > +output_stream = edk2_logging.create_output_stream()
> >   ret = RunCmd('nmake.exe', None,
> >
> workingdir=shell_env.get_shell_var("EDK_TOOLS_PATH"))
> > +edk2_logging.remove_output_stream(output_stream)
> > +problems = edk2_logging.scan_compiler_output(output_stream)
> > +for level, problem in problems:
> > +logging.log(level, problem)
> >   if ret != 0:
> >   raise Exception("Failed to build.")
> >
> > @@ -143,7 +148,13 @@ class Edk2ToolsBuild(BaseAbstractInvocable):
> >
> >   elif self.tool_chain_tag.lower().startswith("gcc"):
> >   cpu_count = self.GetCpuThreads()
> > +
> > +output_stream = edk2_logging.create_output_stream()
> >   ret = RunCmd("make", f"-C .  -j {cpu_count}",
> workingdir=shell_env.get_shell_var("EDK_TOOLS_PATH"))
> > +edk2_logging.remove_output_stream(output_stream)
> > +problems = edk2_logging.scan_compiler_output(output_stream)
> > +for level, problem in problems:
> > +logging.log(level, problem)
> >   if ret != 0:
> >   raise Exception("Failed to build.")
> >
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106770): https://edk2.groups.io/g/devel/message/106770
Mute This Topic: https://groups.io/mt/99685057/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 1/1] BaseTools: scan Edk2ToolsBuild.py make output

2023-07-06 Thread Joey Vagedes via groups.io
Hi All,

Any concerns over this patch? It merely adds the ability to detect some
compiler errors when building BaseTools with Edk2ToolsBuild.py and report
them as logging level ERROR to get a quick glimpse at the error without
needing to review the entire log.

Thanks,
Joey

On Wed, Jun 21, 2023 at 8:59 AM Joey Vagedes  wrote:

> Adds edk2_logging.scan_compiler_output() to Edk2ToolsBuild.py to catch
> some compilation errors and log them as an error.
>
> Cc: Rebecca Cran 
> Cc: Liming Gao 
> Cc: Bob Feng 
> Cc: Yuwei Chen 
> Signed-off-by: Joey Vagedes 
> ---
>  BaseTools/Edk2ToolsBuild.py | 11 +++
>  1 file changed, 11 insertions(+)
>
> diff --git a/BaseTools/Edk2ToolsBuild.py b/BaseTools/Edk2ToolsBuild.py
> index f862468ce275..425bb1b63963 100644
> --- a/BaseTools/Edk2ToolsBuild.py
> +++ b/BaseTools/Edk2ToolsBuild.py
> @@ -133,8 +133,13 @@ class Edk2ToolsBuild(BaseAbstractInvocable):
>  shell_env.insert_path(self.OutputDir)
>
>  # Actually build the tools.
> +output_stream = edk2_logging.create_output_stream()
>  ret = RunCmd('nmake.exe', None,
>
> workingdir=shell_env.get_shell_var("EDK_TOOLS_PATH"))
> +edk2_logging.remove_output_stream(output_stream)
> +problems = edk2_logging.scan_compiler_output(output_stream)
> +for level, problem in problems:
> +logging.log(level, problem)
>  if ret != 0:
>  raise Exception("Failed to build.")
>
> @@ -143,7 +148,13 @@ class Edk2ToolsBuild(BaseAbstractInvocable):
>
>  elif self.tool_chain_tag.lower().startswith("gcc"):
>  cpu_count = self.GetCpuThreads()
> +
> +output_stream = edk2_logging.create_output_stream()
>  ret = RunCmd("make", f"-C .  -j {cpu_count}",
> workingdir=shell_env.get_shell_var("EDK_TOOLS_PATH"))
> +edk2_logging.remove_output_stream(output_stream)
> +problems = edk2_logging.scan_compiler_output(output_stream)
> +for level, problem in problems:
> +logging.log(level, problem)
>  if ret != 0:
>  raise Exception("Failed to build.")
>
> --
> 2.41.0.windows.1
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106706): https://edk2.groups.io/g/devel/message/106706
Mute This Topic: https://groups.io/mt/99685057/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 2/2] BaseTools: GenFw: auto-set nxcompat flag

2023-07-06 Thread Joey Vagedes via groups.io
Hi all,

Do you have any concerns over the changes I've made to GenFw.c as seen
above? Please let me know if you have any questions, concerns, or
improvements; I would be happy to help!

Thanks,
Joey

On Fri, Jun 23, 2023 at 8:44 AM Joey Vagedes  wrote:

> Automatically set the nxcompat flag in the DLL Characteristics field of
> the Optional Header of the PE32+ image. For this flag to be set
> automatically, it must, the section alignment must be evenly divisible
> by 4K (EFI_PAGE_SIZE) and no section must be executable and writable.
>
> Cc: Rebecca Cran 
> Cc: Liming Gao 
> Cc: Bob Feng 
> Cc: Yuwei Chen 
> Signed-off-by: Joey Vagedes 
> ---
>  BaseTools/Source/C/GenFw/GenFw.c | 59 
>  1 file changed, 59 insertions(+)
>
> diff --git a/BaseTools/Source/C/GenFw/GenFw.c
> b/BaseTools/Source/C/GenFw/GenFw.c
> index 0289c8ef8a5c..4581c4233c14 100644
> --- a/BaseTools/Source/C/GenFw/GenFw.c
> +++ b/BaseTools/Source/C/GenFw/GenFw.c
> @@ -441,6 +441,60 @@ Returns:
>return STATUS_SUCCESS;
>  }
>
> +STATIC
> +BOOLEAN
> +IsNxCompatCompliant (
> +  EFI_IMAGE_OPTIONAL_HEADER_UNION  *PeHdr
> +  )
> +/*++
> +
> +Routine Description:
> +
> +  Checks if the Pe image is nxcompat. i.e. PE is 64bit, section alignment
> is
> +  evenly divisible by 4k, and no section is writable and executable.
> +
> +Arguments:
> +
> +  PeHdr  The Pe header
> +
> +Returns:
> +  TRUE   The PE is nx compat compliant
> +  FALSE  The PE is not nx compat compliant
> +
> +--*/
> +{
> +  EFI_IMAGE_SECTION_HEADER *SectionHeader;
> +  UINT32   Index;
> +  UINT32   Mask;
> +
> +  // Must have an optional header to perform verification
> +  if (PeHdr->Pe32.FileHeader.SizeOfOptionalHeader == 0) {
> +return FALSE;
> +  }
> +
> +  // Verify PE is 64 bit
> +  if (!(PeHdr->Pe32.OptionalHeader.Magic ==
> EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC)) {
> +return FALSE;
> +  }
> +
> +  // Verify Section Alignment is divisible by 4K
> +  if (!((PeHdr->Pe32Plus.OptionalHeader.SectionAlignment % EFI_PAGE_SIZE)
> == 0)) {
> +return FALSE;
> +  }
> +
> +  // Verify sections are not Write & Execute
> +  Mask = EFI_IMAGE_SCN_MEM_EXECUTE | EFI_IMAGE_SCN_MEM_WRITE;
> +  SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *)
> &(PeHdr->Pe32Plus.OptionalHeader) +
> PeHdr->Pe32Plus.FileHeader.SizeOfOptionalHeader);
> +  for (Index = 0; Index < PeHdr->Pe32Plus.FileHeader.NumberOfSections;
> Index ++, SectionHeader ++) {
> +if ((SectionHeader->Characteristics & Mask) == Mask) {
> +  return FALSE;
> +}
> +  }
> +
> +  // Passed all requirements, return TRUE
> +  return TRUE;
> +}
> +
>  VOID
>  SetHiiResourceHeader (
>UINT8   *HiiBinData,
> @@ -2458,6 +2512,11 @@ Returns:
>  TEImageHeader.BaseOfCode  = Optional64->BaseOfCode;
>  TEImageHeader.ImageBase   = (UINT64) (Optional64->ImageBase);
>
> +// Set NxCompat flag
> +if (IsNxCompatCompliant (PeHdr)) {
> +  Optional64->DllCharacteristics |=
> IMAGE_DLLCHARACTERISTICS_NX_COMPAT;
> +}
> +
>  if (Optional64->NumberOfRvaAndSizes >
> EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC) {
>
>  
> TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress
> =
> Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress;
>
>  TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size =
> Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size;
> --
> 2.41.0.windows.1
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106705): https://edk2.groups.io/g/devel/message/106705
Mute This Topic: https://groups.io/mt/99721320/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v2 2/2] BaseTools: GenFw: auto-set nxcompat flag

2023-06-28 Thread Joey Vagedes via groups.io
Automatically set the nxcompat flag in the DLL Characteristics field of
the Optional Header of the PE32+ image. For this flag to be set
automatically, it must, the section alignment must be evenly divisible
by 4K (EFI_PAGE_SIZE) and no section must be executable and writable.

Adds a command line flag to GenFw, --nonxcompat, to ensure the
IMAGE_DLLCHARACTERISTICS_NX_COMPAT bit is not set, even if all
requirements are met. Updates the manual for GenFw to include the new
flag.

Cc: Rebecca Cran 
Cc: Liming Gao 
Cc: Bob Feng 
Cc: Yuwei Chen 
Signed-off-by: Joey Vagedes 
---
 BaseTools/Source/C/GenFw/GenFw.c |  70 
 BaseTools/UserManuals/GenFw_Utility_Man_Page.rtf | 420 +++-
 2 files changed, 293 insertions(+), 197 deletions(-)

diff --git a/BaseTools/Source/C/GenFw/GenFw.c b/BaseTools/Source/C/GenFw/GenFw.c
index 0289c8ef8a5c..d720ef705e75 100644
--- a/BaseTools/Source/C/GenFw/GenFw.c
+++ b/BaseTools/Source/C/GenFw/GenFw.c
@@ -86,6 +86,7 @@ UINT32 mImageSize = 0;
 UINT32 mOutImageType = FW_DUMMY_IMAGE;
 BOOLEAN mIsConvertXip = FALSE;
 BOOLEAN mExportFlag = FALSE;
+BOOLEAN mNoNxCompat = FALSE;
 
 STATIC
 EFI_STATUS
@@ -281,6 +282,9 @@ Returns:
 write export table into PE-COFF.\n\
 This option can be used together with -e.\n\
 It doesn't work for other options.\n");
+  fprintf (stdout, "  --nonxcompat  Do not set the 
IMAGE_DLLCHARACTERISTICS_NX_COMPAT bit \n\
+of the optional header in the PE header even if the \n\
+requirements are met.\n");
   fprintf (stdout, "  -v, --verbose Turn on verbose output with 
informational messages.\n");
   fprintf (stdout, "  -q, --quiet   Disable all messages except key 
message and fatal error\n");
   fprintf (stdout, "  -d, --debug level Enable debug messages, at input 
debug level.\n");
@@ -441,6 +445,60 @@ Returns:
   return STATUS_SUCCESS;
 }
 
+STATIC
+BOOLEAN
+IsNxCompatCompliant (
+  EFI_IMAGE_OPTIONAL_HEADER_UNION  *PeHdr
+  )
+/*++
+
+Routine Description:
+
+  Checks if the Pe image is nxcompat. i.e. PE is 64bit, section alignment is
+  evenly divisible by 4k, and no section is writable and executable.
+
+Arguments:
+
+  PeHdr  The Pe header
+
+Returns:
+  TRUE   The PE is nx compat compliant
+  FALSE  The PE is not nx compat compliant
+
+--*/
+{
+  EFI_IMAGE_SECTION_HEADER *SectionHeader;
+  UINT32   Index;
+  UINT32   Mask;
+
+  // Must have an optional header to perform verification
+  if (PeHdr->Pe32.FileHeader.SizeOfOptionalHeader == 0) {
+return FALSE;
+  }
+
+  // Verify PE is 64 bit
+  if (!(PeHdr->Pe32.OptionalHeader.Magic == 
EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC)) {
+return FALSE;
+  }
+
+  // Verify Section Alignment is divisible by 4K
+  if (!((PeHdr->Pe32Plus.OptionalHeader.SectionAlignment % EFI_PAGE_SIZE) == 
0)) {
+return FALSE;
+  }
+
+  // Verify sections are not Write & Execute
+  Mask = EFI_IMAGE_SCN_MEM_EXECUTE | EFI_IMAGE_SCN_MEM_WRITE;
+  SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) 
&(PeHdr->Pe32Plus.OptionalHeader) + 
PeHdr->Pe32Plus.FileHeader.SizeOfOptionalHeader);
+  for (Index = 0; Index < PeHdr->Pe32Plus.FileHeader.NumberOfSections; Index 
++, SectionHeader ++) {
+if ((SectionHeader->Characteristics & Mask) == Mask) {
+  return FALSE;
+}
+  }
+
+  // Passed all requirements, return TRUE
+  return TRUE;
+}
+
 VOID
 SetHiiResourceHeader (
   UINT8   *HiiBinData,
@@ -1452,6 +1510,13 @@ Returns:
   continue;
 }
 
+if (stricmp (argv[0], "--nonxcompat") == 0) {
+  mNoNxCompat = TRUE;
+  argc --;
+  argv ++;
+  continue;
+}
+
 if (argv[0][0] == '-') {
   Error (NULL, 0, 1000, "Unknown option", argv[0]);
   goto Finish;
@@ -2458,6 +2523,11 @@ Returns:
 TEImageHeader.BaseOfCode  = Optional64->BaseOfCode;
 TEImageHeader.ImageBase   = (UINT64) (Optional64->ImageBase);
 
+// Set NxCompat flag
+if (IsNxCompatCompliant (PeHdr) && !mNoNxCompat) {
+  Optional64->DllCharacteristics |= IMAGE_DLLCHARACTERISTICS_NX_COMPAT;
+}
+
 if (Optional64->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC) 
{
   
TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress
 = 
Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress;
   TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size 
= Optional64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size;
diff --git a/BaseTools/UserManuals/GenFw_Utility_Man_Page.rtf 
b/BaseTools/UserManuals/GenFw_Utility_Man_Page.rtf
index f4235b77fbce..6046b9fefd65 100644
--- a/BaseTools/UserManuals/GenFw_Utility_Man_Page.rtf
+++ b/BaseTools/UserManuals/GenFw_Utility_Man_Page.rtf
@@ -1,28 +1,29 @@

[edk2-devel] [PATCH v2 0/2] Automatically set NXCOMPAT bit if requirements are met

2023-06-28 Thread Joey Vagedes via groups.io
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4487

v2: Adds --nonxcompat flag to GenFw; updates man page
v2: Updates PeImage.h to reference spec 9.3 rather then 8.3

Utilize GenFw to automatically set the NXCOMPAT bit of the DLL Characteristics
field of the Optional Header if the following requirements are met:

1. It is a 64bit PE
2. The section alignment is evently divisible by 4K
3. No section is both EFI_IMAGE_SCN_MEM_EXECUTE and EFI_IMAGE_SCN_MEM_WRITE

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Rebecca Cran 
Cc: Bob Feng 
Cc: Yuwei Chen 

Joey Vagedes (2):
  MdePkg: IndustryStandard: Add DLL Characteristics
  BaseTools: GenFw: auto-set nxcompat flag

 MdePkg/Include/IndustryStandard/PeImage.h|  17 +-
 BaseTools/Source/C/GenFw/GenFw.c |  70 
 BaseTools/UserManuals/GenFw_Utility_Man_Page.rtf | 420 +++-
 3 files changed, 309 insertions(+), 198 deletions(-)

-- 
2.41.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106476): https://edk2.groups.io/g/devel/message/106476
Mute This Topic: https://groups.io/mt/99835854/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v2 1/2] MdePkg: IndustryStandard: Add DLL Characteristics

2023-06-28 Thread Joey Vagedes via groups.io
Add the bit masks for DLL Characteristics, used within the optional
header of a PE, to the PeImage.h header file.

Update the Visual Studio, Microsoft Portable Executable and Common
Object File Format Specification, and the PE/COFF Specification to the
latest version.

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Signed-off-by: Joey Vagedes 
---
 MdePkg/Include/IndustryStandard/PeImage.h | 17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Include/IndustryStandard/PeImage.h 
b/MdePkg/Include/IndustryStandard/PeImage.h
index 47037049348c..9fdbfb9c4944 100644
--- a/MdePkg/Include/IndustryStandard/PeImage.h
+++ b/MdePkg/Include/IndustryStandard/PeImage.h
@@ -4,7 +4,7 @@
   EFI_IMAGE_NT_HEADERS64 is for PE32+.
 
   This file is coded to the Visual Studio, Microsoft Portable Executable and
-  Common Object File Format Specification, Revision 8.3 - February 6, 2013.
+  Common Object File Format Specification, Revision 9.3 - December 29, 2015.
   This file also includes some definitions in PI Specification, Revision 1.0.
 
 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
@@ -269,6 +269,21 @@ typedef struct {
 #define EFI_IMAGE_SUBSYSTEM_OS2_CUI  5
 #define EFI_IMAGE_SUBSYSTEM_POSIX_CUI7
 
+//
+// DLL Characteristics
+//
+#define IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA0x0020
+#define IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE   0x0040
+#define IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY0x0080
+#define IMAGE_DLLCHARACTERISTICS_NX_COMPAT  0x0100
+#define IMAGE_DLLCHARACTERISTICS_NO_ISOLATION   0x0200
+#define IMAGE_DLLCHARACTERISTICS_NO_SEH 0x0400
+#define IMAGE_DLLCHARACTERISTICS_NO_BIND0x0800
+#define IMAGE_DLLCHARACTERISTICS_APPCONTAINER   0x1000
+#define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER 0x2000
+#define IMAGE_DLLCHARACTERISTICS_GUARD_CF   0x4000
+#define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE  0x8000
+
 ///
 /// Length of ShortName.
 ///
-- 
2.41.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106477): https://edk2.groups.io/g/devel/message/106477
Mute This Topic: https://groups.io/mt/99835855/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-