[edk2] [PATCH v2 3/4] MdePkg/UefiLib: Simplify protocol un/installation abstraction

2019-01-04 Thread Ashish Singhal
Add a helper function to operate upon protocol installation and uninstallation instead of every function doing it by itself. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ashish Singhal --- MdePkg/Include/Library/UefiLib.h | 26 +-

[edk2] [PATCH v2 2/4] NetworkPkg/IScsiDxe: Use UEFILib APIs to uninstall protocols.

2019-01-04 Thread Ashish Singhal
During cleanup in case of initialization failure, some driver bindings are not installed. Using abstractions in UEFILib takes care of it. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1428 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ashish Singhal ---

[edk2] [PATCH v2 4/4] NetworkPkg/IScsiDxe: Update UEFILib Usage

2019-01-04 Thread Ashish Singhal
Update interfaces as exposed by UEFILib for protocol installation and uninstallation abstraction. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ashish Singhal --- NetworkPkg/IScsiDxe/IScsiDriver.c | 6 ++ 1 file changed, 6 insertions(+) diff --git

[edk2] [PATCH v2 0/4] Provide UEFILib functions for protocol uninstallation.

2019-01-04 Thread Ashish Singhal
An issue was seen in IScsiDxe in NetworkPkg where driver cleanup after initialization failure was not done right. Bug 1428 was filed in this regard. As per discussions with Mike, it was also discussed that having UEFILib provide protocol uninstallation abstraction would help to avoid these issues

[edk2] [PATCH v2 1/4] MdePkg/UefiLib: Abstract driver model protocol uninstallation

2019-01-04 Thread Ashish Singhal
Provided functions in UEFILib that abstract driver model protocol uninstallation. This helps drivers to install and uninstall protocols using a library to keep things seemless. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1429 Contributed-under: TianoCore Contribution Agreement 1.1

Re: [edk2] [PATCH v2 08/11] MdeModulePkg/VarCheckLib: allow MM_STANDALONE drivers to use this library

2019-01-04 Thread Ard Biesheuvel
On Wed, 2 Jan 2019 at 14:14, Jagadeesh Ujja wrote: > > “VarCheckLib” library can be used by MM_STANDALONE drivers as well. > So add MM_STANDALONE as the module type this library supports. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Jagadeesh Ujja Reviewed-by:

Re: [edk2] [PATCH v2 11/11] CryptoPkg/BaseCryptLib: allow MM_STANDALONE drivers to use this library

2019-01-04 Thread Ard Biesheuvel
(add the CryptoPkg maintainer) On Wed, 2 Jan 2019 at 14:14, Jagadeesh Ujja wrote: > > “SmmCryptLib” library can be used by MM_STANDALONE drivers as well. > So add MM_STANDALONE as the module type this library supports. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by:

[edk2] [PATCH 8/8] StandaloneMmPkg/Core: permit encapsulated firmware volumes

2019-01-04 Thread Ard Biesheuvel
Standalone MM requires 4 KB section alignment for all images, so that strict permissions can be applied. Unfortunately, this results in a lot of wasted space, which is usually costly in the secure world environment that standalone MM is expected to operate in. So let's permit the standalone MM

[edk2] [PATCH 5/8] StandaloneMmPkg/StandaloneMmPeCoffExtraActionLib: ignore runtime attribute

2019-01-04 Thread Ard Biesheuvel
The special handling of the EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER attribute is only necessary for images that are relocated twice, i.e., in the context of SetVirtualAddressMap (). This does not apply to standalone MM modules, so drop the check. Drop some redundant DEBUG output while at it.

[edk2] [PATCH 2/8] StandaloneMmPkg/StandaloneMmCoreEntryPoint: add missing SerialPortLib ref

2019-01-04 Thread Ard Biesheuvel
StandaloneMmCoreEntryPoint calls SerialPortInitialize() explicitly, so add SerialPortLib to its list of LibraryClasses. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf |

[edk2] [PATCH 6/8] StandaloneMmPkg/Core/Dispatcher: don't copy dispatched image twice

2019-01-04 Thread Ard Biesheuvel
The dispatcher uses the PE/COFF loader to load images into the heap, but only does so after copying the entire image first, leading to two copies being made for no good reason. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel ---

[edk2] [PATCH 1/8] StandaloneMmPkg/StandaloneMmCpu: fix typo Standlone -> Standalone

2019-01-04 Thread Ard Biesheuvel
Fix a couple of occurrences of typo Standlone -> Standalone. Since _PiMmStandloneArmTfCpuDriverEntry() is never referenced, drop it altogether. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c

[edk2] [PATCH 4/8] StandaloneMmPkg/StandaloneMmCoreEntryPoint: remove bogus ASSERT_EFI_ERROR()s

2019-01-04 Thread Ard Biesheuvel
ASSERT_EFI_ERROR (x) is a shorthand for ASSERT(!EFI_ERROR(x)), and so it should only be used with EFI_STATUS type expressions. So drop two instances that operate on other types, since neither looks particularly useful. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard

[edk2] [PATCH 7/8] StandaloneMmPkg/StandaloneMmCoreEntryPoint: permit the use of TE images

2019-01-04 Thread Ard Biesheuvel
TE images take up less space when using 4 KB section alignment, since the FFS/FV generation code optimizes away the redundant, nested padding. This saves 4 KB of space, which is a worthwhile improvement for code that executes in place in secure context. Contributed-under: TianoCore Contribution

[edk2] [PATCH 3/8] StandaloneMmPkg/StandaloneMmCoreEntryPoint: use %a modifier for ASCII strings

2019-01-04 Thread Ard Biesheuvel
PE/COFF section names are ASCII strings so use %a not %s. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [edk2] [PATCH v2 04/11] MdePkg/Include: Add StandaloneMmServicesTableLib library

2019-01-04 Thread Ard Biesheuvel
On Thu, 3 Jan 2019 at 17:14, Laszlo Ersek wrote: > > On 01/03/19 12:03, Ard Biesheuvel wrote: > > On Wed, 2 Jan 2019 at 14:14, Jagadeesh Ujja wrote: > >> > >> Some of the existing DXE drivers can be refactored to execute within > >> the Standalone MM execution environment as well. Allow such

Re: [edk2] [edk2-announce][RFC] Collaboration Software: Microsoft Teams

2019-01-04 Thread Knop, Ryszard
I think any solution like that should be publicly available for an unlimited number of users. As it stands now, mailing lists and IRC are open to all - if software like Microsoft Teams is to be used, it's pretty likely most communication would quickly become invitation-only to avoid paying $8 per

Re: [edk2] [PATCH v2 10/11] SecurityPkg/AuthVariableLib: allow MM_STANDALONE drivers to use this library

2019-01-04 Thread Ard Biesheuvel
On Thu, 3 Jan 2019 at 07:15, Jagadeesh Ujja wrote: > > On Thu, Jan 3, 2019 at 6:45 AM Zhang, Chao B wrote: > > > > Reviewed-by : Chao Zhang > > Hi Chao Zhang, > > Thanks for the review, I will not be having any new changes with this > specific patch. > Can you please merge this patch, so that I

Re: [edk2] [PATCH] BaseTools/GenFds: permit stripped MM_CORE_STANDALONE binaries

2019-01-04 Thread Ard Biesheuvel
On Thu, 3 Jan 2019 at 17:05, Carsey, Jaben wrote: > > Reviewed-by: Jaben Carsey > > Thanks all Pushed as 672601cfcc6f..8ef653aa5aad > > -Original Message- > > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of > > Ard Biesheuvel > > Sent: Thursday, January 03, 2019

[edk2] [patch] MdePkg/BasePeCoffLib: Add more check for relocation data

2019-01-04 Thread Dandan Bi
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1426 In function PeCoffLoaderRelocateImageForRuntime, it doesn't do much check when applies relocation fixups. For API level consideration, it's not safe enough. This patch is to replace the same code logic with calling function

[edk2] [PATCH edk2-platforms 4/7] Silicon/SynQuacer/Fip006Dxe: use proper accessor for unaligned access

2019-01-04 Thread Ard Biesheuvel
This code may execute in SMM context, where unaligned accesses are not permitted. So use ReadUnaligned32() instead of performing a direct UINT32* cast. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel ---

[edk2] [PATCH edk2-platforms 2/7] Silicon/SynQuacer/Fip006Dxe: factor out DXE specific pieces

2019-01-04 Thread Ard Biesheuvel
In preparation of creating a SMM version of the FIP006 NOR flash driver, refactor the existing pieces into a core driver, the FVB methods and the DXE instantiation code. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel ---

[edk2] [PATCH edk2-platforms 7/7] Platform/DeveloperBox: add MM based UEFI secure boot support

2019-01-04 Thread Ard Biesheuvel
This implements support for UEFI secure boot on DeveloperBox using the standalone MM framework. This moves all of the software handling of the UEFI authenticated variable store into the standalone MM context residing in a secure partition. Note that SynQuacer as configured today is not a truly

[edk2] [PATCH edk2-platforms 6/7] Platform/DeveloperBox: add .DSC/.FDF description of MM components

2019-01-04 Thread Ard Biesheuvel
Create a pair of .DSC/.FDF files that describe the components and the firmware volumes and flash device that will be dispatched into a secure partition in the secure world to control the UEFI secure variable store. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard

[edk2] [PATCH edk2-platforms 3/7] Silicon/SynQuacer/Fip006Dxe: implement standalone MM variant

2019-01-04 Thread Ard Biesheuvel
Implement a variant of the FIP006 NOR flash driver that can execute in standalone MM context. This is the foundation for hosting the EFI authenticated variable store in the secure world. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel ---

[edk2] [PATCH edk2-platforms 0/7] Silicon/SynQuacer: implement SMM based secure boot

2019-01-04 Thread Ard Biesheuvel
Wire up the various pieces so that the authenticated variable store runs entirely in standalone MM context residing in a secure partition. This primarily involves refactoring the platform's NOR flash driver so we can build a version that can work in the standalone MM context. Beyond that, it is

[edk2] [PATCH edk2-platforms 1/7] Silicon/SynQuacer/Fip006Dxe: drop block I/O and disk I/O routines

2019-01-04 Thread Ard Biesheuvel
The FIP006 NOR flash driver contains implementations of the block I/O and disk I/O protocols, but never exposes them to other drivers (i.e., it never installs the protocol interfaces). So let's drop this code altogether: the NOR flash is for code and variables, not for arbitrary files.

[edk2] [PATCH edk2-platforms 5/7] Platform/DeveloperBox: create shared .DSC include file

2019-01-04 Thread Ard Biesheuvel
We are going to add a separate .DSC/.FDF combo for the standalone MM components. So put all the pieces we will share in an include file that both .DSC files can include. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel ---

[edk2] EDK II Network Stack Issue

2019-01-04 Thread Karin Willers
G'Day! I'm trying to get networking under edk2 up and running. I tried AppPkg/Applications/Sockets/RawIp4Tx under OVMF. The raw packet is sent out on the network, but the application never returns from the socket close routine. I'm currently using UDK2017 with the latest security patches

Re: [edk2] Uninstalling Invalid Protocol Interfaces

2019-01-04 Thread Kinney, Michael D
Ashish, Thanks for the pointer. I agree there is an issue here. Please enter a Bugzilla against the IScsiDxe module for this issue so we can fix this failure. You are also welcome to enter a Bugzilla for a feature request to add UefiLib APIs that can be used to safely uninstall all the

[edk2] [PATCH 2/2] ArmPkg/ArmMmuLib ARM: fix thinko in second level page table handling

2019-01-04 Thread Ard Biesheuvel
PopulateLevel2PageTable () is invoked for [parts of] mappings that start or end on a non-1 MB aligned address (or both). The size of the mapping depends on both the start address modulo 1 MB and the length of the mapping, but the logic that calculates this size is flawed: subtracting 'start

Re: [edk2] [PATCH 4/8] StandaloneMmPkg/StandaloneMmCoreEntryPoint: remove bogus ASSERT_EFI_ERROR()s

2019-01-04 Thread Supreeth Venkatesh
On Fri, 2019-01-04 at 12:03 +0100, Ard Biesheuvel wrote: > ASSERT_EFI_ERROR (x) is a shorthand for ASSERT(!EFI_ERROR(x)), and so > it should only be used with EFI_STATUS type expressions. > > So drop two instances that operate on other types, since neither > looks > particularly useful. > >

Re: [edk2] [PATCH 2/8] StandaloneMmPkg/StandaloneMmCoreEntryPoint: add missing SerialPortLib ref

2019-01-04 Thread Supreeth Venkatesh
On Fri, 2019-01-04 at 12:03 +0100, Ard Biesheuvel wrote: > StandaloneMmCoreEntryPoint calls SerialPortInitialize() explicitly, > so add SerialPortLib to its list of LibraryClasses. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ard Biesheuvel Reviewed-by: Supreeth

[edk2] [PATCH 1/2] ArmPkg/ArmMmuLib ARM: add missing support for non-shareable cached mappings

2019-01-04 Thread Ard Biesheuvel
We introduced support for non-shareable cached mappings to the AArch64 version of ArmMmuLib a while ago, but the ARM version was left behind, so fix it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c | 13

Re: [edk2] Uninstalling Invalid Protocol Interfaces

2019-01-04 Thread Ashish Singhal
Mike, I have filed https://bugzilla.tianocore.org/show_bug.cgi?id=1428 and https://bugzilla.tianocore.org/show_bug.cgi?id=1429 to address this. I have assigned these to me as I already have fix for these. Also, how do we ensure all components which may have this issue (may not have exposed it

Re: [edk2] [PATCH 1/8] StandaloneMmPkg/StandaloneMmCpu: fix typo Standlone -> Standalone

2019-01-04 Thread Supreeth Venkatesh
On Fri, 2019-01-04 at 12:03 +0100, Ard Biesheuvel wrote: > Fix a couple of occurrences of typo Standlone -> Standalone. Since > _PiMmStandloneArmTfCpuDriverEntry() is never referenced, drop it > altogether. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ard

Re: [edk2] [PATCH 3/8] StandaloneMmPkg/StandaloneMmCoreEntryPoint: use %a modifier for ASCII strings

2019-01-04 Thread Supreeth Venkatesh
On Fri, 2019-01-04 at 12:03 +0100, Ard Biesheuvel wrote: > PE/COFF section names are ASCII strings so use %a not %s. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ard Biesheuvel Reviewed-by: Supreeth Venkatesh > --- >

[edk2] [PATCH 2/4] NetworkPkg/IScsiDxe: Use UEFILib APIs to uninstall protocols.

2019-01-04 Thread Ashish Singhal
During cleanup in case of initialization failure, some driver bindings are not installed. Using abstractions in UEFILib takes care of it. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1428 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ashish Singhal ---

[edk2] [PATCH 0/4] Provide UEFILib functions for protocol uninstallation.

2019-01-04 Thread Ashish Singhal
An issue was seen in IScsiDxe in NetworkPkg where driver cleanup after initialization failure was not done right. Bug 1428 was filed in this regard. As per discussions with Mike, it was also discussed that having UEFILib provide protocol uninstallation abstraction would help to avoid these issues

[edk2] [PATCH 3/4] MdePkg/UefiLib: Simplify protocol un/installation abstraction

2019-01-04 Thread Ashish Singhal
Add a helper function to operate upon protocol installation and uninstallation instead of every function doing it by itself. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ashish Singhal --- MdePkg/Include/Library/UefiLib.h | 26 +-

[edk2] [PATCH 1/4] MdePkg/UefiLib: Abstract driver model protocol uninstallation

2019-01-04 Thread Ashish Singhal
Provided functions in UEFILib that abstract driver model protocol uninstallation. This helps drivers to install and uninstall protocols using a library to keep things seemless. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1429 Contributed-under: TianoCore Contribution Agreement 1.1

[edk2] [PATCH 4/4] NetworkPkg/IScsiDxe: Update UEFILib Usage

2019-01-04 Thread Ashish Singhal
Update interfaces as exposed by UEFILib for protocol installation and uninstallation abstraction. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ashish Singhal --- NetworkPkg/IScsiDxe/IScsiDriver.c | 6 ++ 1 file changed, 6 insertions(+) diff --git

Re: [edk2] Uninstalling Invalid Protocol Interfaces

2019-01-04 Thread Ashish Singhal
Mike, I have addressed the issue along with some optimizations and have submitted patches for review. Thanks Ashish From: Ashish Singhal Sent: Friday, January 4, 2019 10:33 AM To: 'Kinney, Michael D' ; edk2-devel@lists.01.org Cc: Gao, Liming ; Fu, Siyuan ; Wu, Jiaxin Subject: RE: