]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
5 years agoBaseTools: replace long by int
Yunhua Feng [Mon, 3 Dec 2018 02:29:40 +0000 (10:29 +0800)]
BaseTools: replace long by int

replace long by int
Because the long() was not exist in Python3

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools: Remove unnecessary super function
Yunhua Feng [Mon, 3 Dec 2018 02:41:08 +0000 (10:41 +0800)]
BaseTools: Remove unnecessary super function

Remove unnecessary super function

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools: nametuple not have verbose parameter in python3
Yunhua Feng [Fri, 30 Nov 2018 01:36:07 +0000 (09:36 +0800)]
BaseTools: nametuple not have verbose parameter in python3

nametuple not have verbose parameter in python3

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools: use OrderedDict instead of sdict
Feng, Bob C [Mon, 28 Jan 2019 07:03:56 +0000 (15:03 +0800)]
BaseTools: use OrderedDict instead of sdict

use OrderedDict instead of sdict, and delete sdict

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools: replace get_bytes_le() to bytes_le
Zhijux Fan [Wed, 28 Nov 2018 03:12:37 +0000 (11:12 +0800)]
BaseTools: replace get_bytes_le() to bytes_le

UUID does not have the get_bytes_le() in python3

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools: Rename iteritems to items
Zhijux Fan [Wed, 28 Nov 2018 01:58:55 +0000 (09:58 +0800)]
BaseTools: Rename iteritems to items

replace the list iteritems by items in Python3.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools:use iterate list to replace the itertools
Zhijux Fan [Thu, 6 Dec 2018 01:09:36 +0000 (09:09 +0800)]
BaseTools:use iterate list to replace the itertools

itertools.imap() replace map(), itertools.ifilter() replace filter

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTool:Rename xrange() to range()
Zhijux Fan [Wed, 28 Nov 2018 01:26:06 +0000 (09:26 +0800)]
BaseTool:Rename xrange() to range()

Because the xrange() was not exist in Python3

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoCryptoPkg/BaseCryptLib: split CryptPkcs7Verify.c on behalf of runtime
Jian J Wang [Mon, 28 Jan 2019 07:34:47 +0000 (15:34 +0800)]
CryptoPkg/BaseCryptLib: split CryptPkcs7Verify.c on behalf of runtime

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

Pkcs7GetAttachedContent() implementation in current CryptPkcs7Verify.c
is actually shared by RuntimeCryptLib.inf, SmmCryptLib.inf and
BaseCryptLib.inf, which are not correct since there's no use scenario
for runtime and AllocatePool() used in this method can only be called
in boot time.

This patch fix this issue by splitting file CryptPkcs7Verify.c into 3 parts.

  CryptPkcs7VerifyCommon.c  (shared among Base, SMM, Runtime)
  CryptPkcs7VerifyBase.c    (shared between Base, SMM)
  CryptPkcs7VerifyRuntime.c (for Runtime only)

CryptPkcs7VerifyBase.c will have original implementation of
Pkcs7GetAttachedContent() as CryptPkcs7Verify.c. CryptPkcs7VerifyRuntime.c
provide a NULL version of Pkcs7GetAttachedContent().

No functionality and interface change is involved in this patch.

Cc: Ting Ye <ting.ye@intel.com>
Cc: Qin Long <qin.long@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Ting Ye <ting.ye@intel.com>
5 years agoMdePkg/UefiLib: Add a new API GetVariable3
Bret Barkelew [Fri, 4 Jan 2019 02:22:12 +0000 (10:22 +0800)]
MdePkg/UefiLib: Add a new API GetVariable3

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1396
Add a new API GetVariable3, which can return the attributes of a variable during reading it.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jiansong Xu <jiansongx.xu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/DevicePath: Add a checking step
Mike Turner [Tue, 11 Dec 2018 06:10:33 +0000 (14:10 +0800)]
BaseTools/DevicePath: Add a checking step

Add a checking step in DevicePathUtilities.c
to verify DevicePath.
https://bugzilla.tianocore.org/show_bug.cgi?id=1372

v2: Remove ASSERT() and the redundant checking step.
    Update related description.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg/UefiDevicePathLib: Add a checking step
Mike Turner [Tue, 11 Dec 2018 06:14:10 +0000 (14:14 +0800)]
MdePkg/UefiDevicePathLib: Add a checking step

Add a checking step in DevicePathUtilities.c to verify DevicePath.
https://bugzilla.tianocore.org/show_bug.cgi?id=1372

v2: Remove ASSERT() and the redundant checking step. Update related
    description.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoShellPkg/UefiShellLib: Use BaseLib api CharToUpper
Shenglei Zhang [Wed, 30 Jan 2019 08:34:57 +0000 (16:34 +0800)]
ShellPkg/UefiShellLib: Use BaseLib api CharToUpper

Substitute InternalShellCharToUpper with CharToUpper which is a public
function with the same effect.
Remove the implement of InternalShellCharToUpper.
https://bugzilla.tianocore.org/show_bug.cgi?id=1369

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoShellPkg/Shell: Use BaseLib api CharToUpper
Shenglei Zhang [Wed, 30 Jan 2019 08:34:50 +0000 (16:34 +0800)]
ShellPkg/Shell: Use BaseLib api CharToUpper

Substitute InternalShellCharToUpper with a public function
CharToUpper which has the same function.
Remove the implement of InternalShellCharToUpper.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoMdeModulePkg/DxeHttpLib: Use BaseLib api AsciiCharToUpper
Shenglei Zhang [Wed, 30 Jan 2019 08:34:36 +0000 (16:34 +0800)]
MdeModulePkg/DxeHttpLib: Use BaseLib api AsciiCharToUpper

Substitute HttpIoCharToUpper with AsciiCharToUpper which is a public function
with the same effect. And remove the implement of HttpIoCharToUpper.
https://bugzilla.tianocore.org/show_bug.cgi?id=1369

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
5 years agoMdeModulePkg/EbcDebugger: Use AsciiCharToUpper and CharToUpper
Shenglei Zhang [Tue, 25 Dec 2018 03:32:57 +0000 (11:32 +0800)]
MdeModulePkg/EbcDebugger: Use AsciiCharToUpper and CharToUpper

InternalUnicodeToUpper and InternalAsciiToUpper are internal functions,
so they are substituted by public functions AsciiCharToUpper and CharToUpper.
And their implements are removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1369

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
5 years agoMdePkg/BaseLib: Remove definitions of two functions
Shenglei Zhang [Wed, 30 Jan 2019 08:34:13 +0000 (16:34 +0800)]
MdePkg/BaseLib: Remove definitions of two functions

InternalCharToUpper and InternalBaseLibAsciiToUpper are internal functions
and now we will introduce public functions that have the same effects.
So I remove their definitions in BaseLibInternals.h.
https://bugzilla.tianocore.org/show_bug.cgi?id=1369

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: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
5 years agoMdePkg/BaseLib: Introduce CharToUpper and AsciiCharToUpper publicly
Mike Turner [Wed, 30 Jan 2019 08:33:49 +0000 (16:33 +0800)]
MdePkg/BaseLib: Introduce CharToUpper and AsciiCharToUpper publicly

Introduce two public functions CharToUpper and AsciiCharToUpper.
They have the same functions as InternalCharToUpper and
InternalBaseLibAsciiToUpper.Considering the internal functions will
be removed,so directly I change their function names to the public ones'.
https://bugzilla.tianocore.org/show_bug.cgi?id=1369

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: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
5 years agoMdeModulePkg/EbcDebugger: Change function names
Shenglei Zhang [Wed, 30 Jan 2019 08:33:07 +0000 (16:33 +0800)]
MdeModulePkg/EbcDebugger: Change function names

Change UnicodeToUpper to InternalUnicodeToUpper.
Change AsciiToUpper to InternalAsciiToUpper.
These changes are committed for bisectability, or build failure will
occur when 2/7 is applied. Because the introduced function names in
2/7 are the same as ones in EdbSupporting.c.
https://bugzilla.tianocore.org/show_bug.cgi?id=1369

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
5 years agoMdePkg/IndustryStandard: Remove an incorrectly spelled macro
Bret Barkelew [Wed, 19 Dec 2018 05:17:45 +0000 (13:17 +0800)]
MdePkg/IndustryStandard: Remove an incorrectly spelled macro

EFI_RETURNING_FROM_EFI_APPLICATOIN is not correctly spelled,
so now remove it.
https://bugzilla.tianocore.org/show_bug.cgi?id=1368

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: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoSecurityPkg/Tcg: Fix typos in TcgDxe.c and Tcg2Dxe.c
Bret Barkelew [Wed, 19 Dec 2018 03:44:34 +0000 (11:44 +0800)]
SecurityPkg/Tcg: Fix typos in TcgDxe.c and Tcg2Dxe.c

Change EFI_RETURNING_FROM_EFI_APPLICATOIN to
EFI_RETURNING_FROM_EFI_APPLICATION.
https://bugzilla.tianocore.org/show_bug.cgi?id=1368

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: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg/IndustryStandard: Introduce a correctly spelled macro
Bret Barkelew [Wed, 19 Dec 2018 03:41:58 +0000 (11:41 +0800)]
MdePkg/IndustryStandard: Introduce a correctly spelled macro

EFI_RETURNING_FROM_EFI_APPLICATOIN is incorrect.
Before removing it, introduce the correctly spelled one,
EFI_RETURNING_FROM_EFI_APPLICATION.
https://bugzilla.tianocore.org/show_bug.cgi?id=1368

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: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoIntelSiliconPkg\Include\IndustryStandard: Update IGD_OPREGION_MBOX3 Structure
Solanki, Digant H [Thu, 31 Jan 2019 08:01:09 +0000 (16:01 +0800)]
IntelSiliconPkg\Include\IndustryStandard: Update IGD_OPREGION_MBOX3 Structure

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1454
Based on latest IGD OpRegion Spec, IGD_OPREGION_MBOX3 needs to be updated with two new members : Physical Address of Raw VBT Data (RVDA) and Size of Raw VBT Data (RVDS)

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Digant H Solanki <digant.h.solanki@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
5 years agoMdeModulePkg/CapsuleApp: Enhance CapsuleApp to support Capsule-on-Disk
Chen A Chen [Tue, 29 Jan 2019 07:29:58 +0000 (15:29 +0800)]
MdeModulePkg/CapsuleApp: Enhance CapsuleApp to support Capsule-on-Disk

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

CapsuleApp is used for trigger capsule update.
Add -OD option in CapsuleApp to support doing capsule update via storage.
Add -F and -L options to support dumping information feature.
Finish unit test for -F and -L options.
Already verify this feature on Denlow platform, success to update capsule
via hard disk with -OD 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 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>