]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
5 years agoMdeModulePkg/CapsuleApp: Add functions to support Capsule-on-Disk
Chen A Chen [Tue, 29 Jan 2019 07:29:48 +0000 (15:29 +0800)]
MdeModulePkg/CapsuleApp: Add functions to support Capsule-on-Disk

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

This file provide some basic function to support Capsule-on-Disk.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Zhang Chao B <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
5 years agoMdeModulePkg/CapsuleApp: Add a function used to get next DevicePath
Chen A Chen [Mon, 28 Jan 2019 00:56:55 +0000 (08:56 +0800)]
MdeModulePkg/CapsuleApp: Add a function used to get next DevicePath

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

Add a new function to support Capsule-on-Disk feature.
This function is used to get next full DevicePath from a load option.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Zhang Chao B <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
5 years agoMdePkg/UefiSpec.h: Add definition to support Capsule-on-Disk feature
Chen A Chen [Fri, 25 Jan 2019 05:19:20 +0000 (13:19 +0800)]
MdePkg/UefiSpec.h: Add definition to support Capsule-on-Disk feature

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

UEFI Spec define this definition to support Capsule-on-Disk.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Zhang Chao B <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
5 years agoMdeModulePkg/UefiBootManagerLib: Match the nested partitions
Gary Lin [Wed, 23 Jan 2019 04:40:04 +0000 (12:40 +0800)]
MdeModulePkg/UefiBootManagerLib: Match the nested partitions

In some cases, such as MD RAID1 in Linux, the bootloader may be in a
nested EFI system partition partition. For example, sda1 and sdb1 are
combined as md0 and the first partition of md0, md0p1, is an EFI system
partition. Then, the bootloader can be located by the following device
paths:

PCI()/SATA(sda)/Partition(sda1)/Partition(md0p1)/File(bootloader.efi)
PCI()/SATA(sdb)/Partition(sdb1)/Partition(md0p1)/File(bootloader.efi)

To make the boot option more resilient, we may create a boot option with
the short-form device path like "Partition(md0p1)/File(bootloader.efi)".

However, BmMatchPartitionDevicePathNode() only matched the first
partition node and ignored the nested partitions, so the firmware would
refuse to load bootloader.efi since "Partition(md0p1)" doesn't match
either "Partition(sda1)" or "Partition(sda2)".

This commit modifies BmMatchPartitionDevicePathNode() to iterate all
nested partitions so that the above boot option could work.

v2 - Simplify the node matching logic

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
5 years agoMdePkg/BasePeCoffLib: skip runtime relocation if reloc info is invalid
Hsueh, Hong-chihX [Wed, 30 Jan 2019 01:19:36 +0000 (09:19 +0800)]
MdePkg/BasePeCoffLib: skip runtime relocation if reloc info is invalid

Skip runtime relocation for PE images that provide invalid relocation
infomation (ex: RelocDir->Size = 0) to fix a hang observed while booting
Windows.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Neo Hsueh <hong-chihx.hsueh@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bi Dandan <dandan.bi@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoFatPkg: Add GPT check in FatPei to support Capsule-on-Disk feature.
Chen A Chen [Wed, 16 Jan 2019 06:59:57 +0000 (14:59 +0800)]
FatPkg: Add GPT check in FatPei to support Capsule-on-Disk feature.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1470
This feature is used for finding GPT partition.
Follow the following step to check.
1) Check Protective MBR.
2) Check GPT primary/backup header.
3) Check GPT primary/backup entry array.

Cc: Ruiyu Ni <ray.ni@intel.com>
Cc: Zhang Chao B <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoMdePkg/UefiGpt.h: Add new definition for enable GPT support
Chen A Chen [Wed, 16 Jan 2019 08:11:51 +0000 (16:11 +0800)]
MdePkg/UefiGpt.h: Add new definition for enable GPT support

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

This definition comes from UEFI Spec to support GPT in FatPei driver.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Zhang Chao B <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoFatPkg: Break down Part.c file.
Chen A Chen [Wed, 16 Jan 2019 08:13:31 +0000 (16:13 +0800)]
FatPkg: Break down Part.c file.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1470
Break down partition parsing logic to 2 parts, Eltorito and MBR.

Cc: Ruiyu Ni <ray.ni@intel.com>
Cc: Zhang Chao B <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoSecurityPkg: Add a PCD to skip Opal password prompt
Chu, Maggie [Wed, 30 Jan 2019 06:40:51 +0000 (14:40 +0800)]
SecurityPkg: Add a PCD to skip Opal password prompt

https://bugzilla.tianocore.org/show_bug.cgi?id=1484
Add a PCD for skipping password prompt and device unlock flow.
so that other pre-OS applications are able to take over Opal
devices unlock flow.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Maggie Chu <maggie.chu@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoEmbeddedPkg: Fix Command Argument for SD/eMMC R/W operation.
Meenakshi Aggarwal [Thu, 24 Jan 2019 14:05:18 +0000 (19:35 +0530)]
EmbeddedPkg: Fix Command Argument for SD/eMMC R/W operation.

Issue : SD read failure for high capacity cards e.g. 64 GB

Reason : Command argument value exceeds 32 bit for block number 0x3787FFF
and cant be fit into 32 bit wide SD host controller register.

Fix :
AccessMode bits [29:30] of OCR is a valid definition to calculate
data address for eMMC cards.

For SD cards, data address is calculated on the basis of
card capacity status bit[30] of OCR.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoArmPkg/ArmMmuLib AARCH64: get rid of needless TLB invalidation
Ard Biesheuvel [Mon, 7 Jan 2019 07:15:01 +0000 (08:15 +0100)]
ArmPkg/ArmMmuLib AARCH64: get rid of needless TLB invalidation

Currently, we always invalidate the TLBs entirely after making
any modification to the page tables. Now that we have introduced
strict memory permissions in quite a number of places, such
modifications occur much more often, and it is better for performance
to flush only those TLB entries that are actually affected by
the changes.

At the same time, relax some system wide data synchronization barriers
to non-shared. When running in UEFI, we don't share virtual address
translations with other masters, unless we are running under virt, but
in that case, the host will upgrade them as appropriate (by setting
an override at EL2)

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoShellPkg/UefiShellAcpiViewCommandLib: Fix VS tool chain build failure
Dandan Bi [Mon, 28 Jan 2019 01:43:54 +0000 (09:43 +0800)]
ShellPkg/UefiShellAcpiViewCommandLib: Fix VS tool chain build failure

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

This patch is to update the data type of variable "Offset"
from UINT8 to UINT32 to fix following build issue.

...\Parsers\Pptt\PpttParser.c(193): error C2220:
warning treated as error - no 'object' file generated
...\Parsers\Pptt\PpttParser.c(193): warning C4244: '=':
conversion from 'UINT32' to 'UINT8', possible loss of data

Cc: Krzysztof Koch <krzysztof.koch@arm.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoArmPkg/ArmMmuLib ARM: trim high memory regions instead of rejecting them
Ard Biesheuvel [Mon, 28 Jan 2019 16:23:32 +0000 (17:23 +0100)]
ArmPkg/ArmMmuLib ARM: trim high memory regions instead of rejecting them

ArmSetMemoryAttributes() still chokes in some cases, i.e., when the
length of the region exceeds 4 GB, the subtraction overflows, which
results in the region being misidentified as being 32-bit addressable.

Let's update the logic to trim the length to what we can address with
32 bits. This fixes the issue, and also deals with the issue where an
entire region is disregarded if part of it exceeds beyond what we can
map with 32 bits.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoMdeModulePkg:Tpm2Acpi.h: Upgrade UEFI supporting TCG spec info
Zhang, Chao B [Fri, 25 Jan 2019 15:04:38 +0000 (23:04 +0800)]
MdeModulePkg:Tpm2Acpi.h: Upgrade UEFI supporting TCG spec info

Update "TCG ACPI Specification Level 00 Revision 00.37" to "TCG ACPI Specification 1.2 Revision 8"
https://trustedcomputinggroup.org/wp-content/uploads/TCG_ACPIGeneralSpecification_v1.20_r8.pdf

Contributed-under: TianoCore Contribution Agreement 1.1
Cc: Yao Jiewen <jiewen.yao@intel.com>
Signed-off-by: Zhang, Chao B <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
5 years agoSecurityPkg/TCG: Upgrade UEFI supporting TCG spec info
Zhang, Chao B [Fri, 25 Jan 2019 15:03:37 +0000 (23:03 +0800)]
SecurityPkg/TCG: Upgrade UEFI supporting TCG spec info

Update "TCG ACPI Specification Level 00 Revision 00.37" to "TCG ACPI Specification 1.2 Revision 8"
https://trustedcomputinggroup.org/wp-content/uploads/TCG_ACPIGeneralSpecification_v1.20_r8.pdf

Upgrade TCG PC Client Platform Physical Presence Interface Specification Version 1.3 Revision 0.52" to Errata Version 0.4
https://trustedcomputinggroup.org/wp-content/uploads/Errata-Version-0.4-for-TCG-PC-Client-Platform-Physical-Presence-Interface-Version-1.30-Revision-0.52.pdf

Upgrade "TCG EFI Protocol Specification for Family 2.0 Level 00" to Errata 0.5
https://trustedcomputinggroup.org/wp-content/uploads/EFI-Protocol-Specification-Errata-v.5.pdf

Contributed-under: TianoCore Contribution Agreement 1.1
Cc: Yao Jiewen <jiewen.yao@intel.com>
Signed-off-by: Zhang, Chao B <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
5 years agoMdeModulePkg/MdeModulePkg.dsc: ignore standalone MM modules for EBC or XCODE5
Ard Biesheuvel [Fri, 25 Jan 2019 08:12:05 +0000 (09:12 +0100)]
MdeModulePkg/MdeModulePkg.dsc: ignore standalone MM modules for EBC or XCODE5

The newly added standalone MM versions of the FTW and variable runtime
drivers were included in MdeModulePkg.dsc to get test coverage when
building the package from its own .dsc, but the resulting modules are
non-functional since they incorporate some dummy libraries.

Dandan reports that these modules don't build cleanly when using the
EBC or XCODE5 compilers, so given the above, let's just ignore them
in this case.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bi Dandan <dandan.bi@intel.com>
5 years agoIntelFsp2Pkg: FSP can utilize bootloader stack
Chasel, Chiu [Wed, 23 Jan 2019 08:12:38 +0000 (16:12 +0800)]
IntelFsp2Pkg: FSP can utilize bootloader stack

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

Current FSP utilizes pre-allocated temporary memory from
boot loader for both heap and stack. To reduce overall
temporary memory usage FSP may share the same stack with
boot loader and only needs a smaller memory for heap,
no separate memory required for stack.
Setting PcdFspHeapSizePercentage to 0 to enable FSP sharing
stack with boot loader, in this case boot loader stack
has to be large enough for FSP to use. Default is 50
(half memory heap and half memory stack) for backward
compatible with original model.

Test: Verified on internal platform and booting successfully
      with both modes.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
5 years agoIntelFsp2Pkg: Add function to get bootloader stack pointer
Chasel, Chiu [Wed, 23 Jan 2019 04:07:45 +0000 (12:07 +0800)]
IntelFsp2Pkg: Add function to get bootloader stack pointer

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

FSP on-going enhancement for stack utilization required
to know bootloader stack pointer and this pointer can be
retrieved by first input parameter address when FSP-M
entry API invoked by bootloader.

Test: Verified on internal platform and booting successfully

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
5 years agoBaseTools/build/build: delete variable
Carsey, Jaben [Thu, 24 Jan 2019 16:14:21 +0000 (00:14 +0800)]
BaseTools/build/build: delete variable

delete the shared global variable from Common.Misc
delete the uncalled users of the variable from build.build

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools/Common/Misc: Cleanup the imports
Carsey, Jaben [Thu, 24 Jan 2019 16:14:20 +0000 (00:14 +0800)]
BaseTools/Common/Misc: Cleanup the imports

Refactor to 'dict' from 'IterableUserDict' which was only required for old
    python interpreter.
Sort imports according to PEP8
Remove those we dont need.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools/Common/Misc: remove uncalled code
Carsey, Jaben [Thu, 24 Jan 2019 16:14:19 +0000 (00:14 +0800)]
BaseTools/Common/Misc: remove uncalled code

no use for this code content.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools:Define Macro in Inf file, the pcdvalue Can't convert
Fan, ZhijuX [Fri, 25 Jan 2019 08:52:32 +0000 (16:52 +0800)]
BaseTools:Define Macro in Inf file, the pcdvalue Can't convert

Define Macro in Inf file, the pcdvalue Can't convert

in dec:
gUefiOvmfPkgGuid.test1|"ddd"|VOID*|0x3c
in inf:
DEFINE ABC=PATH
gUefiOvmfPkgTokenSpaceGuid.test1|$(ABC)

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools/Common/Misc: move private functions
Carsey, Jaben [Thu, 24 Jan 2019 16:14:18 +0000 (00:14 +0800)]
BaseTools/Common/Misc: move private functions

These 2 functions are only used internally.  move them to the smallest
scope and use them.

Cc: Bob Feng <Bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools: Fix Pcd Array changes build report issue.
Fan, ZhijuX [Fri, 18 Jan 2019 02:32:43 +0000 (10:32 +0800)]
BaseTools: Fix Pcd Array changes build report issue.

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

The Pcd Array feature changes the Pcd Default value
data structure which is used by build report. This
patch is going to update build report to adapt that change.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoShellPkg/TftpDynamicCommand: Return proper status
Vladimir Olovyannikov via edk2-devel [Wed, 23 Jan 2019 18:26:15 +0000 (10:26 -0800)]
ShellPkg/TftpDynamicCommand: Return proper status

Tftp command always returned "SHELL_NOT_FOUND" which is treated as an
error by callers. Add missing line to clean the ShellStatus on
successful operation. If operation has failed, return the error status
if available.

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

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Reviewed-by: Songpeng Li <songpeng.li@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoMdeModulePkg VariableStandaloneMm: Add PcdEmuVariableNvModeEnable in inf
Star Zeng [Fri, 25 Jan 2019 00:58:09 +0000 (08:58 +0800)]
MdeModulePkg VariableStandaloneMm: Add PcdEmuVariableNvModeEnable in inf

It was missed in 7cd69959463ac9c761163ed8e8a93907b68e70da when rebasing
the patches after 688b2cad7b712493f2cf8b6948ab795545e13961 added
VariableStandaloneMm.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
5 years agoShellPkg/UefiShellAcpiViewCommandLib: Add support for PPTT
Krzysztof Koch [Wed, 23 Jan 2019 10:58:11 +0000 (02:58 -0800)]
ShellPkg/UefiShellAcpiViewCommandLib: Add support for PPTT

Added the acpiview parser for the PPTT table.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoCorebootPayloadPkg: Use merged variable driver for emulated NV mode
Star Zeng [Sat, 12 Jan 2019 15:11:51 +0000 (23:11 +0800)]
CorebootPayloadPkg: Use merged variable driver for emulated NV mode

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.

The real variable driver has been updated to support emulated
variable NV mode and the EmuVariableRuntimeDxe will be removed
later, so use merged variable driver for emulated NV mode.

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Benjamin You <benjamin.you@intel.com>
Tested-by: Julien Grall <julien.grall@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
5 years agoQuarkMin: Use merged variable driver for emulated NV mode
Star Zeng [Sat, 12 Jan 2019 15:01:47 +0000 (23:01 +0800)]
QuarkMin: Use merged variable driver for emulated NV mode

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.

The real variable driver has been updated to support emulated
variable NV mode and the EmuVariableRuntimeDxe will be removed
later, so use merged variable driver for emulated NV mode.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Kelly Steele <kelly.steele@intel.com>
Tested-by: Julien Grall <julien.grall@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
5 years agoBeagleBoardPkg: Use merged variable driver for emulated NV mode
Star Zeng [Sat, 12 Jan 2019 14:46:10 +0000 (22:46 +0800)]
BeagleBoardPkg: Use merged variable driver for emulated NV mode

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.

The real variable driver has been updated to support emulated
variable NV mode and the EmuVariableRuntimeDxe will be removed
later, so use merged variable driver for emulated NV mode.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Tested-by: Julien Grall <julien.grall@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
5 years agoArmVirtXen: Link VarCheckUefiLib NULL class library instance
Star Zeng [Mon, 14 Jan 2019 14:45:56 +0000 (22:45 +0800)]
ArmVirtXen: Link VarCheckUefiLib NULL class library instance

This patch is not related directly to
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.

It just makes ArmVirtXen be aligned with ArmVirtQemuXXX to
link VarCheckUefiLib NULL class library instance.

Suggested-by: Laszlo Ersek <lersek@redhat.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Julien Grall <julien.grall@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
5 years agoArmVirtXen: Use merged variable driver for emulated NV mode
Star Zeng [Sat, 12 Jan 2019 14:44:52 +0000 (22:44 +0800)]
ArmVirtXen: Use merged variable driver for emulated NV mode

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.

The real variable driver has been updated to support emulated
variable NV mode and the EmuVariableRuntimeDxe will be removed
later, so use merged variable driver for emulated NV mode.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Julien Grall <julien.grall@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
5 years agoMdeModulePkg VariablePei: Don't check BOOT_IN_RECOVERY_MODE
Star Zeng [Sat, 12 Jan 2019 14:31:06 +0000 (22:31 +0800)]
MdeModulePkg VariablePei: Don't check BOOT_IN_RECOVERY_MODE

Don't check BOOT_IN_RECOVERY_MODE, but check PcdEmuVariableNvModeEnable
which platform can configure flexibly.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Tested-by: Julien Grall <julien.grall@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
5 years agoMdeModulePkg Variable: Add emulated variable NV mode support
Star Zeng [Mon, 14 Jan 2019 14:27:15 +0000 (22:27 +0800)]
MdeModulePkg Variable: Add emulated variable NV mode support

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.

Add emulated variable NV mode support in real variable driver.
Platform can configure PcdEmuVariableNvModeEnable statically
(build time) or dynamically (boot time) to support emulated
variable NV mode.

If PcdEmuVariableNvModeEnable is configured to dynamic, its
value should be set before Variable driver starts to work,
otherwise default value will take effect.

Then EmuVariableRuntimeDxe could be removed, the removal of
EmuVariableRuntimeDxe will be done after platforms are migrated
to use the merged variable driver.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Tested-by: Julien Grall <julien.grall@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
5 years agoMdeModulePkg: Refine description a little for PcdEmuVariableNvStoreReserved
Star Zeng [Tue, 15 Jan 2019 06:26:54 +0000 (14:26 +0800)]
MdeModulePkg: Refine description a little for PcdEmuVariableNvStoreReserved

This patch is not related directly to
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.

PcdEmuVariableNvStoreReserved actually defines the base address of
reserved memory range.

This patch refines description a little for PcdEmuVariableNvStoreReserved.

Suggested-by: Jian J Wang <jian.j.wang@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Tested-by: Julien Grall <julien.grall@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
5 years agoMdeModulePkg: Add PcdEmuVariableNvModeEnable in dec
Star Zeng [Sat, 12 Jan 2019 08:10:47 +0000 (16:10 +0800)]
MdeModulePkg: Add PcdEmuVariableNvModeEnable in dec

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.

Add PcdEmuVariableNvModeEnable (support both static and
dynamic) to indicate if Variable driver will enable
emulated variable NV mode.

This patch prepares for adding emulated variable NV mode
support in VariableRuntimeDxe.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Tested-by: Julien Grall <julien.grall@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
5 years agoMdeModulePkg Variable: type case VolatileBase to UINTN directly
Star Zeng [Mon, 14 Jan 2019 14:15:08 +0000 (22:15 +0800)]
MdeModulePkg Variable: type case VolatileBase to UINTN directly

Simplify
((UINTN) ((UINT8 *) VolatileBase + VolatileBase->Size))
to
((UINTN) VolatileBase + VolatileBase->Size)

This patch prepares for adding emulated variable NV mode
support in VariableRuntimeDxe.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Julien Grall <julien.grall@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
5 years agoMdeModulePkg Variable: Remove CacheOffset in UpdateVariable()
Star Zeng [Sat, 12 Jan 2019 08:31:51 +0000 (16:31 +0800)]
MdeModulePkg Variable: Remove CacheOffset in UpdateVariable()

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.

CacheOffset could be removed in UpdateVariable() after
//
// update the memory copy of Flash region.
//
CopyMem (
  (UINT8 *)mNvVariableCache + CacheOffset,
  (UINT8 *)NextVariable, VarSize
   );

is moved to be before mVariableModuleGlobal->NonVolatileLastVariableOffset
value is updated, like right before
mVariableModuleGlobal->NonVolatileLastVariableOffset +=
  HEADER_ALIGN (VarSize);

Except for the movement above, the patch also capitalizes the first
character of "update the memory copy of Flash region".

This patch prepares for adding emulated variable NV mode
support in VariableRuntimeDxe.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Julien Grall <julien.grall@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
5 years agoMdeModulePkg Variable: Abstract VariableWriteServiceInitializeDxe/Smm
Star Zeng [Sat, 12 Jan 2019 08:03:36 +0000 (16:03 +0800)]
MdeModulePkg Variable: Abstract VariableWriteServiceInitializeDxe/Smm

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.

Abstract VariableWriteServiceInitializeDxe/Smm from
FtwNotificationEvent/SmmFtwNotificationEvent, then
VariableWriteServiceInitializeDxe/Smm could be not aware
the NV storage is real or emulated.

This patch prepares for adding emulated variable NV mode
support in VariableRuntimeDxe.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Tested-by: Julien Grall <julien.grall@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
5 years agoMdeModulePkg Variable: Not get NV PCD in VariableWriteServiceInitialize
Star Zeng [Sat, 12 Jan 2019 07:40:19 +0000 (15:40 +0800)]
MdeModulePkg Variable: Not get NV PCD in VariableWriteServiceInitialize

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.

Add macro NV_STORAGE_VARIABLE_BASE.
Not get NV PCD in VariableWriteServiceInitialize, but in
FtwNotificationEvent/SmmFtwNotificationEvent, then
VariableWriteServiceInitialize could be not aware the NV
storage is real or emulated.

This patch prepares for adding emulated variable NV mode
support in VariableRuntimeDxe.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Tested-by: Julien Grall <julien.grall@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
5 years agoMdeModulePkg Variable: Move "extern XXX" to Variable.h
Star Zeng [Tue, 15 Jan 2019 07:01:58 +0000 (15:01 +0800)]
MdeModulePkg Variable: Move "extern XXX" to Variable.h

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.

Move "extern XXX" to Variable.h from VariableDxe.c/VariableSmm.c.

This patch prepares for adding emulated variable NV mode
support in VariableRuntimeDxe.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Tested-by: Julien Grall <julien.grall@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
5 years agoMdeModulePkg Variable: Abstract InitRealNonVolatileVariableStore
Star Zeng [Sat, 12 Jan 2019 07:03:36 +0000 (15:03 +0800)]
MdeModulePkg Variable: Abstract InitRealNonVolatileVariableStore

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.

Abstract InitRealNonVolatileVariableStore from
InitNonVolatileVariableStore.

This patch prepares for adding emulated variable NV mode
support in VariableRuntimeDxe.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Tested-by: Julien Grall <julien.grall@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
5 years agoMdeModulePkg Variable: Add some missing changes for 9b18845
Star Zeng [Mon, 7 Aug 2017 07:31:01 +0000 (15:31 +0800)]
MdeModulePkg Variable: Add some missing changes for 9b18845

To improve performance 9b18845a4b4cd1d2cf004cbc1cadf8a93ccb37ea
changed the code which read from physical MMIO address to read
from memory cache, but it missed some places that could be updated
the same away for performance optimization.

The patch updates these places as supplementary.

I found them when updating code for
https://bugzilla.tianocore.org/show_bug.cgi?id=1323
Merge EmuVariable and Real variable driver.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Tested-by: Julien Grall <julien.grall@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
5 years agoNetworkPkg/DnsDxe: Remove unnecessary NULL pointer check.
Jiaxin Wu [Wed, 16 Jan 2019 02:56:19 +0000 (10:56 +0800)]
NetworkPkg/DnsDxe: Remove unnecessary NULL pointer check.

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

Since the value of ItemCache4/ItemCache6 is retrieved from the list
Entry, it can't be the NULL pointer, so just remove the unnecessary
check.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Hao A <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Wu Hao A <hao.a.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
5 years agoNetworkPkg/IScsiDxe: Remove unnecessary NULL pointer check.
Jiaxin Wu [Wed, 16 Jan 2019 02:54:42 +0000 (10:54 +0800)]
NetworkPkg/IScsiDxe: Remove unnecessary NULL pointer check.

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

Since the value of AttemptConfigData is retrieved from the list
Entry, it can't be the NULL pointer, so just remove the unnecessary
check.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Hao A <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Wu Hao A <hao.a.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
5 years agoMdeModulePkg/Dhcp4Dxe: Remove unnecessary NULL pointer check.
Jiaxin Wu [Thu, 8 Nov 2018 07:30:16 +0000 (15:30 +0800)]
MdeModulePkg/Dhcp4Dxe: Remove unnecessary NULL pointer check.

v3: Add the instance token check.

v2: The DHCP Instance might be destroyed in PxeDhcpDone. So,
we need safe-delete.

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

Since the value of Instance is retrieved from the list Entry,
it can't be the NULL pointer, so just remove the unnecessary
check.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Hao A <hao.a.wu@intel.com>
Cc: Gao Liming <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Wu Hao A <hao.a.wu@intel.com>
5 years agoArmPkg: delete unused ArmTrustZoneSmc.h
Leif Lindholm [Mon, 21 Jan 2019 13:03:14 +0000 (13:03 +0000)]
ArmPkg: delete unused ArmTrustZoneSmc.h

ArmPkg/Include/IndustryStandard/ArmTrustZoneSmc.h contains definitions
contradicting the SMC Calling Convention (ARM DEN0028B).

It also has no users in public trees. So delete before it can cause
damage.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
5 years agoStandaloneMmPkg/StandaloneMmCoreEntryPoint: permit the use of TE images
Ard Biesheuvel [Wed, 16 Jan 2019 20:22:35 +0000 (21:22 +0100)]
StandaloneMmPkg/StandaloneMmCoreEntryPoint: permit the use of TE images

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 Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Achin Gupta <achin.gupta@arm.com>
5 years agoStandaloneMmPkg/Core/Dispatcher: don't copy dispatched image twice
Ard Biesheuvel [Wed, 16 Jan 2019 20:22:34 +0000 (21:22 +0100)]
StandaloneMmPkg/Core/Dispatcher: don't copy dispatched image twice

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 <ard.biesheuvel@linaro.org>
Reviewed-by: Achin Gupta <achin.gupta@arm.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
5 years agoStandaloneMmPkg/StandaloneMmPeCoffExtraActionLib: ignore runtime attribute
Ard Biesheuvel [Wed, 16 Jan 2019 20:22:33 +0000 (21:22 +0100)]
StandaloneMmPkg/StandaloneMmPeCoffExtraActionLib: ignore runtime attribute

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.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Achin Gupta <achin.gupta@arm.com>
5 years agoStandaloneMmPkg/StandaloneMmCoreEntryPoint: remove bogus ASSERT_EFI_ERROR()s
Ard Biesheuvel [Wed, 16 Jan 2019 20:22:32 +0000 (21:22 +0100)]
StandaloneMmPkg/StandaloneMmCoreEntryPoint: remove bogus ASSERT_EFI_ERROR()s

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 Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Reviewed-by: Achin Gupta <achin.gupta@arm.com>
5 years agoStandaloneMmPkg/StandaloneMmCoreEntryPoint: use %a modifier for ASCII strings
Ard Biesheuvel [Wed, 16 Jan 2019 20:22:31 +0000 (21:22 +0100)]
StandaloneMmPkg/StandaloneMmCoreEntryPoint: use %a modifier for ASCII strings

PE/COFF section names are ASCII strings so use %a not %s.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Reviewed-by: Achin Gupta <achin.gupta@arm.com>
5 years agoStandaloneMmPkg/StandaloneMmCpu: fix typo Standlone -> Standalone
Ard Biesheuvel [Wed, 16 Jan 2019 20:22:29 +0000 (21:22 +0100)]
StandaloneMmPkg/StandaloneMmCpu: fix typo Standlone -> Standalone

Fix a couple of occurrences of typo Standlone -> Standalone

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Reviewed-by: Achin Gupta <achin.gupta@arm.com>
5 years agoStandaloneMmPkg/StandaloneMmCoreHobLib: restrict to MM_CORE_STANDALONE
Ard Biesheuvel [Wed, 16 Jan 2019 20:22:28 +0000 (21:22 +0100)]
StandaloneMmPkg/StandaloneMmCoreHobLib: restrict to MM_CORE_STANDALONE

Remove MM_STANDALONE from the list of permitted modules for this library.
It should only be used by the standalone MM core.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jagadeesh Ujja <jagadeesh.ujja@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Achin Gupta <achin.gupta@arm.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
5 years agoStandaloneMmPkg: add MM_STANDALONE MemoryAllocationLib implementation
Ard Biesheuvel [Wed, 16 Jan 2019 20:22:27 +0000 (21:22 +0100)]
StandaloneMmPkg: add MM_STANDALONE MemoryAllocationLib implementation

This MemoryAllocationLib code is based on the staging implementation of
StandaloneMmPkg, with the following changes:
- use correct MODULE_TYPE
- include MmServicesTableLib instead of declaring gMmst directly
- update code comments referring to the MM core

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jagadeesh Ujja <jagadeesh.ujja@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Achin Gupta <achin.gupta@arm.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
5 years agoStandaloneMmPkg: add HobLib implementation for MM_STANDALONE modules
Ard Biesheuvel [Wed, 16 Jan 2019 20:22:26 +0000 (21:22 +0100)]
StandaloneMmPkg: add HobLib implementation for MM_STANDALONE modules

This HobLib code is based on the staging implementation of
StandaloneMmPkg, with the following changes:
- drop the unused AArch64/StandaloneMmCoreHobLibInternal.c source file
- remove hack from HobLibConstructor()
- update code comments referring the MM core

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jagadeesh Ujja <jagadeesh.ujja@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Achin Gupta <achin.gupta@arm.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
5 years agoMdePkg/UefiDevicePathLib: permit use by MM_STANDALONE modules
Ard Biesheuvel [Wed, 16 Jan 2019 21:22:21 +0000 (22:22 +0100)]
MdePkg/UefiDevicePathLib: permit use by MM_STANDALONE modules

Add MM_STANDALONE to the list of module types that are permitted to
link to this library.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdeModulePkg/VarCheckUefiLib: permit use by MM_STANDALONE modules
Ard Biesheuvel [Wed, 16 Jan 2019 21:22:20 +0000 (22:22 +0100)]
MdeModulePkg/VarCheckUefiLib: permit use by MM_STANDALONE modules

Permit CheckUefiLib to be used by MM_STANDALONE modules. Since this
library has a constructor, change the library's module type into
BASE so its constructor prototype is compatible with MM_STANDALONE
as well.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoSecurityPkg/PlatformSecureLibNull: permit use by MM_STANDALONE modules
Ard Biesheuvel [Wed, 16 Jan 2019 21:22:19 +0000 (22:22 +0100)]
SecurityPkg/PlatformSecureLibNull: permit use by MM_STANDALONE modules

Add MM_STANDALONE to the list of module types that are permitted to
link to this library. Also, since the constructor prototype is
different between MM_STANDALONE and DXE_DRIVER type libraries,
convert the library into BASE type.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
5 years agoCryptoPkg/SmmCryptLib: permit use by MM_STANDALONE modules
Ard Biesheuvel [Wed, 16 Jan 2019 21:22:18 +0000 (22:22 +0100)]
CryptoPkg/SmmCryptLib: permit use by MM_STANDALONE modules

Permit SmmCryptLib to be used by MM_STANDALONE modules

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
5 years agoBaseTools/GenFds/Capsule: move function logic
Carsey, Jaben [Thu, 17 Jan 2019 15:35:07 +0000 (23:35 +0800)]
BaseTools/GenFds/Capsule: move function logic

Move PackRegistryFormatGuid logic from Common.Misc to this file.
There were no other consumers of the function.
As it is one line, just replace the logic without the separate function.

v2 - change to fix the import statement

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools/AutoGen: move functions
Carsey, Jaben [Thu, 10 Jan 2019 18:39:48 +0000 (02:39 +0800)]
BaseTools/AutoGen: move functions

Move SplitOption and ConvertStringToByteArray from
Common.Misc to this file.
There were no other consumers of the functions.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools/DscBuildData: move function
Carsey, Jaben [Thu, 10 Jan 2019 18:39:47 +0000 (02:39 +0800)]
BaseTools/DscBuildData: move function

Move IsFieldValuieAnArray from Common.Misc to this file.
There were no other consumers of the function.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools/Workspace/InfBuildData: move functions
Carsey, Jaben [Thu, 10 Jan 2019 18:39:46 +0000 (02:39 +0800)]
BaseTools/Workspace/InfBuildData: move functions

Move ProtocolValue and PpiValue from Common.Misc to this file.
There were no other consumers of these 2 functions.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools:The BuildOptionPcd value is wrong
Fan, ZhijuX [Tue, 15 Jan 2019 09:13:59 +0000 (17:13 +0800)]
BaseTools:The BuildOptionPcd value is wrong

In GenFds.py, Due to the second assignment, the value is wrong
Its value should a list, not a string.and this line is not required

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools: Fix build report issue.
Feng, Bob C [Wed, 16 Jan 2019 10:48:46 +0000 (18:48 +0800)]
BaseTools: Fix build report issue.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1472
The Pcd Array feature changes the Pcd Default value
data structure which is used by build report. This
patch is going to update build report to adapt that change.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/build/build: refactor and move functions
Carsey, Jaben [Thu, 10 Jan 2019 18:39:45 +0000 (02:39 +0800)]
BaseTools/build/build: refactor and move functions

Move DataDump and DataRestore from Common.Misc to this file.
There were no other consumers of these 2 functions.

Import threading since that module is used in build.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools:build break if the Path contains SingleFile.Ext
Fan, ZhijuX [Tue, 15 Jan 2019 09:12:38 +0000 (17:12 +0800)]
BaseTools:build break if the Path contains SingleFile.Ext

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

if SingleFile.Path = "/foo/bar.Sap/yada/source.S" and
SingleFile.Ext = ".S". Then key would end up "/foo/bar"
instead of "/foo/bar.Sap/yada/source" as intended.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools: Fix incorrect formatting of GenFds command dictionary
Felix Polyudov [Wed, 16 Jan 2019 16:51:16 +0000 (00:51 +0800)]
BaseTools: Fix incorrect formatting of GenFds command dictionary

GenFdsCommand returned dictionary with elements that
are not compatible with GenFdsApi.
As a result the following options were not processed by GenFdsApi:
-v, -q, -d, --genfds-multi-thread, --ignore-sources
The issue is introduced by commit b3497bad1221704a5dbc5da0b10f42625f1ad2ed.

V2: Remove EFI_SOURCE references

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Felix Polyudov <felixp@ami.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools:Build fail when PCD use in the [DEPEX] section of INF files
Fan, ZhijuX [Tue, 15 Jan 2019 09:11:18 +0000 (17:11 +0800)]
BaseTools:Build fail when PCD use in the [DEPEX] section of INF files

Update _FixedPcdVoidTypeDict to FixedVoidTypePcds
'_FixedPcdVoidTypeDict' no longer exists because edk2 version (b23414f6).
'ModuleAutoGen' object has no attribute '_FixedPcdVoidTypeDict'.
Build fail when PCD use in the [DEPEX] section of INF files

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoIntelFsp2Pkg: Remove unused keyword in new PPI header
Chasel, Chiu [Mon, 21 Jan 2019 05:43:58 +0000 (13:43 +0800)]
IntelFsp2Pkg: Remove unused keyword in new PPI header

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

There was unused keyword added in FspmArchConfigPpi.h
header block and should be removed.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdePkg/BasePeCoffLib: Correct the address of RelocBaseEnd
Dandan Bi [Thu, 17 Jan 2019 07:25:26 +0000 (15:25 +0800)]
MdePkg/BasePeCoffLib: Correct the address of RelocBaseEnd

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

When calculating the address of RelocBaseEnd,
the RelocBase address is ImageBase + RelocDir->VirtualAddress,
the size of RelocDir is RelocDir->Size.
So the RelocBaseEnd address is:
ImageBase + RelocDir->VirtualAddress + RelocDir->Size - 1
not
ImageBase + RelocDir->VirtualAddress + RelocDir->Size

This patch is to fix this issue when call PeCoffLoaderImageAddress
function to calculate the address of RelocBaseEnd.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Tested-by: Gary Lin <glin@suse.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Allow empty value for HiiPcd in Dsc
Feng, Bob C [Wed, 16 Jan 2019 11:12:00 +0000 (19:12 +0800)]
BaseTools: Allow empty value for HiiPcd in Dsc

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

DEC file defines PCD default value and PCD supported type.
DSC can configure PCD type and value.
If the value is same to default value in DEC file,
DSC can only configure PCD type and leave empty for value.
This usage supports all type PCD except for DynamicHii type.
So, DynamicHii PCD should support this usage. Below is one example in DSC.

for example,
[PcdsDynamicHii.common.DEFAULT]
PcdPkgTokenSpaceGuid.PcdCName|L"VarName"|gVarGuid|0x00||NV,BS

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Remove EDK_SOURCE keyword from Inf Parser.
Feng, Bob C [Tue, 15 Jan 2019 10:14:04 +0000 (18:14 +0800)]
BaseTools: Remove EDK_SOURCE keyword from Inf Parser.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1350
Remove unused EDK_SOURCE keyword from Inf Parser.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Remove EDK_SOURCE keyword from GenFds tool.
Feng, Bob C [Tue, 15 Jan 2019 10:12:32 +0000 (18:12 +0800)]
BaseTools: Remove EDK_SOURCE keyword from GenFds tool.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1350
Remove unused EDK_SOURCE keyword from GenFds tool.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Remove EDK_SOURCE keyword from ECC Tool
Feng, Bob C [Tue, 15 Jan 2019 09:43:11 +0000 (17:43 +0800)]
BaseTools: Remove EDK_SOURCE keyword from ECC Tool

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1350
Remove EDK_SOURCE keyword from ECC Tool.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoArmPkg/DefaultExceptionHandlerLib: add missing UefiLib include
Ard Biesheuvel [Wed, 16 Jan 2019 20:50:59 +0000 (21:50 +0100)]
ArmPkg/DefaultExceptionHandlerLib: add missing UefiLib include

Commit 31f5388006fc ("ArmPkg/DefaultExceptionHandlerLib: use console
if available") added calls to AsciiPrint() to the default exception
handler code, but the ARM version did not include UefiLib.h yet
(even though the .INF declares it unconditionally), resulting in
build breakage. So add the missing include.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoIntelFsp2Pkg: Add FspmArchConfigPpi to support Dispatch mode
Chasel, Chiu [Fri, 7 Dec 2018 13:18:42 +0000 (21:18 +0800)]
IntelFsp2Pkg: Add FspmArchConfigPpi to support Dispatch mode

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

In Dispatch mode FSP may consume PPI directly so creating
FSPM_ARCH_CONFIG_PPI to align with FSPM_ARCH_UPD.
Also Keeps new structure size 8 bytes alignment as other
structures.

Test: Verified on internal platform to boot with this PPI
installed successfully.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoEmbeddedPkg/NorFlashInfoLib: convert to BASE library
Ard Biesheuvel [Wed, 2 Jan 2019 13:00:44 +0000 (14:00 +0100)]
EmbeddedPkg/NorFlashInfoLib: convert to BASE library

The library's MODULE_TYPE and the module type restrictions it
defines are needlessly strict. Just change the library to BASE
type and drop the restrictions entirely. Also, drop a bogus
library dependency on DxeServicesLib.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoArmPkg/DefaultExceptionHandlerLib: use console if available
Ard Biesheuvel [Thu, 20 Dec 2018 17:31:04 +0000 (18:31 +0100)]
ArmPkg/DefaultExceptionHandlerLib: use console if available

Print the minimal 'exception occurred' message to the console as well
as to the serial port if the console is available. This makes such
messages visible on systems where the console is graphical and the
serial is not connected.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
5 years agoArmPkg/DefaultExceptionHandlerLib: drop BASE variant
Ard Biesheuvel [Thu, 20 Dec 2018 17:31:03 +0000 (18:31 +0100)]
ArmPkg/DefaultExceptionHandlerLib: drop BASE variant

Drop the redundant BASE variant, which is no longer used anywhere
now that DebugAgentSymbolsBaseLib no longer incorporates a vector
table and exception handling.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoArmVirtPkg: drop reference to ArmPkg/DefaultExceptionHandlerLibBase
Ard Biesheuvel [Tue, 15 Jan 2019 08:15:48 +0000 (09:15 +0100)]
ArmVirtPkg: drop reference to ArmPkg/DefaultExceptionHandlerLibBase

Drop the reference to ArmPkg/DefaultExceptionHandlerLibBase, which
is no longer used anywhere now that DebugAgentSymbolsBaseLib no
longer incorporates a vector table and exception handling.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoArmPkg/DefaultExceptionHandlerLib: declare the permitted usage context
Ard Biesheuvel [Thu, 20 Dec 2018 17:31:02 +0000 (18:31 +0100)]
ArmPkg/DefaultExceptionHandlerLib: declare the permitted usage context

Declare that this library is only usable in the context of DXE core
or a DXE driver. Set the MODULE_TYPE to BASE: this only affects the
prototype of the constructor (if present) but doesn't actually
restrict the usage context otherwise.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoArmPkg/DebugAgentSymbolsBaseLib: remove exception handling
Ard Biesheuvel [Thu, 20 Dec 2018 17:31:01 +0000 (18:31 +0100)]
ArmPkg/DebugAgentSymbolsBaseLib: remove exception handling

DebugAgentSymbolsBaseLib is an optional library that is in charge
of extracting debug headers from SEC and PEI_CORE images in memory
so the filename and the offset in memory can be reported via the
UART, allowing a developer to load debugging symbols into his
debugger.

Interestingly enough, DebugAgentSymbolsBaseLib is also in charge of
exception handling before this duty is taken over by either the PEI
core, or the CPU DXE driver when running under PrePi.

Since exceptions are not actually handled at all on AArch64, and simply
routed to the DefaultExceptionHandlerLib (for which a special version
has been created to be usable this early), let's get rid of this
dubious functionality altogether.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoMdeModulePkg/MdeModulePkg.dsc: add MM_STANDALONE FTW and variable modules
Ard Biesheuvel [Mon, 14 Jan 2019 12:19:08 +0000 (13:19 +0100)]
MdeModulePkg/MdeModulePkg.dsc: add MM_STANDALONE FTW and variable modules

For build testing coverage, add the newly introduced MM_STANDALONE
versions of the fault tolerant write (FTW) and variable runtime
driver to MdeModulePkg.dsc. Note that the resulting binaries will
not be able to run, since they rely on dummy implementations of
MemoryAllocationLib and HobLib.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>.
5 years agoMdeModulePkg/VarCheckLib: add MM_STANDALONE support
Ard Biesheuvel [Mon, 14 Jan 2019 12:18:49 +0000 (13:18 +0100)]
MdeModulePkg/VarCheckLib: add MM_STANDALONE support

Add MM_STANDALONE to the list of permitted module types of the
VarCheckLib library implementation.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>.
5 years agoMdeModulePkg/AuthVariableLibNull: add MM_STANDALONE support
Ard Biesheuvel [Mon, 14 Jan 2019 12:17:59 +0000 (13:17 +0100)]
MdeModulePkg/AuthVariableLibNull: add MM_STANDALONE support

Add MM_STANDALONE to the list of permitted module types of the
AuthVariableLibNull library implementation.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>.
5 years agoMdeModulePkg/MdeModulePkg/dsc: move DxeDebugSupportDxe to x86 only section
Ard Biesheuvel [Mon, 14 Jan 2019 12:16:23 +0000 (13:16 +0100)]
MdeModulePkg/MdeModulePkg/dsc: move DxeDebugSupportDxe to x86 only section

MdeModulePkg/Universal/DebugSupportDxe/DebugSupportDxe.inf does not
build for AARCH64 since it does not provide the needed PlDebugSupport.h
header. So move the module to a x86 only section.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>.
5 years agoMdeModulePkg: implement NULL instance of MemoryAllocationLib library class
Ard Biesheuvel [Mon, 14 Jan 2019 12:11:35 +0000 (13:11 +0100)]
MdeModulePkg: implement NULL instance of MemoryAllocationLib library class

In order to permit MM_STANDALONE modules to be built without relying
on StandaloneMmPkg, provide a BASE type NULL implementation of
MemoryAllocationLib.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>.
5 years agoMdeModulePkg: implement NULL instance of HobLib library class
Ard Biesheuvel [Mon, 14 Jan 2019 12:09:04 +0000 (13:09 +0100)]
MdeModulePkg: implement NULL instance of HobLib library class

In order to permit MM_STANDALONE modules to be built without relying
on StandaloneMmPkg, provide a BASE type NULL implementation of HobLib.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>.
5 years agoMdePkg: add MM_STANDALONE implementation of MmServicesTableLib
Ard Biesheuvel [Mon, 14 Jan 2019 12:06:01 +0000 (13:06 +0100)]
MdePkg: add MM_STANDALONE implementation of MmServicesTableLib

The newly introduced generic MmServicesTableLib can be implemented
for traditional SMM (as we did already), but MM_STANDALONE drivers
require an implementation that is based on standalone MM.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg: introduce standalone MM entry point library implementation
Ard Biesheuvel [Mon, 14 Jan 2019 11:56:33 +0000 (12:56 +0100)]
MdePkg: introduce standalone MM entry point library implementation

Add an implementation of the StandaloneMmDriverEntryPoint library
class.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg: introduce standalone MM entry point library class
Ard Biesheuvel [Mon, 14 Jan 2019 11:54:26 +0000 (12:54 +0100)]
MdePkg: introduce standalone MM entry point library class

Add the library interface for the standalone MM driver entry point.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdeModulePkg/VariableRuntimeDxe: implement standalone MM version
Ard Biesheuvel [Thu, 3 Jan 2019 18:28:25 +0000 (19:28 +0100)]
MdeModulePkg/VariableRuntimeDxe: implement standalone MM version

Reuse most of the existing code to implement a variable runtime
driver that will be able to execute in the context of standalone
MM.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/VariableRuntimeDxe: factor out boot service accesses
Ard Biesheuvel [Thu, 3 Jan 2019 18:28:24 +0000 (19:28 +0100)]
MdeModulePkg/VariableRuntimeDxe: factor out boot service accesses

In preparation of providing a standalone MM based variable runtime
driver, move the existing SMM driver to the new MM services table,
and factor out some pieces that are specific to the traditional
driver, mainly related to the use of UEFI boot services, which are
not accessible to standalone MM drivers.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/FaultTolerantWriteDxe: implement standalone MM version
Ard Biesheuvel [Thu, 3 Jan 2019 18:28:23 +0000 (19:28 +0100)]
MdeModulePkg/FaultTolerantWriteDxe: implement standalone MM version

Implement a new version of the fault tolerant write driver that can
be used in the context of a standalone MM implementation.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/FaultTolerantWriteDxe: factor out boot service accesses
Ard Biesheuvel [Thu, 3 Jan 2019 18:28:22 +0000 (19:28 +0100)]
MdeModulePkg/FaultTolerantWriteDxe: factor out boot service accesses

In preparation of providing a standalone MM based FTW driver, move
the existing SMM driver to the new MM services table, and factor out
some pieces that are specific to the traditional driver, mainly
related to the use of UEFI boot services, which are not accessible
to standalone MM drivers.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoVlv2TbltDevicePkg: add MmServicesTableLib resolution
Ard Biesheuvel [Wed, 9 Jan 2019 15:10:05 +0000 (16:10 +0100)]
Vlv2TbltDevicePkg: add MmServicesTableLib resolution

The SMM based FTW and variable drivers are going to depend on
MmServicesTableLib after a subsequent patch, so add a resolution
for it to various Vlv2TbltDevicePkg .dsc files.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
5 years agoQuarkPlatformPkg: add MmServicesTableLib resolution
Ard Biesheuvel [Wed, 9 Jan 2019 15:04:22 +0000 (16:04 +0100)]
QuarkPlatformPkg: add MmServicesTableLib resolution

The SMM based FTW and variable drivers are going to depend on
MmServicesTableLib after a subsequent patch, so add a resolution
for it to various QuarkPlatformPkg .dsc files.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoOvmfPkg: add MmServicesTableLib resolution
Ard Biesheuvel [Wed, 9 Jan 2019 15:03:03 +0000 (16:03 +0100)]
OvmfPkg: add MmServicesTableLib resolution

The SMM based FTW and variable drivers are going to depend on
MmServicesTableLib after a subsequent patch, so add a resolution
for it to various OvmfPkg .dsc files.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>