]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
5 years agoIntelSiliconPkg/MicrocodeUpdateDxe: Error message enhancement
Shenglei Zhang [Mon, 18 Feb 2019 07:15:41 +0000 (15:15 +0800)]
IntelSiliconPkg/MicrocodeUpdateDxe: Error message enhancement

The error message of ExtendedTableCount is not clear. Add the count
number into the debug message.
https://bugzilla.tianocore.org/show_bug.cgi?id=1500

Cc: Ray Ni <ray.ni@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
5 years agoBaseTools: Remove unused txt files
Liming Gao [Fri, 15 Feb 2019 14:32:18 +0000 (22:32 +0800)]
BaseTools: Remove unused txt files

externals.txt is to refer to the binary Win32. It is not used any longer.
BuildNotes.txt is to freeze BaseTools python. It is not used any longer.
BinaryFiles.txt is to list the file in Bin directory. But, Bin dir is empty.
building-gcc.txt and gcc is for mingw-gcc. It is not used any longer.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoUefiCpuPkg/SecCore: Wrong Debug Information for SecCore
Chasel, Chiu [Tue, 19 Feb 2019 07:30:23 +0000 (15:30 +0800)]
UefiCpuPkg/SecCore: Wrong Debug Information for SecCore

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

When SecCore and PeiCore in different FV, current
implementation still assuming SecCore and PeiCore are in
the same FV.
To fix this issue 2 FVs will be input parameters for
FindAndReportEntryPoints () and SecCore and PeiCore will
be found in each FV and correct debug information will
be reported.

Test: Booted with internal platform successfully.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
5 years agoMdeModulePkg/SdMmcPciHcDxe: Use 16/32-bit IO widths
Edgar Handal [Tue, 19 Feb 2019 17:06:56 +0000 (01:06 +0800)]
MdeModulePkg/SdMmcPciHcDxe: Use 16/32-bit IO widths

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

Use 16-bit and 32-bit IO widths for SDMMC MMIO to prevent all register
accesses from being split up into 8-bit accesses.

The SDHCI specification states that the registers shall be accessible in
byte, word, and double word accesses. (SD Host Controller Simplified
Specification 4.20 Section 1.2)

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoMdeModulePkg/SdMmcPciHcDxe Fix eMMC HS400 switch sequence
Albecki, Mateusz [Mon, 18 Feb 2019 11:11:37 +0000 (19:11 +0800)]
MdeModulePkg/SdMmcPciHcDxe Fix eMMC HS400 switch sequence

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

In eMMC HS400 switch sequence flow eMMC driver attempted
to execute SEND_STATUS just after switching bus timing to high
speed and before downgrading clock frequency to 52MHz. Since link
was at that time in incorrect state SEND_STATUS was failing which
made driver think switch to HS400 failed.
This change makes driver always change clock frequency after
switching bus timing and before executing SEND_STATUS.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Albecki Mateusz <mateusz.albecki@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoBaseTools: Fixed a code bug for Pcd Array.
Feng, Bob C [Thu, 14 Feb 2019 08:48:03 +0000 (16:48 +0800)]
BaseTools: Fixed a code bug for Pcd Array.

For example, PCD gUefiOvmfPkgTokenSpaceGuid.Test001 datatype is Array:
TEST1[2]
and the filed TEST1UINT64ARRAY in TEST1 is also an array:
UINT64 TEST1UINT64ARRAY[2];

Then the following filed assignment in DSC will cause build failure.
gUefiOvmfPkgTokenSpaceGuid.Test001[0].TEST1UINT64ARRAY|{'A','B'}

The root cause is build tool generate incorrect PcdValueInit.c File.

This patch is going to fix this issue.

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: Fixed a bug in Vpd handling
Feng, Bob C [Mon, 18 Feb 2019 09:20:25 +0000 (17:20 +0800)]
BaseTools: Fixed a bug in Vpd handling

If there are multiple sku used in a platform and
gEfiMdeModulePkgTokenSpaceGuid.PcdNvStoreDefaultValueBuffer PCD
is used, build will fail.

This is a regression issue introduced by the commit:
5695877ec8f636bd4ad873ef50eceb9da7a0f382 which only update the
Vpd offset for default SKU but not other SKUs.

This patch is going to fix this issue.

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: Fix a ParseDevPathValue function issue.
Feng, Bob C [Sat, 16 Feb 2019 15:33:35 +0000 (23:33 +0800)]
BaseTools: Fix a ParseDevPathValue function issue.

In ParseDevPathValue, the binary data need to convert to string
for python3 and python2 compatiblity.

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:Fix a ECC issue
Fan, ZhijuX [Mon, 18 Feb 2019 06:23:30 +0000 (14:23 +0800)]
BaseTools:Fix a ECC issue

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

A property error occurred because the property of the
function was not defined. a property is now redefined.

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: Add MaxSizeUserSet to Pcd deepcopy function
Feng, Bob C [Sat, 16 Feb 2019 14:51:51 +0000 (22:51 +0800)]
BaseTools: Add MaxSizeUserSet to Pcd deepcopy function

MaxSizeUserSet is missing in Pcd deepcopy function.
This patch is to add it back to Pcd deepcopy function.

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 agoDynamicTablesPkg: Arm IORT Table Generator
Sami Mujawar [Sat, 15 Dec 2018 12:31:47 +0000 (12:31 +0000)]
DynamicTablesPkg: Arm IORT Table Generator

The IORT generator uses the configuration manager protocol
to obtain information about the PCI Root Complex, SMMU,
GIC ITS, Performance Monitoring counters etc. and generates
the IORT table.

The mappings between the components are represented using
tokens. The generator invokes the configuration manager
protocol interfaces and requests for objects referenced by
tokens to establish the link.

This table data is then used by the Table Manager to install
the IORT table.

The Table Manager then invokes the generator interface to free
any resources allocated by the IORT table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: Arm PCI MCFG Table Generator
Sami Mujawar [Sat, 15 Dec 2018 12:29:49 +0000 (12:29 +0000)]
DynamicTablesPkg: Arm PCI MCFG Table Generator

The MCFG generator uses the configuration manager protocol
to obtain the PCI Configuration space information from the
platform configuration manager and builds the MCFG table.

This table data is then used by the Table Manager to install
the MCFG table.

The Table Manager then invokes the generator interface to free
any resources allocated by the MCFG table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: Arm DBG2 Table Generator
Sami Mujawar [Sat, 15 Dec 2018 12:28:23 +0000 (12:28 +0000)]
DynamicTablesPkg: Arm DBG2 Table Generator

The DBG2 generator uses the configuration manager protocol
to obtain the debug serial port information from the platform
configuration manager. It then updates a template DBG2 table
structure. This table data is used by the Table Manager to
install the DBG2 table.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: Arm SPCR Table Generator
Sami Mujawar [Sat, 15 Dec 2018 12:27:03 +0000 (12:27 +0000)]
DynamicTablesPkg: Arm SPCR Table Generator

The SPCR generator uses the configuration manager protocol to
obtain the serial port information from the platform configuration
manager. It then updates a template SPCR table structure. This
table data is used by the Table Manager to install the SPCR table.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: Arm ACPI GTDT Generator
Sami Mujawar [Sat, 15 Dec 2018 12:25:52 +0000 (12:25 +0000)]
DynamicTablesPkg: Arm ACPI GTDT Generator

The GTDT generator uses the configuration manager protocol to
obtain information about the architectural and platform timers
available on the platform and generates the ACPI GTDT table.
This table data is then used by the Table Manager to install
the GTDT table.

The Table Manager then invokes the generator interface to free
any resources allocated by the GTDT table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: Arm ACPI MADT Generator
Sami Mujawar [Sat, 15 Dec 2018 12:23:59 +0000 (12:23 +0000)]
DynamicTablesPkg: Arm ACPI MADT Generator

The MADT generator uses the configuration manager protocol to
obtain information about the Arm interrupt controllers (GICC,
GICD, etc.) and generates the ACPI MADT table. This table data
is then used by the Table Manager to install the MADT table.

The Table Manager then invokes the generator interface to free
any resources allocated by the MADT table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: Arm ACPI FADT Generator
Sami Mujawar [Sat, 15 Dec 2018 12:22:45 +0000 (12:22 +0000)]
DynamicTablesPkg: Arm ACPI FADT Generator

The FADT generator collates the relevant information required
for generating a FADT table from configuration manager using
the configuration manager protocol. It then updates a template
FADT table structure. This table data is used by the Table
Manager to install the FADT table.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: Arm Raw/DSDT/SSDT Generator
Sami Mujawar [Sat, 15 Dec 2018 12:20:23 +0000 (12:20 +0000)]
DynamicTablesPkg: Arm Raw/DSDT/SSDT Generator

A Raw generator is a simple generator. This generator provides
the ability to install a binary blob (that contains ACPI table
data) as an ACPI table. The binary blob could be pre-generated
ACPI table data or it may be the pre-compiled output from an
iAsl compiler for a DSDT or SSDT table.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: Dynamic Table Manager Dxe
Sami Mujawar [Sat, 15 Dec 2018 12:18:52 +0000 (12:18 +0000)]
DynamicTablesPkg: Dynamic Table Manager Dxe

The dynamic table manager implements the top level component
that drives the table generation and installation process.
It uses the configuration manager protocol to get the list
of tables to be installed from the configuration manager.
It iterates through the list of tables, requests the table
factories for corresponding generators and invokes the
generator interface to build the tables.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: Dynamic Table Factory Dxe
Sami Mujawar [Sat, 15 Dec 2018 12:17:06 +0000 (12:17 +0000)]
DynamicTablesPkg: Dynamic Table Factory Dxe

The dynamic table factory dxe implements the dynamic table
factory protocol. It also implements the ACPI, SMBIOS and
DT table factories. The table generators register themselves
with the respective table factories and the factories are
responsible for instantiating instances of the generators
to build the firmware tables.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: Dynamic Table Factory Protocol
Sami Mujawar [Sat, 15 Dec 2018 12:03:40 +0000 (12:03 +0000)]
DynamicTablesPkg: Dynamic Table Factory Protocol

This patch introduces the dynamic table factory protocol
that provides an interface to register and retrieve
registered generators.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: Table Helper Library
Sami Mujawar [Sat, 15 Dec 2018 12:02:25 +0000 (12:02 +0000)]
DynamicTablesPkg: Table Helper Library

A helper library that implements common functionality
for use by table generators.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: Configuration Manager Helper
Sami Mujawar [Sat, 15 Dec 2018 12:01:12 +0000 (12:01 +0000)]
DynamicTablesPkg: Configuration Manager Helper

This patch defines a helper macro 'GET_OBJECT_LIST()' that
expands to a function that uses the configuration manager
protocol to retrieve configuration manager object(s).

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: Configuration Manager Protocol
Sami Mujawar [Sat, 15 Dec 2018 12:00:04 +0000 (12:00 +0000)]
DynamicTablesPkg: Configuration Manager Protocol

Introduce configuration manager protocol interface
that is used by the dynamic tables framework core
to communicate with configuration manager.

Configuration manager is a platform specific module
that implements the configuration manager protocol.

Table generators use this interface to retrieve the
hardware information from the configuration manager.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: Configuration Manager Objects
Sami Mujawar [Sat, 15 Dec 2018 11:59:07 +0000 (11:59 +0000)]
DynamicTablesPkg: Configuration Manager Objects

The dynamic tables frameworks core communicates with the
platform specific implementation using the configuration
manager protocol interface. The dynamic tables framework
core uses this interface to retrieve information required
for generating the firmware tables. This information is
represented in the form of objects, which are classified
as standard namespace objects, Arm namespace objects or
as Custom/OEM namespace objects.

The configuration manager objects provides a convenient
way for wrapping up the namespaces using a well defined
configuration manager object Id.

The configuration manager is a platform specific component
that collates the platform information required for generating
firmware tables and represents them as configuration manager
objects.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: Arm NameSpace Objects
Sami Mujawar [Sat, 15 Dec 2018 11:58:07 +0000 (11:58 +0000)]
DynamicTablesPkg: Arm NameSpace Objects

The dynamic tables frameworks core communicates with the
platform specific implementation using the configuration
manager protocol interface. The dynamic tables framework
core uses this interface to retrieve information required
for generating the firmware tables. This information is
represented in the form of objects, which are classified
as standard namespace objects, Arm namespace objects or
as Custom/OEM namespace objects.

This patch introduces the definitions for the Arm namespace
objects.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: Standard NameSpace Objects
Sami Mujawar [Sat, 15 Dec 2018 11:57:13 +0000 (11:57 +0000)]
DynamicTablesPkg: Standard NameSpace Objects

The dynamic tables frameworks core communicates with the
platform specific implementation using the configuration
manager protocol interface. The dynamic tables framework
core uses this interface to retrieve information required
for generating the firmware tables. This information is
represented in the form of objects, which are classified
as standard namespace objects, Arm namespace objects or
as Custom/OEM namespace objects.

This patch introduces the definitions for standard
namespace objects.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: DT Table Generator
Sami Mujawar [Sat, 15 Dec 2018 11:56:07 +0000 (11:56 +0000)]
DynamicTablesPkg: DT Table Generator

This patch introduces the interfaces and definitions for
implementing a Device Tree table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: SMBIOS Table Generator
Sami Mujawar [Sat, 15 Dec 2018 11:54:52 +0000 (11:54 +0000)]
DynamicTablesPkg: SMBIOS Table Generator

This patch introduces the required interfaces and definitions
for implementing a SMBIOS table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: Acpi Table Generator
Sami Mujawar [Sat, 15 Dec 2018 11:53:43 +0000 (11:53 +0000)]
DynamicTablesPkg: Acpi Table Generator

This patch introduces the required interfaces and definitions
for implementing an ACPI table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: Table Generator definition
Sami Mujawar [Sat, 15 Dec 2018 11:52:30 +0000 (11:52 +0000)]
DynamicTablesPkg: Table Generator definition

A Table generator is a component that implements the logic
for building a firmware table. This is typically implemented
as a library and registers itself with a table factory.

Table generators are further classified based on type of table
it generates, a namespace that signifies if the implementation
is standard or an OEM specific implementation and a table Id.

This patch introduces the definitions used for describing a
table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoDynamicTablesPkg: Dynamic Tables Framework
Sami Mujawar [Mon, 3 Dec 2018 11:13:31 +0000 (11:13 +0000)]
DynamicTablesPkg: Dynamic Tables Framework

The dynamic tables framework is designed to generate standardised
firmware tables that describe the hardware information at
run-time. A goal of standardised firmware is to have a common
firmware for a platform capable of booting both Windows and Linux
operating systems.

Traditionally the firmware tables are handcrafted using ACPI
Source Language (ASL), Table Definition Language (TDL) and
C-code. This approach can be error prone and involves time
consuming debugging.

In addition, it may be desirable to configure platform hardware
at runtime such as: configuring the number of cores available
for use by the OS, or turning SoC features ON or OFF.

This patch introduces Dynamic Tables Framework which also provides
mechanisms to reduce the amount of effort required in porting
firmware to new platforms. A more detailed description is in
the Readme.md file.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
5 years agoMdeModulePkg: Remove EmuVariableRuntimeDxe
Star Zeng [Sat, 12 Jan 2019 15:23:30 +0000 (23:23 +0800)]
MdeModulePkg: Remove EmuVariableRuntimeDxe

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.
This patch removes EmuVariableRuntimeDxe 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>
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 agoOvmfPkg/build.sh: Enable flash for qemu 3 or later
Jordan Justen [Fri, 15 Feb 2019 22:10:49 +0000 (14:10 -0800)]
OvmfPkg/build.sh: Enable flash for qemu 3 or later

The check for 1.[1-9][0-9].* was removed since qemu jumped to 2.0
after 1.7.

Changed 2.*.* to [2-9].*.* to match major releases 3 - 9.

Added [1-9][0-9]*.*.* to match major releses >= 10.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoUefiCpuPkg/MtrrLib: Fix a bug that may wrongly set memory <1MB to UC
Ruiyu Ni [Mon, 21 Jan 2019 15:16:22 +0000 (23:16 +0800)]
UefiCpuPkg/MtrrLib: Fix a bug that may wrongly set memory <1MB to UC

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

Today's MtrrLib contains a bug, for example:
 when the original cache setting is WB for [0xF_0000, 0xF_8000) and,
 a new request to set [0xF_0000, 0xF_4000) to WP,
 the cache setting for [0xF_4000, 0xF_8000) is reset to UC.

The reason is when MtrrLibSetBelow1MBMemoryAttribute() is called the
WorkingFixedSettings doesn't contain the actual MSR value stored in
hardware, but when writing the fixed MTRRs, the code logic assumes
WorkingFixedSettings contains the actual MSR value.

The new fix is to change MtrrLibSetBelow1MBMemoryAttribute() to
calculate the correct ClearMasks[] and OrMasks[], and use them
directly when writing the fixed MTRRs.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
5 years agoMdeModulePkg/PropertiesTableAttributesDxe: Remove this driver
Shenglei Zhang [Mon, 18 Feb 2019 08:20:37 +0000 (16:20 +0800)]
MdeModulePkg/PropertiesTableAttributesDxe: Remove this driver

This functionality of this driver has been deprecated and
no platform employs this driver. It can be removed completely.
https://bugzilla.tianocore.org/show_bug.cgi?id=1475

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.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: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
5 years agoMdePkg/BaseLib: Change a variable type in a bitwise operation
Shenglei Zhang [Thu, 14 Feb 2019 02:43:10 +0000 (10:43 +0800)]
MdePkg/BaseLib: Change a variable type in a bitwise operation

Change the type of variable Chr from CHAR8 to UINT32 in a
bitwise operation, to make the two variables in the operation
have the same size.
https://bugzilla.tianocore.org/show_bug.cgi?id=1527

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>
5 years agoMdeModulePkg/BmBoot: Report status when fail to load/start boot option
Dandan Bi [Fri, 15 Feb 2019 05:58:50 +0000 (13:58 +0800)]
MdeModulePkg/BmBoot: Report status when fail to load/start boot option

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

According to PI1.7 Spec, report extended data describing an
EFI_STATUS return value along with
EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR and
EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED status code
when fail to load or start boot option image.

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: Laszlo Ersek <lersek@redhat.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
5 years agoMdePkg/StatusCodeDataTypeId.h: Add new definition per PI1.7 Spec
Dandan Bi [Thu, 14 Feb 2019 08:49:12 +0000 (16:49 +0800)]
MdePkg/StatusCodeDataTypeId.h: Add new definition per PI1.7 Spec

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

According to PI1.7 Spec, add the new definition
EFI_RETURN_STATUS_EXTENDED_DATA in StatusCodeDataTypeId.h

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
5 years agoMdeModulePkg/ReportStatusCodeLib: Avoid using AllocatePool if possible
Max Knutsen [Tue, 4 Sep 2018 17:04:35 +0000 (17:04 +0000)]
MdeModulePkg/ReportStatusCodeLib: Avoid using AllocatePool if possible

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

V2: simplify the code logic.
update
if (!mHaveExitedBootServices &&
  (StatusCodeData != (EFI_STATUS_CODE_DATA *) StatusCodeBuffer)) {
  gBS->FreePool (StatusCodeData);
}
to
if (StatusCodeData != (EFI_STATUS_CODE_DATA *) StatusCodeBuffer) {
  gBS->FreePool (StatusCodeData);
}

V3:
And the code below into the else condition (stack buffer is not enough)
in /DxeReportStatusCodeLib/ReportStatusCodeLib.c

  if (gBS == NULL || gBS->AllocatePool == NULL || gBS->FreePool == NULL) {
    return EFI_UNSUPPORTED;
  }

V4:
Refine code logic.

When report status code with ExtendedData data,
and the extended data can fit in the local static buffer,
there is no need to use AllocatePool to hold the ExtendedData data.

This patch is just to do the enhancement to avoid using AllocatePool.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Michael Turner <Michael.Turner@microsoft.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>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoNetworkPkg/Ip6Dxe: Clean the invalid IPv6 configuration during driver start.
Jiaxin Wu [Wed, 30 Jan 2019 03:24:27 +0000 (11:24 +0800)]
NetworkPkg/Ip6Dxe: Clean the invalid IPv6 configuration during driver start.

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

*v3: Change the if condition check to only clean the invalid configuration.

*v2: Add the warning debug message.

This patch is to clean the invalid data and continue to start IP6 driver.

Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
5 years agoBaseTools: Fixed an issue about StructurePcd
Feng, Bob C [Sun, 3 Feb 2019 14:47:54 +0000 (22:47 +0800)]
BaseTools: Fixed an issue about StructurePcd

If use a structure pcd in fdf, build tool crash
This is a regression issue introduced by py3 patch set.

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: Fix the build report issue about Structure PCD
Feng, Bob C [Fri, 1 Feb 2019 08:51:43 +0000 (16:51 +0800)]
BaseTools: Fix the build report issue about Structure PCD

https://bugzilla.tianocore.org/show_bug.cgi?id=1472
build report use incorrect method to parse DynamicDefault/DynamicExDefault
and DynamicVpd/DynamicExVpd structure Pcd value.

This patch is to fix this issue.

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: Fixed a build report issue.
Feng, Bob C [Sun, 3 Feb 2019 15:22:26 +0000 (23:22 +0800)]
BaseTools: Fixed a build report issue.

Generate report fail when -Y EXECUTION_ORDER in build command.
This patch is going to fix this issue.

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: Correct the error message for UPT
Feng, Bob C [Thu, 17 Jan 2019 08:28:24 +0000 (16:28 +0800)]
BaseTools: Correct the error message for UPT

This patch is going to correct the error message
for UPT.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hess Chen <hess.chen@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
5 years agoEmbeddedPkg/Library: Add VirtualRealTimeClockLib
Pete Batard [Mon, 4 Feb 2019 12:47:36 +0000 (12:47 +0000)]
EmbeddedPkg/Library: Add VirtualRealTimeClockLib

This is designed to be used on platforms where a a real RTC is not
available and relies on an RtcEpochSeconds variable having been set or,
if that is not the case, falls back to using the epoch embedded at
compilation time.

Note that, in order to keep things simple for the setting of the
compilation time variable, only GCC environments with UNIX-like shells
and where a 'date' command is available are meant to be supported for
now.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoUefiCpuPkg/SecCore: Support EFI_PEI_CORE_FV_LOCATION_PPI
Chasel, Chiu [Fri, 15 Feb 2019 09:54:22 +0000 (17:54 +0800)]
UefiCpuPkg/SecCore: Support EFI_PEI_CORE_FV_LOCATION_PPI

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

Previous commit 373c2c5b888d029d7103206556bb85f33d980569,
missed one comment change that should be fixed.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.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 agoUefiCpuPkg/SecCore: Support EFI_PEI_CORE_FV_LOCATION_PPI
Chasel, Chiu [Tue, 12 Feb 2019 12:38:08 +0000 (20:38 +0800)]
UefiCpuPkg/SecCore: Support EFI_PEI_CORE_FV_LOCATION_PPI

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

EFI_PEI_CORE_FV_LOCATION_PPI may be passed by platform
when PeiCore not in BFV so SecCore has to search PeiCore
either from the FV location provided by
EFI_PEI_CORE_FV_LOCATION_PPI or from BFV.

Test: Verified on internal platform and booting successfully.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg/PeiMain: Support EFI_PEI_CORE_FV_LOCATION_PPI
Chasel, Chiu [Tue, 12 Feb 2019 12:29:19 +0000 (20:29 +0800)]
MdeModulePkg/PeiMain: Support EFI_PEI_CORE_FV_LOCATION_PPI

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

When shadowing PeiCore the EFI_PEI_CORE_FV_LOCATION_PPI
should be checked to see if PeiCore not in BFV, otherwise
just shadowing PeiCore from BFV.

Test: Verified on internal platform and booting successfully.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@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: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
5 years agoMdePkg: Support EFI_PEI_CORE_FV_LOCATION_PPI
Chasel, Chiu [Tue, 12 Feb 2019 08:42:26 +0000 (16:42 +0800)]
MdePkg: Support EFI_PEI_CORE_FV_LOCATION_PPI

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

Add EFI_PEI_CORE_FV_LOCATION_PPI definition basing on
PI spec 1.7, Section 6.3.9.
This PPI can support the secnario that PEI Foundation
not in BFV.

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: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
5 years agoBaseTools/build_rule.template: Remove GCCLD
Shenglei Zhang [Mon, 11 Feb 2019 02:16:39 +0000 (10:16 +0800)]
BaseTools/build_rule.template: Remove GCCLD

GCCLD will be unused when UNIXGCC, CYGGCC and ELFGCC
are removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1377

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 agoBaseTools/tools_def.template: Remove DDK3790
Shenglei Zhang [Mon, 28 Jan 2019 02:53:46 +0000 (10:53 +0800)]
BaseTools/tools_def.template: Remove DDK3790

DDK3790 is too old.There is no verification for it.
https://bugzilla.tianocore.org/show_bug.cgi?id=1377

v3:Reserve WINDDK_BIN32 and WINDDK_BIN64.

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 agoBaseTools/tools_def.template: Remove ELFGCC
Shenglei Zhang [Mon, 28 Jan 2019 03:21:00 +0000 (11:21 +0800)]
BaseTools/tools_def.template: Remove ELFGCC

ELFGCC is too old.There is no verification for it.
https://bugzilla.tianocore.org/show_bug.cgi?id=1377

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 agoOvmfPkg/README: Remove UNIXGCC
Shenglei Zhang [Tue, 29 Jan 2019 08:16:36 +0000 (16:16 +0800)]
OvmfPkg/README: Remove UNIXGCC

Remove UNIXGCC in OvmfPkgIa32.dsc, OvmfPkgIa32X64.dsc
and OvmfPkgX64.dsc.
Remove content related to UNIXGCC in README.
https://bugzilla.tianocore.org/show_bug.cgi?id=1377

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoBaseTools/tools_def.template: Remove UNIXGCC
Shenglei Zhang [Mon, 28 Jan 2019 03:01:18 +0000 (11:01 +0800)]
BaseTools/tools_def.template: Remove UNIXGCC

UNIXGCC is too old.There is no verification for it.
https://bugzilla.tianocore.org/show_bug.cgi?id=1377

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: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoOptionRomPkg/ReadMe.txt: Remove VS2005
Shenglei Zhang [Thu, 31 Jan 2019 08:29:34 +0000 (16:29 +0800)]
OptionRomPkg/ReadMe.txt: Remove VS2005

Remove VS2005 in Build Validation.
https://bugzilla.tianocore.org/show_bug.cgi?id=1377

Cc: Ray Ni <ray.ni@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 agoBaseTools/tools_def.template: Remove VS2003 and VS2005
Shenglei Zhang [Thu, 31 Jan 2019 08:24:08 +0000 (16:24 +0800)]
BaseTools/tools_def.template: Remove VS2003 and VS2005

VS2003 and VS2005 are too old.There is no verification
for them.
https://bugzilla.tianocore.org/show_bug.cgi?id=1377

v3:1.Instead of removing MS_VS_BIN, change MS_VS_BIN from
     VS2005_BIN to VS2008_BIN.
   2.Instead of removing MS_VS_DLL, change MS_VS_DLL from
     VS2005_DLL to VS2008_DLL.

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 agoBaseTools: Update MYTOOLS
Shenglei Zhang [Mon, 28 Jan 2019 03:19:50 +0000 (11:19 +0800)]
BaseTools: Update MYTOOLS

Remove MYTOOLS in tools_def.template and change
MYTOOLS to VS2015x86 in target.template.
https://bugzilla.tianocore.org/show_bug.cgi?id=1377

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 agoOptionRomPkg/ReadMe.txt: Remove CYGGCC
Shenglei Zhang [Thu, 31 Jan 2019 08:49:09 +0000 (16:49 +0800)]
OptionRomPkg/ReadMe.txt: Remove CYGGCC

Remove CYGGCC in Build Validation.
https://bugzilla.tianocore.org/show_bug.cgi?id=1377

Cc: Ray Ni <ray.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools/tools_def.template: Remove CYGGCC
Shenglei Zhang [Thu, 31 Jan 2019 08:48:37 +0000 (16:48 +0800)]
BaseTools/tools_def.template: Remove CYGGCC

CYGGCC is too old.There is no verification for it.
https://bugzilla.tianocore.org/show_bug.cgi?id=1377

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 agoMdeModulePkg/SmmS3SaveStateDxe: Change function parameter types
Shenglei Zhang [Wed, 13 Feb 2019 06:34:10 +0000 (14:34 +0800)]
MdeModulePkg/SmmS3SaveStateDxe: Change function parameter types

Change parameter Opcode from UINT16 to UINTN in
BootScriptWrite and BootScriptInsert.
https://bugzilla.tianocore.org/show_bug.cgi?id=1517

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.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: Liming Gao <liming.gao@intel.com>
5 years agoMdeModulePkg/S3SaveStateDxe: Change function parameter types
Shenglei Zhang [Wed, 13 Feb 2019 06:30:43 +0000 (14:30 +0800)]
MdeModulePkg/S3SaveStateDxe: Change function parameter types

Change parameter Opcode from UINT16 to UINTN in
BootScriptWrite and BootScriptInsert.
https://bugzilla.tianocore.org/show_bug.cgi?id=1517

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.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: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg: Change function parameter type
Shenglei Zhang [Fri, 25 Jan 2019 07:52:46 +0000 (15:52 +0800)]
MdePkg: Change function parameter type

Change type of parameter Opcode from UINT16 to UINTN
in EFI_S3_SAVE_STATE_WRITE and EFI_S3_SAVE_STATE_INSERT.
According to PI 1.6(Errata A), the type of Opcode in
EFI_S3_SAVE_STATE_WRITE and EFI_S3_SAVE_STATE_INSERT should
be UINTN not UINT16.
https://bugzilla.tianocore.org/show_bug.cgi?id=1517

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>
5 years agoMdeModulePkg/PciBus: Fix a bug PPB MEM32 BAR isn't restored sometimes
Ray Ni [Fri, 1 Feb 2019 08:51:40 +0000 (16:51 +0800)]
MdeModulePkg/PciBus: Fix a bug PPB MEM32 BAR isn't restored sometimes

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

When a device under PPB contains option ROM but doesn't require 32bit
MMIO, ProgrameUpstreamBridgeForRom() cannot correctly restore the
PPB MEM32 RANGE BAR. It causes the 32bit MMIO conflict which may
cause system hangs in boot.

The root cause is when ProgrameUpstreamBridgeForRom() calls
ProgramPpbApperture() to restore the PPB MEM32 RANGE BAR, the
ProgramPpbApperture() skips to program the BAR when the resource
length is 0.

This patch fixes this issue by not calling ProgramPpbApperture().
Instead, it directly programs the PPB MEM32 RANGE BAR.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
5 years agoMdeModulePkg/PciBus: Correct typos
Ray Ni [Tue, 12 Feb 2019 03:39:02 +0000 (11:39 +0800)]
MdeModulePkg/PciBus: Correct typos

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoMdeModulePkg/PciBus: Change PCI_IO_DEVICE.RomSize to UINT32 type
Ray Ni [Mon, 11 Feb 2019 05:11:57 +0000 (13:11 +0800)]
MdeModulePkg/PciBus: Change PCI_IO_DEVICE.RomSize to UINT32 type

Per PCI Spec, the option ROM BAR is 32bit so the maximum option ROM
size can be hold by UINT32 type.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoSecurityPkg/OpalPassword: Add NULL pointer check before using it
Eric Dong [Thu, 14 Feb 2019 06:53:14 +0000 (14:53 +0800)]
SecurityPkg/OpalPassword: Add NULL pointer check before using it

https://bugzilla.tianocore.org/show_bug.cgi?id=1503
A pointer variable should be checked if it is NULL or Valid before
using it.

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 agoSecurityPkg/OpalPassword: Update strings on Opal Setup page
Eric Dong [Thu, 14 Feb 2019 05:37:27 +0000 (13:37 +0800)]
SecurityPkg/OpalPassword: Update strings on Opal Setup page

https://bugzilla.tianocore.org/show_bug.cgi?id=1506
Updated some descriptions on SETUP page to avoid user confusion.
Currently it shows "1.0 UEFI Opal Driver", however it may be mislead user to think
it is only for Opal drive but not for Pyrite drive.

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 agoBaseTools: Various typo
Antoine Coeur [Wed, 6 Feb 2019 07:44:39 +0000 (15:44 +0800)]
BaseTools: Various typo

Various typo in BaseTools.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Coeur <coeur@gmx.fr>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdeModulePkg/CapsuleApp: Fix memory leak issue.
Chen A Chen [Mon, 11 Feb 2019 05:42:19 +0000 (13:42 +0800)]
MdeModulePkg/CapsuleApp: Fix memory leak issue.

This issue is caused by FileInfoBuffer variable. This is a pointer array
and each elements also pointer to a memory buffer that is allocated and
returned by AllocateCopyPool function.

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>
Cc: Liming Gao <liming.gao@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 agoArmVirtPkg/ArmVirtXen: don't set Pcd*ImageVerificationPolicy
Laszlo Ersek [Wed, 6 Feb 2019 09:08:53 +0000 (10:08 +0100)]
ArmVirtPkg/ArmVirtXen: don't set Pcd*ImageVerificationPolicy

According to the

  PCDs not used by modules or in conditional directives

sections of all the build reports for

  {AARCH64,ARM} x {Xen} x {DEBUG,NOOPT,RELEASE} x {feat-1}

(6 builds in total), PcdOptionRomImageVerificationPolicy,
PcdFixedMediaImageVerificationPolicy, and
PcdRemovableMediaImageVerificationPolicy are not used in any of those
builds.

Restrict the settings to the ArmVirtQemu and ArmVirtQemuKernel platforms
(preserving the -D SECURE_BOOT_ENABLE restriction in the process).

("feat-1" stands for "-D HTTP_BOOT_ENABLE -D NETWORK_IP6_ENABLE -D
SECURE_BOOT_ENABLE -D TTY_TERMINAL", while "feat-0" stands for "".)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoArmVirtPkg/ArmVirtXen: don't set PcdTurnOffUsbLegacySupport
Laszlo Ersek [Wed, 6 Feb 2019 09:08:53 +0000 (10:08 +0100)]
ArmVirtPkg/ArmVirtXen: don't set PcdTurnOffUsbLegacySupport

According to the

  PCDs not used by modules or in conditional directives

sections of all the build reports for

  {AARCH64,ARM} x {Xen} x {DEBUG,NOOPT,RELEASE} x {feat-0,feat-1}

(12 builds in total), the PCD is not used in any of those builds. Restrict
the setting to the ArmVirtQemu and ArmVirtQemuKernel platforms.

("feat-1" stands for "-D HTTP_BOOT_ENABLE -D NETWORK_IP6_ENABLE -D
SECURE_BOOT_ENABLE -D TTY_TERMINAL", while "feat-0" stands for "".)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoArmVirtPkg/ArmVirtXen: don't set PcdShellFile
Laszlo Ersek [Wed, 6 Feb 2019 09:08:53 +0000 (10:08 +0100)]
ArmVirtPkg/ArmVirtXen: don't set PcdShellFile

According to the

  PCDs not used by modules or in conditional directives

sections of all the build reports for

  {AARCH64,ARM} x {Xen} x {DEBUG,NOOPT,RELEASE} x {feat-0,feat-1}

(12 builds in total), the PCD is not used in any of those builds. Remove
the setting.

("feat-1" stands for "-D HTTP_BOOT_ENABLE -D NETWORK_IP6_ENABLE -D
SECURE_BOOT_ENABLE -D TTY_TERMINAL", while "feat-0" stands for "".)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoArmVirtPkg/ArmVirtXen: don't set PcdTerminalTypeGuidBuffer
Laszlo Ersek [Wed, 6 Feb 2019 09:08:53 +0000 (10:08 +0100)]
ArmVirtPkg/ArmVirtXen: don't set PcdTerminalTypeGuidBuffer

According to the

  PCDs not used by modules or in conditional directives

sections of all the build reports for

  {AARCH64,ARM} x {Xen} x {DEBUG,NOOPT,RELEASE} x {feat-0,feat-1}

(12 builds in total), the PCD is not used in any of those builds.

Restrict the setting to the ArmVirtQemu and ArmVirtQemuKernel platforms.
Restrict the TTY_TERMINAL define similarly.

("feat-1" stands for "-D HTTP_BOOT_ENABLE -D NETWORK_IP6_ENABLE -D
SECURE_BOOT_ENABLE -D TTY_TERMINAL", while "feat-0" stands for "".)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoArmVirtPkg/ArmVirtXen: don't set PcdPL031RtcBase
Laszlo Ersek [Wed, 6 Feb 2019 09:08:53 +0000 (10:08 +0100)]
ArmVirtPkg/ArmVirtXen: don't set PcdPL031RtcBase

According to the

  PCDs not used by modules or in conditional directives

sections of all the build reports for

  {AARCH64,ARM} x {Xen} x {DEBUG,NOOPT,RELEASE} x {feat-0,feat-1}

(12 builds in total), the PCD is not used in any of those builds. Remove
the setting.

("feat-1" stands for "-D HTTP_BOOT_ENABLE -D NETWORK_IP6_ENABLE -D
SECURE_BOOT_ENABLE -D TTY_TERMINAL", while "feat-0" stands for "".)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoArmVirtPkg: don't set PcdDebugPrintErrorLevel in RELEASE builds
Laszlo Ersek [Wed, 6 Feb 2019 09:08:53 +0000 (10:08 +0100)]
ArmVirtPkg: don't set PcdDebugPrintErrorLevel in RELEASE builds

According to the

  PCDs not used by modules or in conditional directives

sections of all the build reports for

  {AARCH64,ARM} x {Qemu,QemuKernel,Xen} x {RELEASE} x {feat-0,feat-1}

(12 builds in total), the PCD is not used in any of those builds. Restrict
the PCD setting to ($(TARGET) != RELEASE).

("feat-1" stands for "-D HTTP_BOOT_ENABLE -D NETWORK_IP6_ENABLE -D
SECURE_BOOT_ENABLE -D TTY_TERMINAL", while "feat-0" stands for "".)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoArmVirtPkg: don't set PcdDebugClearMemoryValue
Laszlo Ersek [Wed, 6 Feb 2019 09:08:53 +0000 (10:08 +0100)]
ArmVirtPkg: don't set PcdDebugClearMemoryValue

According to the

  PCDs not used by modules or in conditional directives

sections of all the build reports for

  {AARCH64,ARM} x {Qemu,QemuKernel,Xen} x {RELEASE} x {feat-0,feat-1}

(12 builds in total), the PCD is not used in any of those builds.

Rather than just restrict the PCD setting to ($(TARGET) != RELEASE),
remove the setting completely. The current value is identical to the 0xAF
default in "MdePkg/MdePkg.dec", which recognizes Andrew Fish, and so it's
unlikely to ever change.

("feat-1" stands for "-D HTTP_BOOT_ENABLE -D NETWORK_IP6_ENABLE -D
SECURE_BOOT_ENABLE -D TTY_TERMINAL", while "feat-0" stands for "".)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoArmVirtPkg: don't set PcdCoreCount
Laszlo Ersek [Tue, 5 Feb 2019 23:17:24 +0000 (00:17 +0100)]
ArmVirtPkg: don't set PcdCoreCount

According to the

  PCDs not used by modules or in conditional directives

sections of all the build reports for

  {AARCH64,ARM} x
  {Qemu,QemuKernel,Xen} x
  {DEBUG,NOOPT,RELEASE} x
  {feat-0,feat-1}

(36 builds in total), the PCD is not used in any of those builds. Remove
the setting.

("feat-1" stands for "-D HTTP_BOOT_ENABLE -D NETWORK_IP6_ENABLE -D
SECURE_BOOT_ENABLE -D TTY_TERMINAL", while "feat-0" stands for "".)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoArmVirtPkg/PrePi: drop wrong PcdCoreCount dependency
Laszlo Ersek [Wed, 6 Feb 2019 00:14:52 +0000 (01:14 +0100)]
ArmVirtPkg/PrePi: drop wrong PcdCoreCount dependency

The PcdCoreCount dependency in the "ArmVirtPrePiUniCoreRelocatable.inf"
file is false; the module doesn't consume the PCD. Clean up the INF.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoArmVirtPkg: clean up PcdSetNxForStack setting (applies to ArmVirtQemu only)
Laszlo Ersek [Tue, 5 Feb 2019 23:58:56 +0000 (00:58 +0100)]
ArmVirtPkg: clean up PcdSetNxForStack setting (applies to ArmVirtQemu only)

According to the

  PCDs not used by modules or in conditional directives

sections of all the build reports for

  {AARCH64,ARM} x
  {QemuKernel,Xen} x
  {DEBUG,NOOPT,RELEASE} x
  {feat-0,feat-1}

(24 builds in total), the PCD is not used in any of those builds.

Move the setting from "ArmVirt.dsc.inc" to "ArmVirtQemu.dsc", to reflect
reality.

We originally moved the PCD setting in the opposite direction in commit
8aab575c26e9 ("ArmVirtPkg: enable non-executable DXE stack for all
platforms", 2017-03-07), generalizing it. However, as the comment itself
states, and according to all 36 ArmVirt build reports:

  {AARCH64,ARM} x
  {Qemu,QemuKernel,Xen} x
  {DEBUG,NOOPT,RELEASE} x
  {feat-0,feat-1}

the PCD is only consumed by "MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf", and
that module is only included in the ArmVirtQemu platform.

("feat-1" stands for "-D HTTP_BOOT_ENABLE -D NETWORK_IP6_ENABLE -D
SECURE_BOOT_ENABLE -D TTY_TERMINAL", while "feat-0" stands for "".)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoArmVirtPkg: don't set PcdPostCodePropertyMask
Laszlo Ersek [Tue, 5 Feb 2019 23:17:24 +0000 (00:17 +0100)]
ArmVirtPkg: don't set PcdPostCodePropertyMask

According to the

  PCDs not used by modules or in conditional directives

sections of all the build reports for

  {AARCH64,ARM} x
  {Qemu,QemuKernel,Xen} x
  {DEBUG,NOOPT,RELEASE} x
  {feat-0,feat-1}

(36 builds in total), the PCD is not used in any of those builds. Remove
the setting.

("feat-1" stands for "-D HTTP_BOOT_ENABLE -D NETWORK_IP6_ENABLE -D
SECURE_BOOT_ENABLE -D TTY_TERMINAL", while "feat-0" stands for "".)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoArmVirtPkg/{ArmVirtQemu,ArmVirtQemuKernel}: don't set PcdTrustzoneSupport
Laszlo Ersek [Tue, 5 Feb 2019 23:32:47 +0000 (00:32 +0100)]
ArmVirtPkg/{ArmVirtQemu,ArmVirtQemuKernel}: don't set PcdTrustzoneSupport

According to the

  PCDs not used by modules or in conditional directives

sections of all the build reports for

  {AARCH64,ARM} x
  {Qemu,QemuKernel} x
  {DEBUG,NOOPT,RELEASE} x
  {feat-0,feat-1}

(24 builds in total), the PCD is not used in any of those builds. Remove
the setting.

("feat-1" stands for "-D HTTP_BOOT_ENABLE -D NETWORK_IP6_ENABLE -D
SECURE_BOOT_ENABLE -D TTY_TERMINAL", while "feat-0" stands for "".)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoArmVirtPkg: don't set PcdRelocateVectorTable
Laszlo Ersek [Tue, 5 Feb 2019 23:17:24 +0000 (00:17 +0100)]
ArmVirtPkg: don't set PcdRelocateVectorTable

According to the

  PCDs not used by modules or in conditional directives

sections of all the build reports for

  {AARCH64,ARM} x
  {Qemu,QemuKernel,Xen} x
  {DEBUG,NOOPT,RELEASE} x
  {feat-0,feat-1}

(36 builds in total), the PCD is not used in any of those builds. Remove
the setting.

("feat-1" stands for "-D HTTP_BOOT_ENABLE -D NETWORK_IP6_ENABLE -D
SECURE_BOOT_ENABLE -D TTY_TERMINAL", while "feat-0" stands for "".)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoArmVirtPkg/ArmVirtQemuKernel: don't set PcdCPUCoresStackBase
Laszlo Ersek [Tue, 5 Feb 2019 23:05:05 +0000 (00:05 +0100)]
ArmVirtPkg/ArmVirtQemuKernel: don't set PcdCPUCoresStackBase

According to the

  PCDs not used by modules or in conditional directives

sections of all the build reports for

  {AARCH64,ARM} x {QemuKernel} x {DEBUG,NOOPT,RELEASE} x {feat-0,feat-1}

(12 builds in total), the PCD is not used in any of those builds. Remove
the setting.

("feat-1" stands for "-D HTTP_BOOT_ENABLE -D NETWORK_IP6_ENABLE -D
SECURE_BOOT_ENABLE -D TTY_TERMINAL", while "feat-0" stands for "".)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoMdeModulePkg/NvmExpressDxe: Report StatusCode for device init failure
Sean Brogan [Mon, 11 Feb 2019 07:57:26 +0000 (15:57 +0800)]
MdeModulePkg/NvmExpressDxe: Report StatusCode for device init failure

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

According to the information of the above BZ-1408 and other platform
owners, NVM Express devices are becoming more likely to be a critical
part during the boot process.

This commit will add the calls to 'REPORT_STATUS_CODE' when there is a
failure happens during the NVM Express controller/device initialization
process.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <brbarkel@microsoft.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
5 years agoMdePkg/BaseLib: implement SpeculationBarrier() for ARM and AArch64
Ard Biesheuvel [Wed, 6 Feb 2019 00:08:22 +0000 (00:08 +0000)]
MdePkg/BaseLib: implement SpeculationBarrier() for ARM and AArch64

Replace the dummy C implementation of SpeculationBarrier() with
implementations consisting of the recommended DSB SY + ISB sequence,
as recommended by ARM in the whitepaper "Cache Speculation Side-channels"
version 2.4, dated October 2018.

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 agoMdeModulePkg/CapsuleApp: Fix potential NULL pointer dereference issue
Chen A Chen [Mon, 11 Feb 2019 06:07:29 +0000 (14:07 +0800)]
MdeModulePkg/CapsuleApp: Fix potential NULL pointer dereference issue

To avoid potential NULL pointer dereference issue. Initialize them at
the beginning of the function. This patch is a supplement which was missed
at e98212cb5d59fff8f385d9179ad7f1a3ce9cf215 commit.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Liming Gao <liming.gao@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 agoCorebootModulePkg: Fix various typos
Antoine Coeur [Wed, 6 Feb 2019 16:46:58 +0000 (00:46 +0800)]
CorebootModulePkg: Fix various typos

Fix various typos in CorebootModulePkg.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Coeur <coeur@gmx.fr>
Reviewed-by: Benjamin You <benjamin.you@intel.com>
5 years agoCorebootPayloadPkg: Fix various typos
Antoine Coeur [Wed, 6 Feb 2019 16:48:41 +0000 (00:48 +0800)]
CorebootPayloadPkg: Fix various typos

Fix various typos in CorebootPayloadPkg.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Coeur <coeur@gmx.fr>
Reviewed-by: Benjamin You <benjamin.you@intel.com>
5 years agoNetworkPkg/Ip6Dxe: Uninstall protocols when error happen in Driver Binding Start.
Jiaxin Wu [Fri, 25 Jan 2019 00:53:48 +0000 (08:53 +0800)]
NetworkPkg/Ip6Dxe: Uninstall protocols when error happen in Driver Binding Start.

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

This patch is to uninstall Ip6ServiceBindingProtocol and Ip6ConfigProtocol when
error happen in Driver Binding Start.

Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Signed-off-by: Michael Turner <Michael.Turner@microsoft.com>
Reviewed-By: Ye Ting <ting.ye@intel.com>
5 years agoMdeModulePkg/Ip4Dxe: Uninstall protocols when error happen in Driver Binding Start.
Jiaxin Wu [Fri, 25 Jan 2019 00:54:00 +0000 (08:54 +0800)]
MdeModulePkg/Ip4Dxe: Uninstall protocols when error happen in Driver Binding Start.

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

This patch is to uninstall Ip4ServiceBindingProtocol and Ip4Config2Protocol when
error happen in Driver Binding Start.

Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Signed-off-by: Michael Turner <Michael.Turner@microsoft.com>
Reviewed-By: Ye Ting <ting.ye@intel.com>
5 years agoOvmfPkg: Add TCG2 Configuration menu to the Device Manager menu
Stefan Berger [Fri, 25 Jan 2019 21:30:29 +0000 (16:30 -0500)]
OvmfPkg: Add TCG2 Configuration menu to the Device Manager menu

This patch adds the TCG2 Configuration menu to the Device Manager
menu. We can apparently reuse the sample Tcg2ConfigDxe from
SecurityPkg/Tcg/Tcg2Config without obvious adverse effects. The
added TCG2 Configuration menu now shows details about the attached
TPM 2.0 and lets one for example configure the active PCR banks
or issue commands, among other things.

The code is added to Ovmf by building with -DTPM2_ENABLE and
-DTPM2_CONFIG_ENABLE.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
5 years agoMdeModulePkg DxeCapsuleLibFmp: Update SupportCapsuleImage() for Fake Capsule
Liming Gao [Mon, 14 Jan 2019 02:31:27 +0000 (10:31 +0800)]
MdeModulePkg DxeCapsuleLibFmp: Update SupportCapsuleImage() for Fake Capsule

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1088
Per UEFI spec, the fake capsule image with the header only is a valid case
in QueryCapsuleCpapbilities(). So, SupportCapsuleImage() is updated to
support this case.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
5 years agoCryptoPkg: Fix various typos
Antoine Coeur [Mon, 11 Feb 2019 03:09:44 +0000 (11:09 +0800)]
CryptoPkg: Fix various typos

Fix various typos in CryptoPkg.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Coeur <coeur@gmx.fr>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
5 years agoArmVirtPkg: Fix various typos
Antoine Coeur [Wed, 6 Feb 2019 15:48:50 +0000 (16:48 +0100)]
ArmVirtPkg: Fix various typos

Fix various typos in ArmVirtPkg.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Coeur <coeur@gmx.fr>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
5 years agoBaseTools: Fix build failure when specifying multiple BUILDTARGET
Philippe Mathieu-Daud? [Wed, 6 Feb 2019 12:03:44 +0000 (04:03 -0800)]
BaseTools: Fix build failure when specifying multiple BUILDTARGET

With Python3, the dict.value() method returns an iterator.
If a dictionary is updated while an iterator on its keys is used,
a RuntimeError is generated.
Converting the iterator to a list() forces a copy of the mutable
keys in an immutable list which can be safely iterated.

Commit f8d11e5a4aaa converted various uses but missed one:
When specifying multiple BUILDTARGET, the first target builds
successfully, but then the PGen.BuildDatabase._CACHE_ dictionary is
updated, and accessing the next target triggers a RuntimeError.

Convert this iterator to an immutable list, to solve this build error:

    $ build -a IA32 -t GCC5 -b RELEASE -b NOOPT -p OvmfPkg/OvmfPkgIa32.dsc
    [...]
    Processing meta-data ...
    build.py...
     : error C0DE: Unknown fatal error when processing [OvmfPkg/OvmfPkgIa32.dsc]

    (Please send email to edk2-devel@lists.01.org for help, attaching following call stack trace!)

    (Python 3.5.3 on linux) Traceback (most recent call last):
      File "BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line 2387, in Main
        MyBuild.Launch()
      File "BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line 2141, in Launch
        self._MultiThreadBuildPlatform()
      File "BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line 1921, in _MultiThreadBuildPlatform
        self.Progress
      File "BaseTools/Source/Python/AutoGen/AutoGen.py", line 304, in __init__
        self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs)
      File "BaseTools/Source/Python/AutoGen/AutoGen.py", line 477, in _InitWorker
        for BuildData in PGen.BuildDatabase._CACHE_.values():
    RuntimeError: dictionary changed size during iteration

Note: The culprit commit (f8d11e5a4aaa) can not be found with bisection.
In 9c2d68c0a299 the build tools default to the python version provided
by the ${PYTHON} environment variable, however the Python3 transition is
not functional before d943b0c339fef8d11e5a4aaa falls between the
previous two.

Reported-by: Leif Lindholm <leif.lindholm@linaro.org>
Fixes: f8d11e5a4aaa90bf63b4789f3993dd6d16c60787
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoBaseTools/BuildReport: fix report for platforms/arches without struct PCDs
Laszlo Ersek [Tue, 5 Feb 2019 11:22:13 +0000 (03:22 -0800)]
BaseTools/BuildReport: fix report for platforms/arches without struct PCDs

The goal of commit 97c8f5b9e7d3 ("BaseTools:StructurePCD value display
incorrect in "Not used" section.", 2019-02-02) was to display the full
contents of such structure PCDs in the build report that were set in the
platform DSC or the FDF, but not used in any module INFs. The listings
would appear in the

  PCDs not used by modules or in conditional directives

section of the build report.

Commit 97c8f5b9e7d3 assumed that any (platform, architecture) combination
would have a (possibly empty) set of structure PCD (and so the set of the
structure PCDs could be filtered for set-but-unused ones).

This is not the case: in "DscBuildData.py", in method
UpdateStructuredPcds(), if "S_pcd_set" remains an empty OrderedDict(),
then it is not added to "GlobalData.gStructurePcd" *at all*, for the
current (platform, architecture) combination.

As a result, when the PCD report tries to fetch the set of structure PCDs
for the current (platform, architecture), "GlobalData.gStructurePcd" does
not return an empty OrderedDict(); instead, it raises a KeyError. Fix it
by defaulting to an empty OrderedDict(), with the get() method.

Reported-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1513
Fixes: 97c8f5b9e7d3136b6051a05cf056ce5ca9e79893
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoSignedCapsulePkg: enable package build for AARCH64/ARM
Leif Lindholm [Thu, 1 Nov 2018 15:07:48 +0000 (15:07 +0000)]
SignedCapsulePkg: enable package build for AARCH64/ARM

This package is used by several platforms in edk2-platforms, so ensure it
can be built directly by adding AARCH64/ARM to SUPPORTED_ARCHITECTURES.

Also force-include CompilerIntrinsicsLib, BaseStackCheckLib and create a
resolution for ArmSoftFloatLib for ARM.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: jiewen.yao@intel.com
5 years agoSecurityPkg: fix package build on ARM
Leif Lindholm [Thu, 1 Nov 2018 15:06:11 +0000 (15:06 +0000)]
SecurityPkg: fix package build on ARM

The CompilerIntrinsicsLib and BaseStackCheckLib need to be included in
order for an ARM build of the package .dsc to succeed - so add them.

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: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: jiewen.yao@intel.com
5 years agoIntelFrameworkPkg: fix build for AARCH64/ARM
Leif Lindholm [Thu, 1 Nov 2018 15:01:48 +0000 (15:01 +0000)]
IntelFrameworkPkg: fix build for AARCH64/ARM

Contrary to what the name suggests, some modules in this package are used
on other architecture. ARM is already listed in SUPPORTED_ARCHITECTURES
in the .dsc, but AARCH64 was never added - so do that.

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: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>