[edk2-devel] [Patch 01/11] .pytool: Add CI support for host based unit tests with results

2020-01-23 Thread Michael D Kinney
* Add plugin to build and run host based unit tests * Add plugin that performs a DSC complete check DSC files used to build host based tests * Update DscCompleteCheck plugin to ignore module INFs with a MODULE_TYPE of HOST_APPLICATION and library INFs that only support a module type of

[edk2-devel] [Patch 03/11] MdePkg/Include/Library: Add UnitTestLib class

2020-01-23 Thread Michael D Kinney
From: Bret Barkelew Add UnitTestLib class to MdePkg that provides services and macros to implement unit tests. These services and macros support the following features: * Create a Unit Test Framework * Add a Unit Test Suite to a Unit Test Framework + Support optional step that executes

[edk2-devel] [Patch 08/11] MdePkg/Test: Add SafeIntLib and BaseLib Base64 unit tests

2020-01-23 Thread Michael D Kinney
* Add unit tests for SafeIntLib class * Add unit tests for BaseLib Base64 conversion APIs. * Add Test/MdePkgHostTest.dsc -to build host based unit tests * Update MdePkg.dsc to build target based tests for SafeIntLib and BaseLib * Update MdePkg.ci.yaml to build and run host based tests for

[edk2-devel] [Patch 06/11] UnitTestFrameworkPkg/Test: Add unit test samples

2020-01-23 Thread Michael D Kinney
Add an implementation of a sample unit test that demonstrates the use of the UnitTestLib services and macros and supports being built for execution in a host environment or for execution on a target in PEI, DXE, SMM, or UEFI Shell. Cc: Sean Brogan Cc: Bret Barkelew Signed-off-by: Michael D

[edk2-devel] [Patch 09/11] MdeModulePkg: Add DxeResetSystemLib unit test

2020-01-23 Thread Michael D Kinney
* Add unit test of DxeResetSystemLib library instance that uses cmocka interfaces to mock the UEFI Runtime Services Table and its ResetSystem() service. When a unit test uses the cmocka interfaces, the unit test does not support being run from target environments. cmocka APIs:

[edk2-devel] [Patch 02/11] BaseTools/Plugin: Add HostBasedUnitTestRunner plugin

2020-01-23 Thread Michael D Kinney
Add plugin to BaseTools to run host based unit tests. Cc: Sean Brogan Cc: Bret Barkelew Cc: Bob Feng Cc: Liming Gao Signed-off-by: Michael D Kinney --- .../HostBasedUnitTestRunner.py| 115 ++ .../HostBasedUnitTestRunner_plug_in.yaml | 12 ++ 2 files

[edk2-devel] [Patch 00/11] Add Unit Test Framework

2020-01-23 Thread Michael D Kinney
Branch for review: https://github.com/mdkinney/edk2/tree/edk2-host-test_v2_mdk_updates_v4 GitHub Pull Request for review (Personal Build): https://github.com/tianocore/edk2/pull/315 Add a Unit Test Framework to the edk2 repository that supports development of unit tests for interfaces,

[edk2-devel] [Patch 07/11] UnitTestFrameworkPkg: Add DSC, DSC INC, and YAML files

2020-01-23 Thread Michael D Kinney
* DSC in root of package file to perform a package build of the UnitTestFrameworkPkg and build sample unit test for all supported target environments. * DSC file in Test directory to build the sample unit test for the host environment. * UnitTestFrameworkPkgTarget.dsc.inc - DSC include

[edk2-devel] [Patch 04/11] UnitTestFrameworkPkg: Add public and private interfaces

2020-01-23 Thread Michael D Kinney
Add public interfaces for use by unit test implementations. * Include path to cmocka library interfaces. * PcdUnitTestLogLevel to set the unit test logging message level to filter log messages. Add private interfaces that are used by UnitTestLib implementations. * [Private] UnitTestBootLib -

[edk2-devel] [Patch 11/11] Maintainers.txt: Add UnitTestFrameworkPkg

2020-01-23 Thread Michael D Kinney
Add maintainers and reviewers for UnitTestFrameworkPkg Cc: Sean Brogan Cc: Bret Barkelew Cc: Andrew Fish Cc: Laszlo Ersek Cc: Leif Lindholm Signed-off-by: Michael D Kinney --- Maintainers.txt | 7 +++ 1 file changed, 7 insertions(+) diff --git a/Maintainers.txt b/Maintainers.txt index

[edk2-devel] [Patch 10/11] .azurepipelines: Enable CI for UnitTestFrameworkPkg and host tests

2020-01-23 Thread Michael D Kinney
* Add NOOPT target to MdePkg, MdeModulePkg, and UnitTestFrameworkPkg to support building host based unit tests with optimization disabled. Cc: Sean Brogan Cc: Bret Barkelew Cc: Liming Gao Signed-off-by: Michael D Kinney --- .azurepipelines/templates/pr-gate-build-job.yml | 10 +-

[edk2-devel] [Patch] BaseTools/Scripts/PatchCheck.py: Remove submodule false positives

2020-01-23 Thread Michael D Kinney
https://bugzilla.tianocore.org/show_bug.cgi?id=2484 https://bugzilla.tianocore.org/show_bug.cgi?id=2485 Update PatchCheck to not enforce no tabs and not enforce CR/LF line endings for .gitmodules files. These files are updated by git when a git submodule command is used and the updates by git

Re: [edk2-devel] PCD EX interface.

2020-01-23 Thread Andrew Fish via Groups.Io
> On Jan 23, 2020, at 3:21 AM, Laszlo Ersek wrote: > > Hi Ken, > > On 01/23/20 02:37, Ken Taylor wrote: > >> If I try to get the size of a DynamicEx PCD in the context of a BIOS >> build for which that PCD is undefined, the call locks up. I expected >> to just get a size of 0, since the PCD

Re: [edk2-devel] [edk2-staging/EdkRepo][PATCH v1] EdkRepo: Fixed execution of final_copy.py

2020-01-23 Thread Desimone, Ashley E
Reviewed-by: Ashley Desimone -Original Message- From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Bjorge, Erik C Sent: Wednesday, January 22, 2020 1:55 PM To: devel@edk2.groups.io Cc: Desimone, Nathaniel L ; Desimone, Ashley E ; Pandya, Puja ; Bret Barkelew

[edk2-devel] [PATCH v5 2/2] CryptoPkg/BaseHashLib: Implement Unified Hash Calculation API

2020-01-23 Thread Sukerkar, Amol N
This commit introduces a Unified Hash API to calculate hash using a hashing algorithm specified by the PCD, PcdSystemHashPolicy. This library interfaces with the various hashing API, such as, MD4, MD5, SHA1, SHA256, SHA512 and SM3_256 implemented in BaseCryptLib. The user can calculate the desired

[edk2-devel] [PATCH v5 1/2] CryptoPkg: Add CryptoPkg Token Space GUID

2020-01-23 Thread Sukerkar, Amol N
Added CryptoPkg Token Space GUID to be able to define PCDs. Cc: Jiewen Yao Cc: Jian J Wang Cc: Michael D Kinney Signed-off-by: Sukerkar, Amol N --- CryptoPkg/CryptoPkg.dec | 7 ++- CryptoPkg/Include/Guid/CryptoPkgTokenSpace.h | 19 +++ 2 files

[edk2-devel] [PATCH v5 0/2] CryptoPkg/BaseHashLib: Implement Unified Hash Calculation API

2020-01-23 Thread Sukerkar, Amol N
Currently, the UEFI drivers using the SHA/SM3 hashing algorithms use hard-coded API to calculate the hash, for instance, sha_256(...), etc. Since SHA384 and/or SM3_256 are being increasingly adopted for robustness, it becomes cumbersome to modify each driver that calls into hash calculating API.

Re: [edk2-devel] [PATCH v4 2/2] CryptoPkg/BaseHashLib: Implement Unified Hash Calculation API

2020-01-23 Thread Sukerkar, Amol N
Hi Jian, You are correct that using local variable will link the unused libraries. In any case, I will simplify the BaseHashLib library further based on comments so far. About your comment: (3) Why do you need additional buffer here? The extra copy can be avoided by passing the '*Digest' to

Re: [edk2-devel] [PATCH v4 2/2] CryptoPkg/BaseHashLib: Implement Unified Hash Calculation API

2020-01-23 Thread Sukerkar, Amol N
Thanks, Hot! I will change the license to reflect it. ~ Amol -Original Message- From: Tian, Hot Sent: Friday, January 17, 2020 4:33 PM To: devel@edk2.groups.io; Sukerkar, Amol N Cc: Kinney, Michael D ; Yao, Jiewen ; Wang, Jian J ; Agrawal, Sachin ; Musti, Srinivas ; Lakkimsetti,

Re: [edk2-devel] [edk2-platforms][PATCH 2/3] Platform/RPi: Add PlatformPcdLib to set the Genet MAC address

2020-01-23 Thread Pete Batard
On 2020.01.23 13:50, Ard Biesheuvel wrote: On Thu, 23 Jan 2020 at 13:00, Pete Batard wrote: The Genet driver stub used by the Raspberry Pi 4 platform is designed to set the MAC address according to a PCD. To be able to set that PCD at runtime, by using the Raspberry Pi firmware interface,

Re: [edk2-devel] [edk2-platforms][PATCH 1/3] Silicon/Broadcom/Net: Add Genet stub driver to setup MAC

2020-01-23 Thread Pete Batard
Hi Ard, On 2020.01.23 13:44, Ard Biesheuvel wrote: On Thu, 23 Jan 2020 at 13:00, Pete Batard wrote: From: Jeremy Linton Add a stub for the Broadcom Genet network interface, that is used by the Raspberry Pi 4 (and that may be used by other platforms). For the time being, the stub only

Re: [edk2-devel] [edk2-platforms][PATCH 2/3] Platform/RPi: Add PlatformPcdLib to set the Genet MAC address

2020-01-23 Thread Ard Biesheuvel
On Thu, 23 Jan 2020 at 13:00, Pete Batard wrote: > > The Genet driver stub used by the Raspberry Pi 4 platform is > designed to set the MAC address according to a PCD. > > To be able to set that PCD at runtime, by using the Raspberry > Pi firmware interface, that has a dedicated call to retrieve

Re: [edk2-devel] [edk2-platforms][PATCH 1/3] Silicon/Broadcom/Net: Add Genet stub driver to setup MAC

2020-01-23 Thread Ard Biesheuvel
On Thu, 23 Jan 2020 at 13:00, Pete Batard wrote: > > From: Jeremy Linton > > Add a stub for the Broadcom Genet network interface, that is used > by the Raspberry Pi 4 (and that may be used by other platforms). > > For the time being, the stub only performs UMAC init, using a MAC > address PCD,

Re: [edk2-devel] [PATCH v2] BaseTools/Conf/gitattributes: fix "--function-context" for C source code

2020-01-23 Thread Laszlo Ersek
Mike, can you please ACK this patch while Liming and Bob are away? It's very simple. Thanks! Laszlo On 01/20/20 10:42, Laszlo Ersek wrote: > The "--function-context" ("-W") option of git-diff displays the entire > body of a modified function, not just small modified hunks within the > function.

Re: [edk2-devel] [PATCH] Platform/RPi/Genet: Add Genet stub driver to setup MAC

2020-01-23 Thread Pete Batard
**PLEASE DISREGARD THIS PATCH** I had a couple of extra .patch files in my repo that were inadvertently sent with the previous series. /Pete On 2020.01.23 12:00, Pete Batard via Groups.Io wrote: From: Jeremy Linton The RPi4 has a 1G BCM Genet platform device. In order to assist in booting

Re: [edk2-devel] [PATCH] Platform/RPi4: Enable BCM GENET stub driver

2020-01-23 Thread Pete Batard
**PLEASE DISREGARD THIS PATCH** I had a couple of extra .patch files in my repo that were inadvertently sent with the previous series. /Pete On 2020.01.23 12:00, Pete Batard via Groups.Io wrote: From: Jeremy Linton We have a stub driver, which retrieves the rpi's MAC address via the

[edk2-devel] [edk2-platforms][PATCH 3/3] Platform/Rpi4: Enable Broadcom Genet stub driver

2020-01-23 Thread Pete Batard
From: Jeremy Linton This adds the required references to use the Genet stub driver in order to dynamically populate the MAC address for OS consumption. Signed-off-by: Pete Batard --- Platform/RaspberryPi/RPi4/RPi4.dsc | 5 + Platform/RaspberryPi/RPi4/RPi4.fdf | 1 + 2 files changed, 6

[edk2-devel] [PATCH] Platform/RPi/Genet: Add Genet stub driver to setup MAC

2020-01-23 Thread Pete Batard
From: Jeremy Linton The RPi4 has a 1G BCM Genet platform device. In order to assist in booting the platform in an ACPI environment, it is desirable if the hardware can describe itself rather than passing parameters via DSDT/DSD. One way to achieve this is to assure that the adapter is

[edk2-devel] [PATCH] Platform/RPi4: Enable BCM GENET stub driver

2020-01-23 Thread Pete Batard
From: Jeremy Linton We have a stub driver, which retrieves the rpi's MAC address via the mailbox interface and programs the NIC. Lets enable it. Signed-off-by: Jeremy Linton --- Platform/RaspberryPi/RPi4/RPi4.dsc | 1 + Platform/RaspberryPi/RPi4/RPi4.fdf | 1 + 2 files changed, 2

[edk2-devel] [edk2-platforms][PATCH 0/3] Platform/RPi4: Add Genet network driver stub

2020-01-23 Thread Pete Batard
The Raspberry Pi 4 Broadcom Genet network adapter can be made to work in ACPI mode under high level OSes such as Linux. To facilitate this however, it is desirable to ensure that the platform's MAC address has properly been written to the dedicated UMAC registers during UEFI initialization. This

[edk2-devel] [edk2-platforms][PATCH 2/3] Platform/RPi: Add PlatformPcdLib to set the Genet MAC address

2020-01-23 Thread Pete Batard
The Genet driver stub used by the Raspberry Pi 4 platform is designed to set the MAC address according to a PCD. To be able to set that PCD at runtime, by using the Raspberry Pi firmware interface, that has a dedicated call to retrieve the MAC address, and satisfy driver dependencies in a generic

[edk2-devel] [edk2-platforms][PATCH 1/3] Silicon/Broadcom/Net: Add Genet stub driver to setup MAC

2020-01-23 Thread Pete Batard
From: Jeremy Linton Add a stub for the Broadcom Genet network interface, that is used by the Raspberry Pi 4 (and that may be used by other platforms). For the time being, the stub only performs UMAC init, using a MAC address PCD, as, even without a working network interface in UEFI environment,

Re: [edk2-devel] PCD EX interface.

2020-01-23 Thread Laszlo Ersek
Hi Ken, On 01/23/20 02:37, Ken Taylor wrote: > If I try to get the size of a DynamicEx PCD in the context of a BIOS > build for which that PCD is undefined, the call locks up. I expected > to just get a size of 0, since the PCD is not defined in the build > context of the PCD DXE service. Is

[edk2-devel] PCD EX interface.

2020-01-23 Thread Ken Taylor
Hi all, I'm trying to access a PCD in a build independent manner. Specifically, moving forward, I want to write a PCD value in my BIOS code during PEI phase, and then read back the value of that PCD in a build independent shell utility (or identify and report situations in which the PCD is