[edk2-devel] [Patch v3 01/16] BaseTools/Python: Allow HOST_APPLICATION to use NULL libraries

2020-07-10 Thread Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2797 Update HOST_APPLICATION module type to use NULL library instances. Cc: Bob Feng Cc: Liming Gao Cc: Sean Brogan Cc: Bret Barkelew Cc: Jiewen Yao Signed-off-by: Michael D Kinney Reviewed-by: Bob Feng Reviewed-by: Sean Brogan --- Base

[edk2-devel] [Patch v3 13/16] MdePkg/Include: Hook DebugLib _ASSERT() for unit tests

2020-07-10 Thread Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2801 Update DebugLib.h _ASSERT() macro to check if unit testing is enabled and call UnitTestDebugAssert() instead of DebugAssert() so the an ASSERT() condition that is triggered by a function under test can be handled by the Unit Test Framework.

[edk2-devel] [Patch v3 07/16] UnitTestFrameworkPkg: Enable source level debug for host tests

2020-07-10 Thread Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2804 Optionally enable a feature to support source level debug of a host based unit test. By default, this feature is disabled. Exceptions are caught by the unit test framework and are interpreted as a test failure. When a unit test is under de

[edk2-devel] [Patch v3 08/16] UnitTestFrameworkPkg: Set host application stack size to 256KB

2020-07-10 Thread Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2803 The UEFI Specification defines the minimum stack size before ExitBootServices() to be 128KB. When running a host based unit test, there may be additional stack overhead from the host application environment and cmocka. Update the build fla

[edk2-devel] [Patch v3 05/16] MdePkg/Library/BaseLib: Add BaseLib instance for host based unit tests

2020-07-10 Thread Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2800 Add a new version of BaseLib that is safe for use from host based unit test applications. Host based unit test applications may need to provide implementations of some BaseLib functions that provide simple emulation to exercise the code und

[edk2-devel] [Patch v3 03/16] MdePkg/BaseCacheMaintenanceLibNull: Add Null instance for host testing

2020-07-10 Thread Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2799 The services in CacheMaintenanceLib usually generate exceptions in a unit test host application. Provide a Null instance that can be safely used. This Null instance can also be used as a template for implementing new instances of CacheMain

[edk2-devel] [Patch v3 16/16] UnitTestFramewokPkg/SampleUnitTest: Use UT_EXPECT_ASSERT_FAILURE()

2020-07-10 Thread Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2801 Add samples for all UnitTestLib macros including using UT_EXPECT_ASSERT_FAILURE() for positive test cases where an ASSERT() is triggered and detected correctly. Additional test cases are added that disable ASSERT()s and verify that UT_EXPEC

[edk2-devel] [Patch v3 14/16] MdePkg/Include: Add UT_EXPECT_ASSERT_FAILURE() to UnitTestLib

2020-07-10 Thread Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2801 Add the UT_EXPECT_ASSERT_FAILURE(FunctionCall, Status) macro to the UnitTestLib that can be used to check if a function under test triggers an ASSERT() condition. If an ASSERT() condition is triggered, then the macro returns. If the ASSERT

[edk2-devel] [Patch v3 15/16] MdePkg/Library/BaseStackCheckLib: Fix PCD type in INF

2020-07-10 Thread Michael D Kinney
Update INF file to use a [Pcd] section instead of a [FixedPcd] section. [FixedPcd] should only be used in an INF file if the source code looks up the PCD value using the PcdLib FixedPcdGetxx() services. Using [FixedPcd] forces a platform to configure the PCD to type FixedAtBuild. In this case, Pc

[edk2-devel] [Patch v3 00/16] UnitTestFrameworkPkg: Enhancements and bug fixes

2020-07-10 Thread Michael D Kinney
Changes in V3 == * Add UnitTestHostBaseLib class for the global variable that allows host based unit tests to hook and emulate some BaseLib services Changes in V2 == * Add UnitTestExpectAssertFailure() to UnitTestLib to simplify the macro UT_EXPECT_ASSERT_FAILURE() and

[edk2-devel] [Patch v3 12/16] UnitTestFrameworkPkg/UnitTestLib: Add checks for ASSERT()

2020-07-10 Thread Michael D Kinney
REF: REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2801 Add UnitTestDebugAssertLib that provides the UnitTestDebugAssert() service and the gUnitTestExpectAssertFailureJumpBuffer global variable. This NULL library is linked against all host and target unit test builds. This guarantees that

[edk2-devel] [Patch v3 04/16] MdePkg/BaseLib: Break out IA32/X64 GCC inline privileged functions

2020-07-10 Thread Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2800 Break out the IA32/X64 GCC inline functions that can not be used in a unit test host application into their own source file. This does not make any changes to the BaseLib library instance. This is in preparation for a new BaseLib instances

[edk2-devel] [Patch v3 06/16] UnitTestFrameworkPkg: Use host libraries from MdePkg

2020-07-10 Thread Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2800 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2799 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2798 Update the default unit test library mappings to use the library instances from the MdePkg that are safe for host based unit te

[edk2-devel] [Patch v3 09/16] UnitTestFrameworkPkg: Change target mode DebugLib mapping

2020-07-10 Thread Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2801 The default DebugLib for target mode was DebugLibNull. This library instance disables all ASSERT() and DEBUG() macros which removes the ability to write unit tests that check for ASSERT() behaviors. The DebugLib is changed to PeiDxeDebugLi

[edk2-devel] [Patch v3 10/16] UnitTestFrameworkPkg/UnitTestLib: Move print log into cleanup

2020-07-10 Thread Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2805 If a unit test fails with an exception or an assert, then the CmockaUnitTestFunctionRunner() is terminated and the logic that follows the invocation of the unit test is skipped. This currently skips the logic that prints log messages. Move

[edk2-devel] [Patch v3 02/16] MdePkg/BaseCpuLibNull: Add Null version of CpuLib for host testing

2020-07-10 Thread Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2798 The services in CpuLib usually generate exceptions in a unit test host application. Provide a Null instance that can be safely used. This Null instance can also be used as a template for implementing new instances of CpuLib. Cc: Liming Ga

[edk2-devel] [Patch v3 11/16] UnitTestFrameworkPkg/UnitTestLib: Fix target mode log messages

2020-07-10 Thread Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2806 Update the log messages generated in target mode to use FileName instead of FunctionName. FunctionName is an empty string so the log messages generated do not provide enough information to know the source of a unit test failure. Using File

Re: [edk2-devel] [PATCH v4 07/15] MdeModulePkg: Fix constructor invocation ordering

2020-07-10 Thread Sami Mujawar
Hi Hao, Jian, Can you let me know your feedback for this patch, please? Previous discussion on this patch can be seen at https://edk2.groups.io/g/devel/topic/75081484 Regards, Sami Mujawar -Original Message- From: devel@edk2.groups.io On Behalf Of Sami Mujawar via groups.io Sent: 07

Re: [edk2-devel] [Patch 04/15] MdePkg/BaseLib: Break out IA32/X64 GCC inline privileged functions

2020-07-10 Thread Michael D Kinney
Liming, GccInline.c can be used in UnitTestHostBaseLib instance. GccInlinePriv.c is the file that cannot be used in the. UnitTestHostBaseLib instance. Here are the grep results in the branch: baselib.inf: Ia32/GccInline.c | GCC baselib.inf: Ia32/GccInlinePriv.c | GCC baselib.inf: X64/

Re: [edk2-devel] [PATCH] SecurityPkg/Tcg2PhysicalPresenceLib: Fix incorrect TCG VER comparision

2020-07-10 Thread Stefan Berger
On 7/10/20 9:53 AM, Stefan Berger wrote: On 7/10/20 1:43 AM, Laszlo Ersek wrote: (+Marc-André, Stefan) On 07/10/20 02:44, Gao, Zhichao wrote: This bug is not obeserved by me. But I view the code. The condition is incorrect and it would affect the TCG operation: if (!mIsTcg2PPVerLowerThan

Re: [edk2-devel] [PATCH] SecurityPkg/Tcg2PhysicalPresenceLib: Fix incorrect TCG VER comparision

2020-07-10 Thread Stefan Berger
On 7/10/20 1:43 AM, Laszlo Ersek wrote: (+Marc-André, Stefan) On 07/10/20 02:44, Gao, Zhichao wrote: This bug is not obeserved by me. But I view the code. The condition is incorrect and it would affect the TCG operation: if (!mIsTcg2PPVerLowerThan_1_3) { if (OperationRequest < T

Re: [edk2-devel] edk2-platform configure serial UART for debugging

2020-07-10 Thread Andrey V
the recommendations from: https://software.intel.com/content/dam/develop/external/us/en/documents/uefi-firmware-porting-guide-for-the-intel-atom-processor-e3900-series-820187.pdf to edit: gPlatformModuleTokenSpaceGuid.PcdSerialIoUartNumber|2|UINT8|0x10001011 But how can I set UART2 for serial ou

[edk2-devel] [edk2-discuss] Need memory barriers in IoLib for AARCH64

2020-07-10 Thread Wasim Khan
Hello, MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf: IoLib library uses IoLibArm.c for AARCH64/ARM architecture and IoLib.c for other architectures. While IoLib.c already has memory barriers in MmioWrite functions, there barriers are missing in IoLibArm.c Is there any reason for **

Re: [edk2-devel] [edk2: PATCH] UefiCpuPkg: To enable X2Apic by default

2020-07-10 Thread Laszlo Ersek
On 07/10/20 07:38, Laszlo Ersek wrote: > On 07/10/20 05:31, Ji-yunX Lu wrote: >> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2845 >> Platform shall enable X2APIC by default to meet requirements for interrupt >> steering policy on Windows OS. >> >> Change-Id: Ia9e24bce79c91762c560fa3de626071

[edk2-devel] [edk2: PATCH] UefiCpuPkg: To enable X2Apic by default

2020-07-10 Thread Ji-yunX Lu
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2845 Platform shall enable X2APIC by default to meet requirements for interrupt steering policy on Windows OS. Change-Id: Ia9e24bce79c91762c560fa3de6260716939f0b1b Signed-off-by: Ji-yunX Lu Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Cc: Rahul

[edk2-devel] edk2-platform configure serial UART for debugging

2020-07-10 Thread Andrey V
Hi I maybe missing some steps, because mostly spent time to use SBL (slimbootloader) . I've managed to build Apollo Lake IFWI image for the LeafHill platform. However, I need to use it for our own board based LeafHill. How can I configure UART2 to get a serial message ? I can not see the setting

[edk2-devel] edk2-platform configure serial UART for debugging

2020-07-10 Thread Andrey V
Hi I maybe missing some steps, because mostly spent time to use SBL (slimbootloader) . I've managed to build Apollo Lake IFWI image for the LeafHill platform. However, I need to use it for our own board based LeafHill. How can I configure UART2 to get a serial message ? I can not see the settings

[edk2-devel] [edk2-platforms][PATCH v2 0/1] Platform/RaspberryPi/Drivers: Add SD card detection

2020-07-10 Thread Pete Batard
v2 to correct a couple "STATIC" -> "static" that were applied by an overzealous text editor. No other changes from v1. Pete Batard (1): Platform/RaspberryPi/Drivers: Add SD card detection Platform/RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.c | 66 +--- Platform/Ras

[edk2-devel] [edk2-platforms][PATCH v2 1/1] Platform/RaspberryPi/Drivers: Add SD card detection

2020-07-10 Thread Pete Batard
The Raspberry Pi 3 and Pi 4 platforms (with latest EEPROM) can boot straight from USB, without the need for an SD card being present. However, the IsCardPresent () calls from the ArasanMmcHost and SdHost drivers are currently hardwired to return TRUE, which results in straight to USB boot failing d

Re: [edk2-devel] [Patch 04/15] MdePkg/BaseLib: Break out IA32/X64 GCC inline privileged functions

2020-07-10 Thread Liming Gao
Mike: So, GccInline.c file can't be used in the unit test BaseLib. Thanks Liming -Original Message- From: Kinney, Michael D Sent: 2020年7月10日 1:01 To: Gao, Liming ; devel@edk2.groups.io; Kinney, Michael D Cc: Sean Brogan ; Bret Barkelew ; Yao, Jiewen Subject: RE: [Patch 04/15] MdeP

Re: [edk2-devel] [PATCH 01/13] SecurityPkg/Tcg2Pei: Add missing PCRIndex in FvBlob event.

2020-07-10 Thread Wang, Jian J
Reviewed-by: Jian J Wang Regards, Jian > -Original Message- > From: devel@edk2.groups.io On Behalf Of Yao, Jiewen > Sent: Monday, July 06, 2020 11:03 AM > To: devel@edk2.groups.io > Cc: Yao, Jiewen ; Wang, Jian J > Subject: [edk2-devel] [PATCH 01/13] SecurityPkg/Tcg2Pei: Add missing

Re: [edk2-devel] [PATCH 01/14] SecurityPkg/Tcg2Dxe: Add PcdTcgPfpMeasurementRevision in SpecId event.

2020-07-10 Thread Wang, Jian J
Reviewed-by: Jian J Wang Regards, Jian > -Original Message- > From: Yao, Jiewen > Sent: Monday, July 06, 2020 11:03 AM > To: devel@edk2.groups.io > Cc: Yao, Jiewen ; Wang, Jian J > Subject: [PATCH 01/14] SecurityPkg/Tcg2Dxe: Add > PcdTcgPfpMeasurementRevision in SpecId event. > > Fr