]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
5 years agoMdePkg/BasePeCoffLib: Add more check for relocation data
Dandan Bi [Thu, 3 Jan 2019 07:31:23 +0000 (15:31 +0800)]
MdePkg/BasePeCoffLib: Add more check for relocation data

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

V2:
(1) Add NULL pointer check for the input parameters
(2) Add check for the "Adjust" value before applying fix ups.

In function PeCoffLoaderRelocateImageForRuntime, it doesn't
do much check when do relocation. For API level consideration,
it's not safe enough.
So this patch is to replace the same code logic with function
PeCoffLoaderImageAddress which will cover more validation.

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>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools VolInfo: Fix XCODE5 build issue
Liming Gao [Wed, 16 Jan 2019 06:43:57 +0000 (14:43 +0800)]
BaseTools VolInfo: Fix XCODE5 build issue

XCODE5 reports warning "equality comparison with extraneous parentheses".
Remove extraneous parentheses around the comparison to silence this warning.
This issue is caused by commit 8daa4278e80c70e6caabc525cd122744488253f5.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Feng Bob C <bob.c.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoMaintainers.txt: Update mail address
Ruiyu Ni [Wed, 9 Jan 2019 05:27:05 +0000 (13:27 +0800)]
Maintainers.txt: Update mail address

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ray Ni <ruiyu.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools GenFw: Fix XCODE5 build issue
Liming Gao [Mon, 14 Jan 2019 13:50:11 +0000 (21:50 +0800)]
BaseTools GenFw: Fix XCODE5 build issue

Warning message is that "equality comparison with extraneous parentheses"
Remove extraneous parentheses around the comparison to silence this warning.
This issue is caused by commit 8daa4278e80c70e6caabc525cd122744488253f5.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Feng Bob C <bob.c.feng@intel.com>
Reviewed-by: Feng Bob C <bob.c.feng@intel.com>
5 years agoUefiCpuPkg/RegisterCpuFeaturesLib: Replace AcquireSpinLock.
Eric Dong [Thu, 20 Dec 2018 01:15:51 +0000 (09:15 +0800)]
UefiCpuPkg/RegisterCpuFeaturesLib: Replace AcquireSpinLock.

In AcquireSpinLock function, it may call GetPerformanceCounter which
final calls PeiService table. This code may also been used by AP but
AP should not calls PeiService. This patch update code to avoid use
AcquireSpinLock function.

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

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
5 years agoMdeModulePkg/BootScriptExecuteorDxe: check 64BIT_WAKE_F in FACS.OSPMFlags
Eric Dong [Fri, 11 Jan 2019 05:42:08 +0000 (13:42 +0800)]
MdeModulePkg/BootScriptExecuteorDxe: check 64BIT_WAKE_F in FACS.OSPMFlags

((Facs->Flags & EFI_ACPI_4_0_OSPM_64BIT_WAKE__F) != 0))

In above code, Facs->OspmFlags should be used instead.
EFI_ACPI_4_0_OSPM_64BIT_WAKE__F is a bit in OSPM Enabled Firmware
Control Structure Flags field, not in Firmware Control Structure
Feature Flags.

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

Cc: Aleksiy <oleksiyy@ami.com>
Cc: Jian Wang <jian.j.wang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
5 years agoUefiCpuPkg/S3Resume2Pei: check 64BIT_WAKE_F in FACS.OSPMFlags.
Eric Dong [Fri, 11 Jan 2019 05:41:04 +0000 (13:41 +0800)]
UefiCpuPkg/S3Resume2Pei: check 64BIT_WAKE_F in FACS.OSPMFlags.

((Facs->Flags & EFI_ACPI_4_0_OSPM_64BIT_WAKE__F) != 0))

In above code, Facs->OspmFlags should be used instead.
EFI_ACPI_4_0_OSPM_64BIT_WAKE__F is a bit in OSPM Enabled Firmware
Control Structure Flags field, not in Firmware Control Structure
Feature Flags.

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

Cc: Aleksiy <oleksiyy@ami.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
5 years agoNetworkPkg/Dhcp6Dxe: Remove an unused global variable.
Songpeng Li [Mon, 14 Jan 2019 08:14:38 +0000 (16:14 +0800)]
NetworkPkg/Dhcp6Dxe: Remove an unused global variable.

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

The global variable mAllDhcpServersAddress has never
been used, this patch is to clean it.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Songpeng Li <songpeng.li@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
5 years agoNetworkPkg/IScsiDxe: Remove unused global variables.
Songpeng Li [Thu, 10 Jan 2019 02:16:13 +0000 (10:16 +0800)]
NetworkPkg/IScsiDxe: Remove unused global variables.

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

Global variables mIScsiDeviceListUpdated and
mNumberOfIScsiDevices have never been used, this patch
is to clean them.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Songpeng Li <songpeng.li@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
5 years agoArmPkg/ArmMmuLib AARCH64: fix out of bounds access
Ard Biesheuvel [Mon, 7 Jan 2019 07:15:00 +0000 (08:15 +0100)]
ArmPkg/ArmMmuLib AARCH64: fix out of bounds access

Take care not to dereference BlockEntry if it may be pointing past
the end of the page table we are manipulating. It is only a read,
and thus harmless, but HeapGuard triggers on it so let's fix it.

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/ArmMmuLib ARM: disregard high memory when setting permissions
Ard Biesheuvel [Mon, 7 Jan 2019 06:56:49 +0000 (07:56 +0100)]
ArmPkg/ArmMmuLib ARM: disregard high memory when setting permissions

Ignore calls to ArmSetMemoryAttributes () when the region described
is outside of the 32-bit addressable range. This memory is not
mapped in the first place, and the current code does not deal with
the high bits correctly, resulting in hangs.

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 agoBaseTools/tools_def GCC5: disable LTO for ASLC invocations
Ard Biesheuvel [Mon, 14 Jan 2019 14:04:49 +0000 (15:04 +0100)]
BaseTools/tools_def GCC5: disable LTO for ASLC invocations

GCC for 32-bit ARM chokes on .aslc files when running with LTO
enabled. Since LTO has no benefit whatsoever here, just disable
it globally for GCC5 and up when building .aslc files.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg: implement MmServicesTableLib based on traditional SMM
Ard Biesheuvel [Thu, 3 Jan 2019 18:28:21 +0000 (19:28 +0100)]
MdePkg: implement MmServicesTableLib based on traditional SMM

The definitions of the rebranded MM protocol stack were chosen such
that the existing SMM based core drivers can be reused. So let's
implement MmServicesTableLib based on gEfiMmBaseProtocolGuid, which
is simply gEfiSmmBase2ProtocolGuid under the hood.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg/Include: add MmServicesTableLib header file
Jagadeesh Ujja [Thu, 3 Jan 2019 18:28:20 +0000 (19:28 +0100)]
MdePkg/Include: add MmServicesTableLib header file

SMM has been rebranded as MM, and can be implemented in traditional
mode or standalone mode, using the same prototype for the services
table. Expose this table via MmServicesTableLib, permitting the
respective implementations to expose a traditional or standalone
version.

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: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Remove unused logic for EDKI
Feng, Bob C [Mon, 14 Jan 2019 06:27:30 +0000 (14:27 +0800)]
BaseTools: Remove unused logic for EDKI

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1350
Remove gEcpSource global variable in python 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>
5 years agoNetworkPkg: Protocol Uninstallation Cleanup
Ashish Singhal [Thu, 10 Jan 2019 19:27:08 +0000 (03:27 +0800)]
NetworkPkg: Protocol Uninstallation Cleanup

Use UEFILib provided protocol uninstallation abstraction
instead of direct API for a proper cleanup.

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

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
5 years agoBaseTools: Enable component override functionality
Feng, Bob C [Thu, 10 Jan 2019 09:03:29 +0000 (17:03 +0800)]
BaseTools: Enable component override functionality

https://bugzilla.tianocore.org/show_bug.cgi?id=1449
This patch enable build tools to recognize that
when two given files have the same GUID, file path and ARCH in Dsc,
The later one's definition will be used.

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: Carsey Jaben <jaben.carsey@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoUefiCpuPkg/RegisterCpuFeaturesLib: Avoid AP calls PeiService.
Eric Dong [Fri, 4 Jan 2019 05:37:29 +0000 (13:37 +0800)]
UefiCpuPkg/RegisterCpuFeaturesLib: Avoid AP calls PeiService.

V3:
   Define union to specify the ppi or protocol.

V2:
1. Initialize CpuFeaturesData->MpService in CpuInitDataInitialize
   and make this function been called at the begin of the
   initialization.
2. let all other functions use CpuFeaturesData->MpService install
   of locate the protocol itself.

V1:
GetProcessorIndex function calls GetMpPpi to get the MP Ppi.
Ap will calls GetProcessorIndex function which final let AP calls
PeiService.

This patch avoid GetProcessorIndex call PeiService.

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

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
5 years agoUefiCpuPkg/RegisterCpuFeaturesLib: Enhance debug message.
Eric Dong [Thu, 8 Nov 2018 01:00:10 +0000 (09:00 +0800)]
UefiCpuPkg/RegisterCpuFeaturesLib: Enhance debug message.

Enhance debug message format to let them easy to read.

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

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
5 years agoBaseTools: Remove unused logic from C tools
Feng, Bob C [Wed, 9 Jan 2019 08:34:29 +0000 (16:34 +0800)]
BaseTools: Remove unused logic from C tools

https://bugzilla.tianocore.org/show_bug.cgi?id=1350
Remove IA64 support from BaseTools C code.

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>
5 years agoBaseTools: Remove unused logic for IPF
Feng, Bob C [Wed, 9 Jan 2019 06:44:36 +0000 (14:44 +0800)]
BaseTools: Remove unused logic for IPF

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1350
Remove IPF support from BaseTools C code.

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: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Remove unused logic for EDKI
Feng, Bob C [Mon, 14 Jan 2019 01:24:12 +0000 (09:24 +0800)]
BaseTools: Remove unused logic for EDKI

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1350
Remove EDK module type support from BaseTools python code.

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: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoSecurityPkg: Remove code under UserIdentification folder.
Chen A Chen [Mon, 7 Jan 2019 02:00:28 +0000 (10:00 +0800)]
SecurityPkg: Remove code under UserIdentification folder.

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

1. UserIdentifyManagerDxe is used to provide UserManagerProtocol.
2. UserProfileManagerDxe provides UI setting
3. PwdCredentialProviderDxe & UsbCredentialProviderDxe are implementation
   examples.

Remove above features because of no platform use it.

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: Zhang Chao B <chao.b.zhang@intel.com>
5 years agoArmPkg/ArmMmuLib ARM: fix thinko in second level page table handling
Ard Biesheuvel [Fri, 4 Jan 2019 18:04:32 +0000 (19:04 +0100)]
ArmPkg/ArmMmuLib ARM: fix thinko in second level page table handling

PopulateLevel2PageTable () is invoked for [parts of] mappings that
start or end on a non-1 MB aligned address (or both). The size of
the mapping depends on both the start address modulo 1 MB and the
length of the mapping, but the logic that calculates this size is
flawed: subtracting 'start address modulo 1 MB' could result in a
negative value for the remaining length, which is obviously wrong.

So instead, take either RemainLength, or the rest of the 1 MB
block, whichever is smaller.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Tested-by: Eugene Cohen <eugene@hp.com>
5 years agoArmPkg/ArmMmuLib ARM: add missing support for non-shareable cached mappings
Ard Biesheuvel [Fri, 4 Jan 2019 18:04:31 +0000 (19:04 +0100)]
ArmPkg/ArmMmuLib ARM: add missing support for non-shareable cached mappings

Commit 829633e3a82 ("ArmPkg/ArmMmuLib: Add new attribute
WRITE_BACK_NONSHAREABLE") introduced support for non-shareable
cached mappings to the AArch64 version of ArmMmuLib, but the ARM
version was left behind, so fix that.

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 agoBaseTools: Report Error if use SET in Dsc
Feng, Bob C [Wed, 2 Jan 2019 08:09:46 +0000 (16:09 +0800)]
BaseTools: Report Error if use SET in Dsc

Build tool do not support SET syntax in DSC.
If the SET statement is used in DSC, build tool just ignore it.
That behavior confused some users that
they think SET statement works in DSC like in FDF.
To avoid such confusion, build tool report ERROR
if there is "SET" statement in Dsc file.

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: Cc: Liming Gao <liming.gao@intel.com>
5 years agoShellPkg/TftpDynamicCommand: Change file writing method in tftp
Songpeng Li [Mon, 7 Jan 2019 02:44:18 +0000 (10:44 +0800)]
ShellPkg/TftpDynamicCommand: Change file writing method in tftp

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

v2: Remove an unused variable.

Current logic of shell tftp download was writing file after tftp
download finished, when the file is large, it looks like the shell
tftp command hanged after download was finished. To improve
end-user experience, the solution is using split file writing
instead.

This patch update the code to open and close file inside
DownloadFile(), and save each packet to file within callback
function CheckPacket().

Since AllocatePage() is no-longer needed, This patch can also
remove the memory limitation. The download file can be larger
than system free memory now.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Songpeng Li <songpeng.li@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
5 years agoMdeModulePkg: fix comments in BaseSortLib
Jaben Carsey [Wed, 31 Oct 2018 00:47:48 +0000 (17:47 -0700)]
MdeModulePkg: fix comments in BaseSortLib

The comments are incorrect for the base version of this lib.

Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
5 years agoNetworkPkg/IScsiDxe: Use UEFILib APIs to uninstall protocols.
Ashish Singhal [Wed, 9 Jan 2019 20:58:35 +0000 (04:58 +0800)]
NetworkPkg/IScsiDxe: Use UEFILib APIs to uninstall protocols.

During cleanup in case of initialization failure, some driver
bindings are not installed. Using abstractions in UEFILib takes
care of it.

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

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
5 years agoMdePkg/UefiLib: Abstract driver model protocol uninstallation
Ashish Singhal [Wed, 9 Jan 2019 20:58:34 +0000 (04:58 +0800)]
MdePkg/UefiLib: Abstract driver model protocol uninstallation

Provided functions in UEFILib that abstract driver model protocol
uninstallation. This helps drivers to install and uninstall protocols
using a library to keep things seemless.

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

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: fix imports
Carsey, Jaben [Wed, 9 Jan 2019 19:00:41 +0000 (03:00 +0800)]
BaseTools: fix imports

1 - Some of these imports are cascaded from another file. Import them locally.
2 - Some of these imports are not used. Remove them.
3 - Some of these were missing the namespace used to import them.

These changes facilitate optimization of BaseTools:
https://bugzilla.tianocore.org/show_bug.cgi?id=42

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 agoMdeModulePkg/NonDiscoverablePciDevice: Remove the redundant check
Dandan Bi [Fri, 28 Dec 2018 05:17:50 +0000 (13:17 +0800)]
MdeModulePkg/NonDiscoverablePciDevice: Remove the redundant check

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

if (Attributes) {
  if ((Attributes & (~(DEV_SUPPORTED_ATTRIBUTES))) != 0) {
    return EFI_UNSUPPORTED;
  }
}
In above code block,
"If ((Attributes & (~(DEV_SUPPORTED_ATTRIBUTES))) != 0)" is TRUE,
the Attributes must be not 0. So we can remove the redundant
check "if (Attributes)".

Cc: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoBaseTools/VfrCompile: report error for Integer overflow
Dandan Bi [Fri, 28 Dec 2018 08:18:06 +0000 (16:18 +0800)]
BaseTools/VfrCompile: report error for Integer overflow

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

When an integer constant specified in the .vfr file is
too large for the varstore field it is being used with,
the VFR compiler reports an overflow warning like this:
Test.vfr(693): WARNING: Overflow: Value 1024 is too large to
         store in a UINT8
    : String to UINT* Overflow
Since Warning does not break the build process,
and it is easy to miss it.
This patch is to update the code to report error and break
the build if meet this kind of issue.

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: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoSecurityPkg: Incorrect warning message for Opal admin revert action
Chu, Maggie [Tue, 25 Dec 2018 05:54:25 +0000 (13:54 +0800)]
SecurityPkg: Incorrect warning message for Opal admin revert action

https://bugzilla.tianocore.org/show_bug.cgi?id=1421
"revert action will take long time..." warning should be removed
from pop up message when keep user data selected.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Maggie Chu <maggie.chu@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoRevert "MdePkg: avoid __builtin_unreachable() on GCC v4.4"
Laszlo Ersek [Wed, 2 Jan 2019 20:38:22 +0000 (21:38 +0100)]
Revert "MdePkg: avoid __builtin_unreachable() on GCC v4.4"

This reverts commit 357cec385d4f ("MdePkg: avoid __builtin_unreachable()
on GCC v4.4", 2016-07-21).

We've removed BaseTools support for GCC44..GCC47, therefore we need not
catch the GCC44 corner case for __builtin_unreachable().

No GCC44..GCC47 references remain under MdePkg after this patch.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoCryptoPkg/BaseCryptLib: drop build flags specific to GCC44
Laszlo Ersek [Wed, 2 Jan 2019 20:24:40 +0000 (21:24 +0100)]
CryptoPkg/BaseCryptLib: drop build flags specific to GCC44

We've removed BaseTools support for GCC44..GCC47. Drop
CryptoPkg/BaseCryptLib build flags that are specific to any of those gcc
versions.

No GCC44..GCC47 references remain under CryptoPkg after this patch.

Cc: Gang Wei <gang.wei@intel.com>
Cc: Jian Wang <jian.j.wang@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoArmPkg/ArmSoftFloatLib: drop build flags specific to GCC46/GCC47
Laszlo Ersek [Wed, 2 Jan 2019 19:58:10 +0000 (20:58 +0100)]
ArmPkg/ArmSoftFloatLib: drop build flags specific to GCC46/GCC47

We've removed BaseTools support for GCC44..GCC47. Drop
ArmPkg/ArmSoftFloatLib build flags that are specific to any of those gcc
versions. (See also commit 01627dba0911, "ArmPkg/ArmSoftfloatLib: restrict
-fno-tree-vrp option to GCC46 and GCC47", 2015-12-15).

No GCC44..GCC47 references remain under ArmPkg after this patch.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: remove GCC44 documentation
Laszlo Ersek [Thu, 3 Jan 2019 01:28:37 +0000 (02:28 +0100)]
BaseTools/tools_def.template: remove GCC44 documentation

No GCC44 definitions or remarks exist at this point, so remove the GCC44
documentation too, from "tools_def.template".

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: remove comment about GCC44 + LzmaF86Compress
Laszlo Ersek [Thu, 3 Jan 2019 00:58:22 +0000 (01:58 +0100)]
BaseTools/tools_def.template: remove comment about GCC44 + LzmaF86Compress

"tools_def.template" currently suggests, in the documentation of the
LzmaF86Compress utility, that said tool is generally unhelpful on binaries
built with the GCC44 toolchain, relative to LzmaCompress.

This statement doesn't apply to the GCC48 toolchain. I compressed 126
NOOPT_GCC48/IA32 unique EFI modules (built with gcc-4.8.5, as part of
OVMF) with both LzmaCompress and LzmaF86Compress. I repeated the same for
117 NOOPT_GCC48/X64 unique EFI modules. On average, the LzmaF86Compress
output size was 92.4% of the LzmaCompress output size in the IA32 case
(best relative compression: 86.01%, poorest relative compression: 97.47%
-- still a win). In the X64 case, the LzmaF86Compress output size was
92.95% of the LzmaCompress output size, on avarege (best relative
compression: 87.69%, poorest relative compression: 97.65% -- again, still
a win).

Given the consistent improvement from LzmaCompress to LzmaF86Compress,
remove the statement (rather than updating it to GCC48).

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: rename GCC44_IA32_X64_DLINK_COMMON to GCC48_IA32_X64_DL...
Laszlo Ersek [Thu, 3 Jan 2019 00:51:22 +0000 (01:51 +0100)]
BaseTools/tools_def.template: rename GCC44_IA32_X64_DLINK_COMMON to GCC48_IA32_X64_DLINK_COMMON

GCC44_IA32_X64_DLINK_COMMON is only referenced by:
- GCC48_IA32_X64_ASLDLINK_FLAGS,
- GCC48_IA32_X64_DLINK_FLAGS.

Thus, we can rename ("raise") it to GCC48_IA32_X64_DLINK_COMMON.

(It's easier to review this patch with "git show --word-diff".)

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: eliminate GCC44_IA32_X64_DLINK_FLAGS
Laszlo Ersek [Thu, 3 Jan 2019 00:40:47 +0000 (01:40 +0100)]
BaseTools/tools_def.template: eliminate GCC44_IA32_X64_DLINK_FLAGS

GCC48_IA32_X64_DLINK_FLAGS is defined *wholly* as
GCC44_IA32_X64_DLINK_FLAGS, therefore:

- expand the contents of GCC44_IA32_X64_DLINK_FLAGS into
  GCC48_IA32_X64_DLINK_FLAGS,

- re-point all references of GCC44_IA32_X64_DLINK_FLAGS to
  GCC48_IA32_X64_DLINK_FLAGS,

- remove GCC44_IA32_X64_DLINK_FLAGS.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: rename GCC44_ALL_CC_FLAGS to GCC48_ALL_CC_FLAGS
Laszlo Ersek [Thu, 3 Jan 2019 00:29:57 +0000 (01:29 +0100)]
BaseTools/tools_def.template: rename GCC44_ALL_CC_FLAGS to GCC48_ALL_CC_FLAGS

GCC44_ALL_CC_FLAGS is only referenced by:
- GCC48_IA32_CC_FLAGS,
- GCC48_X64_CC_FLAGS,
- GCC49_AARCH64_CC_FLAGS,
- CLANG38_ALL_CC_FLAGS.

Thus, we can rename ("raise") it to GCC48_ALL_CC_FLAGS.

(It's easier to review this patch with "git show --word-diff".)

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: propagate loss of GCC44 references
Laszlo Ersek [Thu, 3 Jan 2019 00:23:40 +0000 (01:23 +0100)]
BaseTools/tools_def.template: propagate loss of GCC44 references

The last patch decremented references on a number of DEFs. They can be
classified into three groups:

(a) those that remain used by multiple toolchains, or by multiple
definitions of a given toolchain (refcount >= 2):

- GCC_ASLCC_FLAGS
- GCC_ASLPP_FLAGS
- GCC_HOST_PREFIX
- GCC_IA32_RC_FLAGS
- GCC_PP_FLAGS
- GCC_VFRPP_FLAGS
- GCC_X64_RC_FLAGS
- IASL_FLAGS
- IASL_OUTFLAGS
- UNIX_IASL_BIN
- GCC44_IA32_X64_DLINK_FLAGS (!)

(b) those that are only used by GCC48 (refcount == 1):

- GCC44_ASM_FLAGS
- GCC44_IA32_CC_FLAGS
- GCC44_IA32_DLINK2_FLAGS
- GCC44_IA32_X64_ASLDLINK_FLAGS
- GCC44_X64_CC_FLAGS
- GCC44_X64_DLINK2_FLAGS
- GCC44_X64_DLINK_FLAGS

(c) those that are no longer used (refcount == 0):

- GCC44_IA32_PREFIX
- GCC44_X64_PREFIX

For the members of class (b), expand their definitions at the referring
sites, and remove their definitions.

For the members of class (c), remove their definitions.

(It's easier to review this patch with "git show --word-diff".)

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: remove GCC44 leaf definitions
Laszlo Ersek [Wed, 2 Jan 2019 23:57:36 +0000 (00:57 +0100)]
BaseTools/tools_def.template: remove GCC44 leaf definitions

Remove the "leaf" definitions for GCC44. These definitions are never
referenced in "tools_def.template", so their removal can't break other
definitions. Instead, their erasure turns other definitions into leaves
(subject to further removal).

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: remove GCC45 documentation
Laszlo Ersek [Wed, 2 Jan 2019 23:47:26 +0000 (00:47 +0100)]
BaseTools/tools_def.template: remove GCC45 documentation

No GCC45 definitions exist at this point, so remove the GCC45
documentation too, from "tools_def.template".

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: propagate loss of GCC45 references
Laszlo Ersek [Wed, 2 Jan 2019 23:46:06 +0000 (00:46 +0100)]
BaseTools/tools_def.template: propagate loss of GCC45 references

The last patch decremented references on a number of DEFs. They can be
classified into three groups:

(a) those that remain used by multiple toolchains (refcount >= 2):

- GCC_ASLCC_FLAGS
- GCC_ASLPP_FLAGS
- GCC_HOST_PREFIX
- GCC_IA32_RC_FLAGS
- GCC_PP_FLAGS
- GCC_VFRPP_FLAGS
- GCC_X64_RC_FLAGS
- IASL_FLAGS
- IASL_OUTFLAGS
- UNIX_IASL_BIN

(b) those that are only used by GCC48 (refcount == 1):

- GCC45_ASM_FLAGS
- GCC45_IA32_CC_FLAGS
- GCC45_IA32_DLINK2_FLAGS
- GCC45_IA32_X64_ASLDLINK_FLAGS
- GCC45_IA32_X64_DLINK_FLAGS
- GCC45_X64_CC_FLAGS
- GCC45_X64_DLINK2_FLAGS
- GCC45_X64_DLINK_FLAGS

(c) those that are no longer used (refcount == 0):

- GCC45_IA32_PREFIX
- GCC45_X64_PREFIX

For the members of class (b), expand their definitions at the referring
sites, and remove their definitions.

For the members of class (c), remove their definitions.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: remove GCC45 leaf definitions
Laszlo Ersek [Wed, 2 Jan 2019 23:33:17 +0000 (00:33 +0100)]
BaseTools/tools_def.template: remove GCC45 leaf definitions

Remove the "leaf" definitions for GCC45. These definitions are never
referenced in "tools_def.template" (they are the last GCC45 mentions in
the file), so their removal can't break other definitions. Instead, their
erasure turns other definitions into leaves (subject to further removal).

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: remove GCC46 documentation
Laszlo Ersek [Wed, 2 Jan 2019 23:31:01 +0000 (00:31 +0100)]
BaseTools/tools_def.template: remove GCC46 documentation

No GCC46 definitions exist at this point, so remove the GCC46
documentation too, from "tools_def.template".

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: propagate loss of GCC46 references
Laszlo Ersek [Wed, 2 Jan 2019 23:25:09 +0000 (00:25 +0100)]
BaseTools/tools_def.template: propagate loss of GCC46 references

The last patch decremented references on a number of DEFs. They can be
classified into three groups:

(a) those that remain used by multiple toolchains (refcount >= 2):

- GCC_ASLCC_FLAGS
- GCC_ASLPP_FLAGS
- GCC_HOST_PREFIX
- GCC_IA32_RC_FLAGS
- GCC_PP_FLAGS
- GCC_VFRPP_FLAGS
- GCC_X64_RC_FLAGS
- IASL_FLAGS
- IASL_OUTFLAGS
- UNIX_IASL_BIN

(b) those that are only used by GCC48 (refcount == 1):

- GCC46_ASM_FLAGS
- GCC46_IA32_CC_FLAGS
- GCC46_IA32_DLINK2_FLAGS
- GCC46_IA32_X64_ASLDLINK_FLAGS
- GCC46_IA32_X64_DLINK_FLAGS
- GCC46_X64_CC_FLAGS
- GCC46_X64_DLINK2_FLAGS
- GCC46_X64_DLINK_FLAGS

(c) those that are no longer used (refcount == 0):

- GCC46_IA32_PREFIX
- GCC46_X64_PREFIX

For the members of class (b), expand their definitions at the referring
sites, and remove their definitions.

For the members of class (c), remove their definitions.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: remove GCC46 leaf definitions
Laszlo Ersek [Wed, 2 Jan 2019 23:12:01 +0000 (00:12 +0100)]
BaseTools/tools_def.template: remove GCC46 leaf definitions

Remove the "leaf" definitions for GCC46. These definitions are never
referenced in "tools_def.template" (they are the last GCC46 mentions in
the file), so their removal can't break other definitions. Instead, their
erasure turns other definitions into leaves (subject to further removal).

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: remove GCC47 documentation
Laszlo Ersek [Wed, 2 Jan 2019 23:08:02 +0000 (00:08 +0100)]
BaseTools/tools_def.template: remove GCC47 documentation

No GCC47 definitions exist at this point, so remove the GCC47
documentation too, from "tools_def.template".

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: propagate loss of GCC47 references
Laszlo Ersek [Wed, 2 Jan 2019 22:10:29 +0000 (23:10 +0100)]
BaseTools/tools_def.template: propagate loss of GCC47 references

The last patch decremented references on a number of DEFs. They can be
classified into three groups:

(a) those that remain used by multiple toolchains (refcount >= 2):

- GCC_ASLCC_FLAGS
- GCC_ASLPP_FLAGS
- GCC_HOST_PREFIX
- GCC_IA32_RC_FLAGS
- GCC_PP_FLAGS
- GCC_VFRPP_FLAGS
- GCC_X64_RC_FLAGS
- IASL_FLAGS
- IASL_OUTFLAGS
- UNIX_IASL_BIN

(b) those that are only used by GCC48 (refcount == 1):

- GCC47_ASM_FLAGS
- GCC47_IA32_CC_FLAGS
- GCC47_IA32_DLINK2_FLAGS
- GCC47_IA32_X64_ASLDLINK_FLAGS
- GCC47_IA32_X64_DLINK_FLAGS
- GCC47_X64_CC_FLAGS
- GCC47_X64_DLINK2_FLAGS
- GCC47_X64_DLINK_FLAGS

(c) those that are no longer used (refcount == 0):

- GCC47_IA32_PREFIX
- GCC47_X64_PREFIX

For the members of class (b), expand their definitions at the referring
sites, and remove their definitions.

For the members of class (c), remove their definitions.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: remove GCC47 leaf definitions
Laszlo Ersek [Wed, 2 Jan 2019 21:23:19 +0000 (22:23 +0100)]
BaseTools/tools_def.template: remove GCC47 leaf definitions

Remove the "leaf" definitions for GCC47. These definitions are never
referenced in "tools_def.template" (they are the last GCC47 mentions in
the file), so their removal can't break other definitions. Instead, their
erasure turns other definitions into leaves (subject to further removal).

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: remove GCC48_IA32_X64_DLINK_COMMON dead-end
Laszlo Ersek [Wed, 2 Jan 2019 22:55:37 +0000 (23:55 +0100)]
BaseTools/tools_def.template: remove GCC48_IA32_X64_DLINK_COMMON dead-end

DLINK_COMMON definitions are not consumed by "build_rule.template";
instead, DLINK_COMMON definitions (internal to "tools_def.template") were
invented for sharing options between ASLDLINK_FLAGS and DLINK_FLAGS.

However, this intent doesn't actually apply to
GCC48_IA32_X64_DLINK_COMMON: it is never consumed. Furthermore, the
GCC45..GCC47 instances of IA32_X64_DLINK_COMMON too lead up to
GCC48_IA32_X64_DLINK_COMMON only -- they form a dead-end. Remove them
altogether, in order to simplify the subsequent patches.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: strip trailing whitespace
Laszlo Ersek [Wed, 2 Jan 2019 21:29:43 +0000 (22:29 +0100)]
BaseTools/tools_def.template: strip trailing whitespace

Whitespace just before line terminators is useless, remove it.

("git show -b" produces a null diff for this patch.)

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: fix up LF-only line terminator
Laszlo Ersek [Wed, 2 Jan 2019 21:23:31 +0000 (22:23 +0100)]
BaseTools/tools_def.template: fix up LF-only line terminator

"tools_def.template" should only use CRLF line terminators, at this time.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Fixes: 88e8498f8a72cff1f7af6852ec8166772913399e
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/Conf/tools_def.template: drop ARM/AARCH support from GCC46/GCC47
Ard Biesheuvel [Sat, 8 Dec 2018 09:32:42 +0000 (10:32 +0100)]
BaseTools/Conf/tools_def.template: drop ARM/AARCH support from GCC46/GCC47

This drops ARM and AARCH64 support from the GCC46 and GCC47 toolchain
definitions, which are on the list to be removed, along with VS2003,
VS2005, VS2008, VS2010, DDK3790, UNIXGCC, GCC44, GCC45, ELFGCC, CYGGCC,
ICC, ICC11 and MYTOOLS.

Since GCC46 and GCC47 are the only ones on that list that support ARM
and/or AARCH64, let's give Liming a hand and cover the ARM side of
things first, so that everything that remains to be removed is x86
only.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Liming Gao <liming.gao@intel.com>
[lersek@redhat.com: add bugzilla reference and CCs]
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
5 years agoVlv2TbltDevicePkg: assume GCC48 or later
Laszlo Ersek [Wed, 2 Jan 2019 19:49:41 +0000 (20:49 +0100)]
Vlv2TbltDevicePkg: assume GCC48 or later

We're about to remove BaseTools support for GCC44..GCC47. Bump the
assumption about the minimum gcc version to GCC48 in
"Vlv2TbltDevicePkg/bld_vlv.sh".

No GCC44..GCC47 references remain under Vlv2TbltDevicePkg after this
patch.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoOvmfPkg: require GCC48 or later
Laszlo Ersek [Wed, 2 Jan 2019 19:37:02 +0000 (20:37 +0100)]
OvmfPkg: require GCC48 or later

We're about to remove BaseTools support for GCC44..GCC47. Reject those gcc
versions cleanly in "OvmfPkg/build.sh". In "OvmfPkg/README", upgrade any
mentions of the same gcc versions to GCC48.

No GCC44..GCC47 references remain under OvmfPkg after this patch.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@linaro.org>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoEmulatorPkg: require GCC48 or later
Laszlo Ersek [Wed, 2 Jan 2019 19:22:14 +0000 (20:22 +0100)]
EmulatorPkg: require GCC48 or later

We're about to remove BaseTools support for GCC44..GCC47. Reject those gcc
versions cleanly in "EmulatorPkg/build.sh", and drop build flags too that
are specific to them.

No GCC44..GCC47 references remain under EmulatorPkg after this patch.

Cc: Andrew Fish <afish@apple.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdeModulePkg/SdMmcPciHcDxe: Fix VS2015 IA32 NOOPT build failure
Hao Wu [Fri, 4 Jan 2019 02:35:04 +0000 (10:35 +0800)]
MdeModulePkg/SdMmcPciHcDxe: Fix VS2015 IA32 NOOPT build failure

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

This commit will resolve the VS2015 IA32 NOOPT build failure within
SdMmcPciHcDxe.

More specifically, this commit will use BaseLib API RShiftU64() to perform
right-shift operations for UINT64 type operators.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Bi Dandan <dandan.bi@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
5 years agoSecurityPkg/AuthVariableLib: allow MM_STANDALONE drivers to use this library
Jagadeesh Ujja [Wed, 2 Jan 2019 13:13:47 +0000 (18:43 +0530)]
SecurityPkg/AuthVariableLib: allow MM_STANDALONE drivers to use this library

AuthVariableLib library can be used by MM_STANDALONE drivers as well.
So add MM_STANDALONE to the list of module types this library supports.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jagadeesh Ujja <jagadeesh.ujja@arm.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoBaseTools/GenFds: permit stripped MM_CORE_STANDALONE binaries
Ard Biesheuvel [Thu, 3 Jan 2019 12:06:17 +0000 (13:06 +0100)]
BaseTools/GenFds: permit stripped MM_CORE_STANDALONE binaries

The standalone MM core is executed in place, and resides in a
separate execution context which may be space constrained.
Since code and data may be mapped with different attributes for
security reasons, the PE/COFF binary could have a section
alignment of 4 KB.

This means that any relocation data is not only useless, but it
will also take up 4 KB of valuable space.

So add support for the RELOCS_STRIPPED attribute on FFS files of
this type, so that we can get rid of the .reloc section altogether.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools: Correct PcdArray value assigment statement
Feng, Bob C [Mon, 24 Dec 2018 10:24:46 +0000 (18:24 +0800)]
BaseTools: Correct PcdArray value assigment statement

https://bugzilla.tianocore.org/show_bug.cgi?id=1410
BaseTools should not generate C structure array initial value
if the value is not specified with CODE style.

This patch is going to remove the incorrect initial value statement
and correct the Pcd Array value assignment statement.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Fixed build report issue.
Feng, Bob C [Wed, 26 Dec 2018 07:00:37 +0000 (15:00 +0800)]
BaseTools: Fixed build report issue.

This patch is going to fix the regression issue
by 72a1d77694d51914c0dd6aa97dbfa58634b0a4a5

After enable PCD array, the Pcd.OverrideStruct has a new
key, array index, but the build report is not changed correspondingly.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoSecurityPkg/Tcg: Fix Warnings and Remarks reported by IASL
Zhang, Chao B [Mon, 24 Dec 2018 05:16:01 +0000 (13:16 +0800)]
SecurityPkg/Tcg: Fix Warnings and Remarks reported by IASL

Addressed warnings and remarks reported by IASL.EXE. Some methods had
unused arguments. A method was returning a value when it should not.

Cc: Zhang Chao B <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Thomas Rydman <thomas.j.rydman@intel.com>
Reviewed-by: Zhang Chao B <chao.b.zhang@intel.com>
5 years agoMdeModulePkg/SdMmcPciHcDxe: Add SDMMC HC v4 and above Support.
Ashish Singhal [Wed, 2 Jan 2019 15:46:48 +0000 (23:46 +0800)]
MdeModulePkg/SdMmcPciHcDxe: Add SDMMC HC v4 and above Support.

Add SDMA, ADMA2 and 26b data length support.

If V4 64 bit address mode is supported in capabilities register,
program controller to enable V4 host mode and use appropriate
SDMA registers supporting 64 bit addresses.

If V4 64 bit address mode is supported in capabilities register,
program controller to enable V4 host mode and use appropriate
ADMA descriptors supporting 64 bit addresses.

If host controller version is above V4.0, enable ADMA2 with 26b data
length support for better performance. HC 2 register is configured to
use 26 bit data lengths and ADMA2 descriptors are configured appropriately.

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

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoStdLib/Environs: Avoid infinite recursion in _Exit
Alex James [Tue, 18 Dec 2018 04:25:13 +0000 (20:25 -0800)]
StdLib/Environs: Avoid infinite recursion in _Exit

Use __builtin_unreachable instead of infinite recursion to fix an
infinite recursion error when building StdLib with XCODE5/CLANG38.

Cc: Daryl McDaniel <edk2-lists@mc2research.org>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Alex James <theracermaster@gmail.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoStdLib/sys/termios: Define cc_t as unsigned
Alex James [Tue, 18 Dec 2018 04:25:12 +0000 (20:25 -0800)]
StdLib/sys/termios: Define cc_t as unsigned

According to the POSIX standard, cc_t, speed_t, and tcflag_t should be
unsigned integer types. Define cc_t as unsigned to match POSIX and fix
an implicit conversion error when building StdLib with XCODE5/CLANG38.

Cc: Daryl McDaniel <edk2-lists@mc2research.org>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Alex James <theracermaster@gmail.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoUefiCpuPkg: Merge StuffRsb.inc files into one in UefiCpuPkg/Include
Hao Wu [Fri, 21 Dec 2018 05:45:55 +0000 (13:45 +0800)]
UefiCpuPkg: Merge StuffRsb.inc files into one in UefiCpuPkg/Include

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

Previously, when compiling NASM source files, BaseTools did not support
including files outside of the NASM source file directory. As a result, we
duplicated multiple copies of "StuffRsb.inc" files in UefiCpuPkg. Those
INC files contain the common logic to stuff the Return Stack Buffer and
are identical.

After the fix of BZ 1085:
https://bugzilla.tianocore.org/show_bug.cgi?id=1085
The above support was introduced.

Thus, this commit will merge all the StuffRsb.inc files in UefiCpuPkg into
one file. The merged file will be named 'StuffRsbNasm.inc' and be placed
under folder UefiCpuPkg/Include/.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoMdeModulePkg: Remove PcdPeiCoreMaxXXX PCDs
Star Zeng [Fri, 14 Dec 2018 06:45:38 +0000 (14:45 +0800)]
MdeModulePkg: Remove PcdPeiCoreMaxXXX PCDs

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

The codes have been updated to not use PcdPeiCoreMaxFvSupported,
PcdPeiCoreMaxPeimPerFv and PcdPeiCoreMaxPpiSupported.

The patch removes them in MdeModulePkg.dec.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
5 years agoBaseTools/GenFv: Support SecCore and PeiCore in different FV
Chasel, Chiu [Wed, 26 Dec 2018 13:15:19 +0000 (21:15 +0800)]
BaseTools/GenFv: Support SecCore and PeiCore in different FV

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

There is usage model that SecCore and PeiCore are in different FVs.
Update BaseTools to support this usage model.

Test: Verified on internal platform with the case SecCore and
PeiCore in different FVs and built/booted successfully.

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: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoBaseTools: Reset FdsGlobalVariable
Feng, Bob C [Thu, 20 Dec 2018 11:12:12 +0000 (19:12 +0800)]
BaseTools: Reset FdsGlobalVariable

https://bugzilla.tianocore.org/show_bug.cgi?id=1418
This patch is going to fix a regression issue that is introduced
by commit b3497bad1221704a5dbc5da0b10f42625f1ad2ed.

Before commit b3497b, build launched a external GenFds.py to generate
Fd, so the global variable in GenFds.py was reset in each execution.

After commit b3497b, each GenFds run in the same python interpeter, so
we need to explicitly reset global variable in each GenFdsApi call.

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: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoUefiCpuPkg/PiSmmCpuDxeSmm: Update to consume SpeculationBarrier
Hao Wu [Fri, 21 Dec 2018 02:34:20 +0000 (10:34 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Update to consume SpeculationBarrier

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

Since BaseLib API AsmLfence() is a x86 arch specific API and should be
avoided using in generic codes, this commit replaces the usage of
AsmLfence() with arch-generic API SpeculationBarrier().

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoMdeModulePkg/Variable: Update to consume SpeculationBarrier
Hao Wu [Fri, 21 Dec 2018 02:30:22 +0000 (10:30 +0800)]
MdeModulePkg/Variable: Update to consume SpeculationBarrier

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

Since BaseLib API AsmLfence() is a x86 arch specific API and should be
avoided using in generic codes, this commit replaces the usage of
AsmLfence() with arch-generic API SpeculationBarrier().

Please note that speculation execution barriers are intended to be
asserted for SMM codes, hence, this commit still preserve an empty
implementation of the speculation execution barrier for the DXE codes.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
5 years agoMdeModulePkg/SmmLockBox: Update to consume SpeculationBarrier
Hao Wu [Fri, 21 Dec 2018 02:29:29 +0000 (10:29 +0800)]
MdeModulePkg/SmmLockBox: Update to consume SpeculationBarrier

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

Since BaseLib API AsmLfence() is a x86 arch specific API and should be
avoided using in generic codes, this commit replaces the usage of
AsmLfence() with arch-generic API SpeculationBarrier().

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
5 years agoMdeModulePkg/FaultTolerantWrite: Update to consume SpeculationBarrier
Hao Wu [Fri, 21 Dec 2018 02:22:10 +0000 (10:22 +0800)]
MdeModulePkg/FaultTolerantWrite: Update to consume SpeculationBarrier

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

Since BaseLib API AsmLfence() is a x86 arch specific API and should be
avoided using in generic codes, this commit replaces the usage of
AsmLfence() with arch-generic API SpeculationBarrier().

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
5 years agoMdePkg/BaseLib: Introduce new SpeculationBarrier API
Hao Wu [Fri, 21 Dec 2018 01:50:39 +0000 (09:50 +0800)]
MdePkg/BaseLib: Introduce new SpeculationBarrier API

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

X86 specific BaseLib API AsmLfence() was introduced to address the Spectre
Variant 1 (CVE-2017-5753) issue. The purpose of this API is to insert
barriers to stop speculative execution. However, the API is highly
architecture (X86) specific, and thus should be avoided using across
generic code.

To address this issue, this patch will add a new BaseLib API called
SpeculationBarrier(). Different architectures will have different
implementations for this API.

For IA32 and x64, the implementation of SpeculationBarrier() will
directly call AsmLfence().

For ARM and AARCH64, this patch will add a temporary empty implementation
as a placeholder. We hope experts in ARM can help to contribute the actual
implementation.

For EBC, similar to the ARM and AARCH64 cases, a temporary empty
implementation is added.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoNetworkPkg: Remove some clarification from UefiPxeBcDxe.inf
Siyuan Fu [Thu, 20 Dec 2018 01:26:48 +0000 (09:26 +0800)]
NetworkPkg: Remove some clarification from UefiPxeBcDxe.inf

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

This patch is to remove the clarification about usage/difference between
those drivers in MdeModulePkg and NetworkPkg, since the MdeModulePkg one
have been deleted.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
5 years agoMdeModulePkg: Delete UefiPxeBcDxe in MdeModulePkg.
Siyuan Fu [Thu, 20 Dec 2018 01:26:23 +0000 (09:26 +0800)]
MdeModulePkg: Delete UefiPxeBcDxe in MdeModulePkg.

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

This patch is to delete the UefiPxeBcDxe driver in MdeModulePkg. The
driver will not be maintained and can't co-work with the dual-stack
UefiPxeBcDxe in NetworkPkg.

People should use below NetworkPkg drivers instead:
  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
Which is actively maintained with more bug fixes and new feature support.

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>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
5 years agoNetworkPkg: Remove some clarification from IScsiDxe.inf
Siyuan Fu [Thu, 20 Dec 2018 01:25:11 +0000 (09:25 +0800)]
NetworkPkg: Remove some clarification from IScsiDxe.inf

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

This patch is to remove the clarification about usage/difference between
those drivers in MdeModulePkg and NetworkPkg, since the MdeModulePkg one
have been deleted.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
5 years agoMdeModulePkg: Delete IScsiDxe in MdeModulePkg.
Siyuan Fu [Thu, 20 Dec 2018 01:24:38 +0000 (09:24 +0800)]
MdeModulePkg: Delete IScsiDxe in MdeModulePkg.

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

This patch is to delete the IScsiDxe driver in MdeModulePkg. The driver
will not be maintained and can't co-work with the dual-stack IScsiDxe in
NetworkPkg.

People should use below NetworkPkg drivers instead:
  NetworkPkg/IScsiDxe/IScsiDxe.inf
Which is actively maintained with more bug fixes and new feature support.

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>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoNetworkPkg: Remove some clarification from TcpDxe.inf
Siyuan Fu [Thu, 20 Dec 2018 01:23:08 +0000 (09:23 +0800)]
NetworkPkg: Remove some clarification from TcpDxe.inf

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

This patch is to remove the clarification about usage/difference between
those drivers in MdeModulePkg and NetworkPkg, since the MdeModulePkg one
have been deleted.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
5 years agoMdeModulePkg: Delete Tcp4Dxe in MdeModulePkg.
Siyuan Fu [Thu, 20 Dec 2018 01:22:06 +0000 (09:22 +0800)]
MdeModulePkg: Delete Tcp4Dxe in MdeModulePkg.

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

This patch is to delete the Tcp4Dxe driver in MdeModulePkg. The driver
will not be maintained and can't co-work with the dual-stack TcpDxe in
NetworkPkg.

People should use below NetworkPkg drivers instead:
  NetworkPkg/TcpDxe/TcpDxe.inf
Which is actively maintained with more bug fixes and new feature support.

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>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
5 years agoBaseTools/tools_def ARM: use softfloat target for CLANG3x
Ard Biesheuvel [Wed, 19 Dec 2018 14:50:23 +0000 (15:50 +0100)]
BaseTools/tools_def ARM: use softfloat target for CLANG3x

The 'arm-linux-gnueabihf' target triplet we use for CLANG35 and
CLANG38 specifies a hardfloat target, and so the binaries that are
emitted are annotated as using VFP registers for passing floating
point arguments, even though no VFP is used anywhere in the code.

This works fine as long as we don't try to link against code
that uses software floating point, but combining object files
with different floating point calling conventions is not permitted.

So switch to the softfloat arm-linux-gnueabi triplet instead.
This affects both the name Clang uses when invoking the linker,
and the arguments it passes to it, and we are mostly interested
in the latter (since any version of GNU ld.bfd will do the right
thing as long as it targets EABI ARM)

For native builds, this change has no effect, since the unprefixed
system linker will take priority, and so Clang will pass the right
arguments to whichever linker happens to be the system linker.

For cross builds, the fact that Clang composes the name of the
linker by prefixing '-ld' with the target triplet implies that
users will have to switch to a version of binutils that targets
arm-linux-gnueabi rather than arm-linux-gnueabihf. Note that the
GCCx toolchain targets can use either when building for ARM so this
does not create a need to install two versions of the ARM cross
toolchain. Also, note that all ARM toolchains in the GCC family
are already documented as requiring a toolchain that targets
arm-linux-gnueabi and not arm-linux-gnueabihf.

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: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoArmPkg/ArmScmiDxe: Add clock enable function
Jeff Brasen [Thu, 13 Dec 2018 23:48:44 +0000 (16:48 -0700)]
ArmPkg/ArmScmiDxe: Add clock enable function

Add function to allow enabling and disabling of the clock using the SCMI
interface. Add gArmScmiClock2ProtocolGuid to distinguish platforms that
support new API from those that just have the older protocol.

SCMI_CLOCK2_PROTOCOL also adds a version parameter to allow for future
changes. It is placed after the functions that are present in the
existing protocol to allow SCMI_CLOCK2_PROTOCOL to be cast to
SCMI_CLOCK_PROTOCOL so that only a single implementation of those
function are needed.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoMaintainers.txt: Change DynamicTablesPkg maintainer
Sami Mujawar [Mon, 12 Nov 2018 16:27:46 +0000 (16:27 +0000)]
Maintainers.txt: Change DynamicTablesPkg maintainer

Removing Evan and adding Alexei as the co-maintainer.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
5 years agoUpgrade OpenSSL to 1.1.0j
Jian J Wang [Thu, 13 Dec 2018 07:37:44 +0000 (15:37 +0800)]
Upgrade OpenSSL to 1.1.0j

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

BZ#1089 (https://bugzilla.tianocore.org/show_bug.cgi?id=1089) requests
to upgrade the OpenSSL to the latest 1.1.1 release. Since OpenSSL-1.1.1
has many changes, more porting efforts and feature evaluation are needed.
This might lead to a situation that it cannot catch the Q1'19 stable tag.

One of the solution is upgrade current version (1.1.0h) to 1.1.0j.
According to following web page in openssl.org, all security issues
solved in 1.1.1 have been also back-ported to 1.1.0.j. This can make
sure that no security vulnerabilities left in edk2 master before 1.1.1.

https://www.openssl.org/news/vulnerabilities-1.1.1.html

Cc: Ting Ye <ting.ye@intel.com>
Cc: Gang Wei <gang.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Gang Wei <gang.wei@intel.com>
Reviewed-by: Ting Ye <ting.ye@intel.com>
5 years agoUefiCpuPkg/CpuExceptionHandlerLib: Fix spelling issue
Mike Maslenkin [Thu, 20 Dec 2018 13:14:36 +0000 (21:14 +0800)]
UefiCpuPkg/CpuExceptionHandlerLib: Fix spelling issue

*Excpetion* should be *Exception*

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
CC: Eric Dong <eric.dong@intel.com>
CC: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoArmPlatformPkg/PL011SerialPortLib: use untyped PCD for register base
Ard Biesheuvel [Mon, 17 Dec 2018 18:51:45 +0000 (19:51 +0100)]
ArmPlatformPkg/PL011SerialPortLib: use untyped PCD for register base

Use an untyped PCD reference for PcdSerialRegisterBase, so that the
library gets built without hardcoded values, permitting modules to
override the default serial port. This allows SerialDxe to use a
different serial port from the one used for DEBUG output (which
often gets occluded due to the console driver clearing the screen).

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoReadme.md: Add edk2 release tag and edk2 release plan
Liming Gao [Wed, 5 Dec 2018 14:49:17 +0000 (22:49 +0800)]
Readme.md: Add edk2 release tag and edk2 release plan

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

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
5 years agoArmPkg/GenericWatchdogDxe: implement RegisterHandler() method
Ard Biesheuvel [Tue, 18 Dec 2018 13:10:14 +0000 (14:10 +0100)]
ArmPkg/GenericWatchdogDxe: implement RegisterHandler() method

Even though UEFI does not appear to use it, let's implement the
complete PI watchdog protocol, including handler registration,
which will be invoked before the ResetSystem() runtime service
when the watchdog timer expires.

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/GenericWatchdogDxe: clean up the code
Ard Biesheuvel [Tue, 18 Dec 2018 13:10:13 +0000 (14:10 +0100)]
ArmPkg/GenericWatchdogDxe: clean up the code

Clean up the code, by adding missing STATIC modifiers, drop
redundant casts, and get rid of the 'success handling' anti
pattern in the entry point code.

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 agoArmPlatformPkg/SP805WatchdogDxe: switch to interrupt mode
Ard Biesheuvel [Tue, 18 Dec 2018 13:10:12 +0000 (14:10 +0100)]
ArmPlatformPkg/SP805WatchdogDxe: switch to interrupt mode

The SP805 watchdog driver doesn't implement the PI watchdog protocol
fully, but always simply resets the system if the watchdog time runs
out.

However, the hardware does support the intended usage model, as long
as the SP805 is wired up correctly. So let's implement interrupt based
mode involving a handler that is registered by the DXE core and invoked
when the watchdog runs out. In the interrupt handler, we invoke the
notify function if one was registered, before calling the ResetSystem()
runtime service (as per the UEFI spec)

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 agoArmPlatformPkg/SP805WatchdogDxe: cosmetic cleanup
Ard Biesheuvel [Tue, 18 Dec 2018 13:10:11 +0000 (14:10 +0100)]
ArmPlatformPkg/SP805WatchdogDxe: cosmetic cleanup

Before fixing the SP805 driver, let's clean it up a bit. No
functional changes.

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 agoMdePkg/Arm/ProcessorBind.h: fix copy/paste error
Ard Biesheuvel [Thu, 20 Dec 2018 11:10:20 +0000 (12:10 +0100)]
MdePkg/Arm/ProcessorBind.h: fix copy/paste error

Instead of #defining MAX_ALLOC_ADDRESS to MAX_ADDRESS as intended,
it is #defined to itself, causing all ARM builds to break.

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/MemoryInitPeiLib: split memory HOB based on MAX_ALLOC_ADDRESS
Ard Biesheuvel [Fri, 7 Dec 2018 11:01:25 +0000 (12:01 +0100)]
ArmVirtPkg/MemoryInitPeiLib: split memory HOB based on MAX_ALLOC_ADDRESS

The current ArmVirtMemoryInitPeiLib code splits the memory region passed
via PcdSystemMemoryBase/PcdSystemMemorySize in two if the region extends
beyond the MAX_ADDRESS limit. This was introduced for 32-bit ARM, which
may support more than 4 GB of physical address space, but cannot address
all of it via a 1:1 mapping, and a single region that is not mappable
in its entirety is unusable by the PEI core.

AArch64 is in a similar situation now: platforms may support more than
256 TB of physical address space, but only 256 TB is addressable by the
CPU, and so a memory region that extends from below this limit to above
it should be split.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoArmPlatformPkg/MemoryInitPeim: take MAX_ALLOC_ADDRESS into account
Ard Biesheuvel [Fri, 7 Dec 2018 10:59:51 +0000 (11:59 +0100)]
ArmPlatformPkg/MemoryInitPeim: take MAX_ALLOC_ADDRESS into account

Limit the PEI memory region so it will not extend beyond what we can
address architecturally when running with 4 KB pages.

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/ArmMmuLib: take MAX_ALLOC_ADDRESS into account
Ard Biesheuvel [Fri, 7 Dec 2018 10:57:22 +0000 (11:57 +0100)]
ArmPkg/ArmMmuLib: take MAX_ALLOC_ADDRESS into account

When creating the page tables for the 1:1 mapping, ensure that we don't
attempt to map more than what is architecturally permitted when running
with 4 KB pages, which is 48 bits of VA. This will be reflected in the
value of MAX_ALLOC_ADDRESS once we override it for AArch64, so use that
macro instead of MAX_ADDRESS.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoMdeModulePkg/Dxe/Page: take MAX_ALLOC_ADDRESS into account
Ard Biesheuvel [Fri, 7 Dec 2018 10:55:19 +0000 (11:55 +0100)]
MdeModulePkg/Dxe/Page: take MAX_ALLOC_ADDRESS into account

Take MAX_ALLOC_ADDRESS into account in the implementation of the
page allocation routines, so that they will only return memory
that is addressable by the CPU at boot time, even if more memory
is available in the GCD memory map.

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>