]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
8 years agoCryptoPkg/OpensslLib: Switch to upstream fix for OpenSSL RT#3955
Qin Long [Sat, 5 Mar 2016 15:39:47 +0000 (23:39 +0800)]
CryptoPkg/OpensslLib: Switch to upstream fix for OpenSSL RT#3955

A different fix for the excessive stack usage has been merged into
OpenSSL 1.1 as commit 8e704858f. Drop our own version and use a backport
of what was committed upstream.

Note: This requires the free() function to work correctly when passed
      a NULL argument (qv).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
Tested-by: Qin Long <qin.long@intel.com>
8 years agoCryptoPkg/OpensslLib: Switch to upstream fix for OpenSSL RT#3628
Qin Long [Sat, 5 Mar 2016 15:38:51 +0000 (23:38 +0800)]
CryptoPkg/OpensslLib: Switch to upstream fix for OpenSSL RT#3628

A complete implementation of the no-filenames configuration option was
added to OpenSSL 1.1 in commit 02f7114a7. Drop our own version and use
a backport of what was committed upstream.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
Tested-by: Qin Long <qin.long@intel.com>
8 years agoCryptoPkg/OpensslLib: Switch to upstream fix for OpenSSL RT#3964
Qin Long [Sat, 5 Mar 2016 15:37:42 +0000 (23:37 +0800)]
CryptoPkg/OpensslLib: Switch to upstream fix for OpenSSL RT#3964

Extensive fixes for the no-stdio configuration have been merged into
OpenSSL 1.1, primarily in commit 984d6c605.

The backport to 1.0.2 is slightly different because we still have a
mixture of no-fp-api and no-stdio in 1.0.2, although they are hopelessly
intertwined. Nevertheless, drop our own original version and switch to
a backported version of what went into 1.1.

This includes subsequent fixes in commit c0cf5b84d for the TS code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
Tested-by: Qin Long <qin.long@intel.com>
8 years agoCryptoPkg/OpensslLib: Switch to upstream fix for OpenSSL RT#4175
Qin Long [Sat, 5 Mar 2016 15:36:37 +0000 (23:36 +0800)]
CryptoPkg/OpensslLib: Switch to upstream fix for OpenSSL RT#4175

A different fix for the PKCS7_verify() regression on Authenticode
signatures has landed in the OpenSSL 1.0.2 branch as commit c436c990f
and will be present in the 1.0.2g release.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
Tested-by: Qin Long <qin.long@intel.com>
8 years agoCryptoPkg/OpensslLib: Regenerate OpenSSL patch
Qin Long [Sat, 5 Mar 2016 15:35:04 +0000 (23:35 +0800)]
CryptoPkg/OpensslLib: Regenerate OpenSSL patch

All the OpenSSL changes we carry in our EDKII_openssl patch for 1.0.2
are now merged into upstream OpenSSL and will be in the upcoming 1.1
release.

As a first step towards switching out our original hacks for backported
versions of the commits which were actually accepted into OpenSSL 1.1,
just regenerate the *existing* patch against the 1.0.2f release using
'git diff'.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
Tested-by: Qin Long <qin.long@intel.com>
8 years agoCryptoPkg/OpensslLib: Include complete copy of opensslconf.h
Qin Long [Sat, 5 Mar 2016 15:33:59 +0000 (23:33 +0800)]
CryptoPkg/OpensslLib: Include complete copy of opensslconf.h

This can be an auto-generated file, and it *isn't* in the OpenSSL git tree;
it's only in the generated tarballs. So rather than including it in our
OpenSSL patch, just have the user copy it into place.

This makes it easier to manage changes, and is a step towards better
integration.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
Tested-by: Qin Long <qin.long@intel.com>
8 years agoCryptoPkg: Use OpenSSL include directory directly
Qin Long [Sat, 5 Mar 2016 15:32:55 +0000 (23:32 +0800)]
CryptoPkg: Use OpenSSL include directory directly

The standard OpenSSL 1.0.2 configuration and build process will already
symlink or copy the necessary header files to the include/openssl/
directory within the OpenSSL source tree.

When we transition to OpenSSL 1.1 it won't even be necessary to link
or copy the files there; they have just been moved outright.

So let's use them from there. Change the include directory specified
in CryptoPkg/CryptoPkg.dec, and modify the Install.cmd and Install.sh
scripts to copy the files to the normal directory within the OpenSSL
source tree, instead of CryptoPkg/Include/openssl/.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
Tested-by: Qin Long <qin.long@intel.com>
8 years agoShellPkg: Fix smbiosview decode of PCIe Extended Capabilities
Samer El-Haj-Mahmoud [Fri, 4 Mar 2016 03:31:45 +0000 (19:31 -0800)]
ShellPkg: Fix smbiosview decode of PCIe Extended Capabilities

Fix SMBIOSVIEW decode of the HeaderLog fields of the PCIe
AER structure . The PCIe 2.1 Base Specification, section 7.10, lists
this as 16 bytes, or 4 DWORDs.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
8 years agoMdeModulePkg AcpiTableDxe: Don't uninstall Acpi Sdt Protocol at ReadyToLock
Star Zeng [Thu, 3 Mar 2016 08:49:54 +0000 (16:49 +0800)]
MdeModulePkg AcpiTableDxe: Don't uninstall Acpi Sdt Protocol at ReadyToLock

1. The consumer of Acpi Sdt Protocol may want to use the API after ReadyToLock.
2. The ACPI system configuration table even could be overwritten,
   we see little issue in leaving Acpi Sdt Protocol installed.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
8 years agoMdeModulePkg/PciHostBridge: Don't assert when setting UC to MMIO fails
Ruiyu Ni [Fri, 4 Mar 2016 05:04:21 +0000 (13:04 +0800)]
MdeModulePkg/PciHostBridge: Don't assert when setting UC to MMIO fails

Failing to set EFI_MEMORY_UC to MMIO aperture is not a fatal error.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
8 years agoSecurityPkg/SecureBootConfigDxe: Handle allocation failure gracefully
Dandan Bi [Mon, 29 Feb 2016 06:37:07 +0000 (14:37 +0800)]
SecurityPkg/SecureBootConfigDxe: Handle allocation failure gracefully

The function AllocateCopyPool may return NULL, so need to do check
after calling it. This patch is to enhance the related logic.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Qiu Shumin <shumin.qiu@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
8 years agoMdeModulePkg/Bds: Support booting from remote file system.
Ruiyu Ni [Wed, 24 Feb 2016 07:15:02 +0000 (15:15 +0800)]
MdeModulePkg/Bds: Support booting from remote file system.

Enhance BDS to support booting from a remote file system exposed
by a HTTP boot option.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
8 years agoMdeModulePkg/Bds: Support short-form URI boot.
Ruiyu Ni [Wed, 24 Feb 2016 07:04:44 +0000 (15:04 +0800)]
MdeModulePkg/Bds: Support short-form URI boot.

The patch adds short-form URI boot support to follow
UEFI Spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
8 years agoMdeModulePkg/Bds: Wide match HTTP boot option.
Ruiyu Ni [Wed, 24 Feb 2016 06:47:34 +0000 (14:47 +0800)]
MdeModulePkg/Bds: Wide match HTTP boot option.

Enhance BDS to wide match the HTTP boot option without matching
the specific device path data in IP device path and URI device
path node.
It's to follow UEFI Spec 2.6.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
8 years agoMdeModulePkg/Bds: Refine the code to load file from FV.
Ruiyu Ni [Mon, 11 Jan 2016 06:14:26 +0000 (14:14 +0800)]
MdeModulePkg/Bds: Refine the code to load file from FV.

Change BmGetFileBufferByMemmapFv to BmGetFileBufferByFvFilePath.
The original function gets the file buffer only from memory mapped
FV device path and leaves GUIDed FV device path to the code below;
The new function gets the file buffer from both formats of FV device
paths.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
8 years agoMdeModulePkg: Fix IPv4 double free
Samer El-Haj-Mahmoud [Fri, 4 Mar 2016 07:18:49 +0000 (15:18 +0800)]
MdeModulePkg: Fix IPv4 double free

Fix a possible ASSERT after NBP finishes loading from a PXE
boot. Ip4Dxe driver calls Ip4Config2SetPolicy which calls
CloseEvent on the Dhcp4Event struct member.  After NBP is
downloaded, it then calls Ip4Config2CleanInstance which calls
CloseEvent again on Dhcp4Event.  This double free can cause an
ASSERT. When the event is closed, set the event pointer to NULL
so the Ip4 code won't call CloseEvent on it again.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
8 years agoMdeModulePkg: Make HII configuration settings available to OS runtime
Dandan Bi [Wed, 2 Mar 2016 08:53:50 +0000 (16:53 +0800)]
MdeModulePkg: Make HII configuration settings available to OS runtime

This feature is aimed to allow OS make use of the HII database
during runtime. In this case, the contents of the HII Database
is exported to a buffer. The pointer to the buffer is placed
in the EFI System Configuration Table, where it can be retrieved
by an OS application.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Brian J. Johnson <bjohnson@sgi.com>
Cc: Andrew Fish <afish@apple.com>
Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
8 years agoMdeModulePkg/DisplayEngineDxe: Refine the coding style
Dandan Bi [Thu, 3 Mar 2016 08:51:51 +0000 (16:51 +0800)]
MdeModulePkg/DisplayEngineDxe: Refine the coding style

Remove the empty line to conform with current coding style.

Cc: Qiu Shumin <shumin.qiu@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
8 years agoUefiCpuPkg: Add dynamic type for PcdCpuMaxLogicalProcessorNumber
Jeff Fan [Thu, 3 Mar 2016 07:25:26 +0000 (15:25 +0800)]
UefiCpuPkg: Add dynamic type for PcdCpuMaxLogicalProcessorNumber

Currently, PcdCpuMaxLogicalProcessorNumber only supports fixed type. There are
some requests on this PCD to support dynamic type also. For example, platform
may dynamically set this PCD to actual processor count to save memory or improve
boot performance.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
8 years agoArmPkg: Configure TTBCR register
Evan Lloyd [Wed, 2 Mar 2016 21:08:46 +0000 (21:08 +0000)]
ArmPkg: Configure TTBCR register

Architecturally, the TTBCR register value is undefined at reset for
Non-Secure.
On some platforms the reset value for TTBCR is not zero and
this causes a data abort exception once the MMU is enabled.

This patch configures the TTBCR register to enable translation table
walk using TTBR0.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
8 years agoMdeModulePkg/PciHostBridgeLib: Correct the function header comments
Ruiyu Ni [Thu, 3 Mar 2016 09:47:52 +0000 (17:47 +0800)]
MdeModulePkg/PciHostBridgeLib: Correct the function header comments

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Shumin Qiu <shumin.qiu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
8 years agoOvmfPkg: switch to MdeModulePkg/Bus/Pci/PciHostBridgeDxe
Laszlo Ersek [Tue, 26 Jan 2016 00:18:36 +0000 (01:18 +0100)]
OvmfPkg: switch to MdeModulePkg/Bus/Pci/PciHostBridgeDxe

The old driver is retained for now; it remains available with "-D
USE_OLD_PCI_HOST". This is because I'd like to involve end users and
downstreams in testing the new drier, but also allow them to switch back
to the old driver at the first sight of trouble, while we debug the new
driver in parallel.

In a few weeks the ifdeffery and the "OvmfPkg/PciHostBridgeDxe/" driver
should be removed.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOvmfPkg: resolve PciSegmentLib
Laszlo Ersek [Tue, 26 Jan 2016 00:29:24 +0000 (01:29 +0100)]
OvmfPkg: resolve PciSegmentLib

In the next patch we'll build "MdeModulePkg/Bus/Pci/PciHostBridgeDxe".
That driver depends on the PciSegmentLib class. Edk2 offers four
instances:

(1) MdePkg/Library/UefiPciSegmentLibPciRootBridgeIo/

    Inappropriate here because it consumes
    EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL, but
    "MdeModulePkg/Bus/Pci/PciHostBridgeDxe" needs the library class for
    producing that protocol.

(2) MdePkg/Library/PeiPciSegmentLibPciCfg2/

    Restricted to PEIM, SEC, and PEI_CORE client modules.

(3) MdePkg/Library/DxePciSegmentLibEsal/

    "uses ESAL services to perform PCI Configuration cycles"

(4) MdePkg/Library/BasePciSegmentLibPci/

    A simple BASE library instance that sits on top of PciLib. This is our
    choice. We can resolve PciSegmentLib to this instance for all module
    types.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOvmfPkg: PciHostBridgeLib: initialize RootBus->DevicePath
Laszlo Ersek [Mon, 25 Jan 2016 23:52:05 +0000 (00:52 +0100)]
OvmfPkg: PciHostBridgeLib: initialize RootBus->DevicePath

We copy the code from InitRootBridge()
[OvmfPkg/PciHostBridgeDxe/PciHostBridge.c], with a slight change: the
device path is allocated separately now.

This is the final field to initialize in PCI_ROOT_BRIDGE.

The type EFI_PCI_ROOT_BRIDGE_DEVICE_PATH is renamed to
OVMF_PCI_ROOT_BRIDGE_DEVICE_PATH. The original is a misnomer (it is not a
standard UEFI type) that dates back to PcAtChipsetPkg/PciHostBridgeDxe.
Simply removing the EFI_ suffix would result in
PCI_ROOT_BRIDGE_DEVICE_PATH, where PCI_ could incorrectly suggest a
relation with the PCI standards or the PCI-related generic edk2 code.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOvmfPkg: PciHostBridgeLib: set RootBus->NoExtendedConfigSpace
Laszlo Ersek [Fri, 26 Feb 2016 23:06:39 +0000 (00:06 +0100)]
OvmfPkg: PciHostBridgeLib: set RootBus->NoExtendedConfigSpace

In "OvmfPkg/PciHostBridgeDxe/PciRootBridgeIo.c", the
RootBridgeIoCheckParameter() function hard-codes the maximum offset for
the PCI config space as 0xFF (see the MAX_PCI_REG_ADDRESS macro), which
matches OVMF's 0xCF8 / 0xCFC config access method.

The "MdeModulePkg/Bus/Pci/PciHostBridgeDxe" driver abstracts away config
space access via the PciSegmentLib class, so it has to be informed
separately about the config space size.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOvmfPkg: PciHostBridgeLib: set bus, IO and 32-bit MMIO windows in RootBus
Laszlo Ersek [Mon, 25 Jan 2016 23:36:46 +0000 (00:36 +0100)]
OvmfPkg: PciHostBridgeLib: set bus, IO and 32-bit MMIO windows in RootBus

The bus aperture is copied verbatim from InitRootBridge()
[OvmfPkg/PciHostBridgeDxe/PciHostBridge.c].

The IO and 32-bit MMIO apertures are matched to PlatformPei's settings.
PciHostBridgeLibDxe expects PciHostBridgeLib instances to advertize the
exact apertures.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOvmfPkg: PciHostBridgeLib: set RootBus->AllocationAttributes
Laszlo Ersek [Mon, 25 Jan 2016 23:11:43 +0000 (00:11 +0100)]
OvmfPkg: PciHostBridgeLib: set RootBus->AllocationAttributes

InitRootBridge() in "OvmfPkg/PciHostBridgeDxe/PciHostBridge.c" passes the
EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM allocation attribute to
RootBridgeConstructor(); we should do the same here.

From "MdePkg/Include/Protocol/PciHostBridgeResourceAllocation.h":

/// If this bit is set, then the PCI Root Bridge does not support separate
/// windows for Non-prefetchable and Prefetchable memory. A PCI bus driver
/// needs to include requests for Prefetchable memory in the
/// Non-prefetchable memory pool.

Which implies that both the 32-bit and 64-bit prefetchable MMIO apertures
should be marked empty. (The CreateRootBridge() function actually enforces
this in "MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c".)

Furthermore, since OvmfPkg/PciHostBridgeDxe does *not* set the
EFI_PCI_HOST_BRIDGE_MEM64_DECODE allocation attribute:

/// If this bit is set, then the PCI Root Bridge supports 64 bit memory
/// windows.  If this bit is not set, the PCI bus driver needs to include
/// requests for 64 bit memory address in the corresponding 32 bit memory
/// pool.

we follow suit in the PciHostBridgeLib instance.

In turn, the 64-bit MMIO apertures (both prefetchable and
non-prefetchable) should be marked empty.
MdeModulePkg/Bus/Pci/PciHostBridgeDxe enforces this too.

(64-bit MMIO aperture support, based on yet more fw_cfg files, is a
planned future improvement.)

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOvmfPkg: PciHostBridgeLib: clear RootBus->DmaAbove4G
Laszlo Ersek [Mon, 25 Jan 2016 22:50:14 +0000 (23:50 +0100)]
OvmfPkg: PciHostBridgeLib: clear RootBus->DmaAbove4G

When this BOOLEAN member is FALSE, and the caller tries to set up a DMA
transfer between a PCI device and a host buffer not entirely under 4GB,
then "MdeModulePkg/Bus/Pci/PciHostBridgeDxe" sets up a bounce buffer under
4GB, in the implementation of EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Map().

Since that's exactly what RootBridgeIoMap() does in
"OvmfPkg/PciHostBridgeDxe/PciRootBridgeIo.c", stick with it in this
conversion.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOvmfPkg: PciHostBridgeLib: set supported and initial attributes in RootBus
Laszlo Ersek [Mon, 25 Jan 2016 22:47:19 +0000 (23:47 +0100)]
OvmfPkg: PciHostBridgeLib: set supported and initial attributes in RootBus

These settings are copied from the RootBridgeConstructor() function, file
"OvmfPkg/PciHostBridgeDxe/PciRootBridgeIo.c".

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOvmfPkg: PciHostBridgeLib: set RootBus->Segment
Laszlo Ersek [Mon, 25 Jan 2016 22:43:50 +0000 (23:43 +0100)]
OvmfPkg: PciHostBridgeLib: set RootBus->Segment

This is the first of the patches that set the fields of PCI_ROOT_BRIDGE.
The structure is zero-filled as a precaution for later field additions.

Here we set the Segment member explicitly to zero (so that any later
customization can be easier).

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOvmfPkg: PciHostBridgeLib: implement PciHostBridgeFreeRootBridges()
Laszlo Ersek [Mon, 25 Jan 2016 22:17:22 +0000 (23:17 +0100)]
OvmfPkg: PciHostBridgeLib: implement PciHostBridgeFreeRootBridges()

This function has no counterpart in OvmfPkg/PciHostBridgeDxe/, but the
PciHostBridgeLib class requires it.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOvmfPkg: PciHostBridgeLib: convert main loop from PciHostBridgeDxe
Laszlo Ersek [Mon, 25 Jan 2016 21:47:00 +0000 (22:47 +0100)]
OvmfPkg: PciHostBridgeLib: convert main loop from PciHostBridgeDxe

In this patch we import the scan for extra root buses from the
InitializePciHostBridge() function, in file
"OvmfPkg/PciHostBridgeDxe/PciHostBridge.c".

For the time being, the InitRootBridge() and UninitRootBridge() functions
are just placeholders.

The PciHostBridgeGetRootBridges() API expects us to return the
PCI_ROOT_BRIDGE structures in a contiguous array, instead of a linked
list. Therefore the following bits have to be converted manually:

(1) The array is allocated in advance, in a single step.

(2) The calculation of the array size depends on an explicit
    multiplication, which we must check against overflow. Since more than
    255 extra root bridges make no sense anyway, we use (1 + 255) as the
    limit on the main plus all extra root bridges. This also ensures that
    the UINTN multiplication doesn't overflow.

(3) The PciHostBridgeDxe code decrements "ExtraRootBridgesLeft" to
    terminate the scanning early. Here we need track the increasing count
    of used array elements as well, so we employ "ExtraRootBridges" as a
    constant limit, and increment the new local variable "Initialized".

(4) The prototypes of InitRootBridge() and UninitRootBridge() reflect that
    the PCI_ROOT_BRIDGE structure is allocated by the caller; only
    in-place initialization is necessary.

Additionally, macros are employed for standard PCI quantities, from
"MdePkg/Include/IndustryStandard/Pci22.h":

- MAX_PCI_DEVICE_NUMBER (31) is replaced with PCI_MAX_DEVICE (same),
- the constant 255 is replaced with PCI_MAX_BUS,
- the (RootBridgeNumber < 256) condition is replaced with
  (RootBridgeNumber <= PCI_MAX_BUS).

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOvmfPkg: clone PciHostBridgeLib from MdeModulePkg's Null instance
Laszlo Ersek [Mon, 25 Jan 2016 19:33:32 +0000 (20:33 +0100)]
OvmfPkg: clone PciHostBridgeLib from MdeModulePkg's Null instance

In this patch we clone "MdeModulePkg/Library/PciHostBridgeLibNull" for
customization under OvmfPkg. Differences relative to a verbatim copy:

- the Null suffix is dropped from file names,
- the UNI file is dropped, together with the corresponding MODULE_UNI_FILE
  reference in the INF file,
- the INF file receives a new FILE_GUID,
- the top comments in the files mention OVMF, not a null instance.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOvmfPkg: factor the MMIO aperture shared by all PCI root bridges into PCDs
Laszlo Ersek [Fri, 26 Feb 2016 15:29:19 +0000 (16:29 +0100)]
OvmfPkg: factor the MMIO aperture shared by all PCI root bridges into PCDs

Going forward, two modules will need to know about the aperture:
PlatformPei (as before), and OVMF's upcoming PciHostBridgeLib instance
(because the core PciHostBridgeDxe driver requires the library to state
the exact apertures for all root bridges).

On QEMU, all root bridges share the same MMIO aperture, hence one pair of
PCDs suffices.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOvmfPkg: factor the IO aperture shared by all PCI root bridges into PCDs
Laszlo Ersek [Fri, 26 Feb 2016 15:29:19 +0000 (16:29 +0100)]
OvmfPkg: factor the IO aperture shared by all PCI root bridges into PCDs

At the moment we don't intend to customize this aperture at runtime, but
going forward, two modules will need to know about it: PlatformPei (as
before), and OVMF's upcoming PciHostBridgeLib instance (because the core
PciHostBridgeDxe driver requires the library to state the exact apertures
for all root bridges).

On QEMU, all root bridges share the same IO port aperture, hence one pair
of PCDs suffices.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOvmfPkg: remove superfluous [PcdsFixedAtBuild] section header
Laszlo Ersek [Fri, 26 Feb 2016 15:24:35 +0000 (16:24 +0100)]
OvmfPkg: remove superfluous [PcdsFixedAtBuild] section header

At the location of this header an earlier [PcdsFixedAtBuild] section is in
effect already.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoMdeModulePkg: PciHostBridgeDxe: don't assume extended config space
Laszlo Ersek [Fri, 26 Feb 2016 22:09:46 +0000 (23:09 +0100)]
MdeModulePkg: PciHostBridgeDxe: don't assume extended config space

The "pc" ("pc-i440fx-*") machine types of QEMU don't support extended
config space. Accordingly, OVMF will use the following library instances
in connection with the core PciHostBridgeDxe driver:

  BasePciSegmentLibPci [class: PciSegmentLib]
    BasePciLibCf8      [class: PciLib]
      BasePciCf8Lib    [class: PciCf8Lib]

Add a new field to the PCI_ROOT_BRIDGE structure so that
RootBridgeIoCheckParameter() can catch config space offsets above 0xFF on
such old (emulated) platforms.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
8 years agoMdeModulePkg: PciHostBridgeDxe: insert horizontal whitespace
Laszlo Ersek [Tue, 1 Mar 2016 10:04:59 +0000 (11:04 +0100)]
MdeModulePkg: PciHostBridgeDxe: insert horizontal whitespace

... in preparation for the next patch.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoMdeModulePkg/FvSimpleFs: don't open DevicePath with BY_DRIVER mode
Feng Tian [Wed, 2 Mar 2016 01:45:06 +0000 (09:45 +0800)]
MdeModulePkg/FvSimpleFs: don't open DevicePath with BY_DRIVER mode

The device path protocol doesn't get closed at FvSimpleFilesystem
driver stop() when it's opened at start() with BY_DRIVER mode.

We change it to open DevicePath with GET_PROTOCOL mode as FV2 protocol with BY_DRIVER is enough.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
8 years agoShellPkg: Update 'ifconfig -r' implementation
Jiaxin Wu [Wed, 2 Mar 2016 07:58:25 +0000 (15:58 +0800)]
ShellPkg: Update 'ifconfig -r' implementation

This patch is used to update ifconfig -r implementation
to sync with UEFI Shell 2.2.

option -r means to reconfigure all or specified interface,
and set DHCP policy. If specified interface is already set
to DHCP, then refresh the IPv4 configuration.

If the interface name is specified
with '-r', DHCP DORA process will be triggered by the policy
transition (static -> dhcp).

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Carsey Jaben <jaben.carsey@intel.com>
Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
Cc: Subramanian Sriram <sriram-s@hpe.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
8 years agoShellPkg: Increase reallocation size for temp memory files
Jim_Dailey@Dell.com [Thu, 18 Feb 2016 15:51:33 +0000 (23:51 +0800)]
ShellPkg: Increase reallocation size for temp memory files

If data of any real size were to be piped from one command to another,
an inordinate amount of time could be taken up by reallocating memory
that is only 10 bytes bigger than what is currently needed. Also, this
could cause unwelcome memory fragmentation.

Added a define to control how much memory is reallocated beyond that
which is currently needed. Set it to 1K vs. the original 10 bytes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jim Dailey <jim_dailey@dell.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
8 years agoShellPkg: Do not write the UNICODE BOM on ConOut.
Jim_Dailey@Dell.com [Thu, 18 Feb 2016 14:47:07 +0000 (22:47 +0800)]
ShellPkg: Do not write the UNICODE BOM on ConOut.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jim Dailey <jim_dailey@dell.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
8 years agoShellPkg: Add FileSize member to shell memory file structure.
Jim_Dailey@Dell.com [Thu, 18 Feb 2016 14:40:46 +0000 (22:40 +0800)]
ShellPkg: Add FileSize member to shell memory file structure.

The shell uses the memory file structure to manage temporary files in
memory that support piping of output from one command into the the
input of another command.  The BufferSize member is the size of the
internal buffer, not the size of the data that was written to the
file. So, it was possible to read beyond the EOF of these files as
reads used BufferSize. Now FileSize tracks the actual size of these
files (the number of bytes written, not the number of bytes available
in the buffer), and the reads use this member.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jim Dailey <jim_dailey@dell.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
8 years agoBaseTools/LZMA: fix the format issue for last patch
Yonghong Zhu [Tue, 1 Mar 2016 04:41:30 +0000 (12:41 +0800)]
BaseTools/LZMA: fix the format issue for last patch

There are no functional changes in this patch. fixing the format base on
last commit.
The only change is 1) add back the blank line, which can help we better
compare with the original LZMA source code. 2) remove the indent of
#ifndef and #endif.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
8 years agoUefiCpuPkg/Application/Cpuid: Change DisplayFamily/DisplayModel type
Jeff Fan [Wed, 2 Mar 2016 02:05:44 +0000 (10:05 +0800)]
UefiCpuPkg/Application/Cpuid: Change DisplayFamily/DisplayModel type

Change DisplayFamily/DisplayModel type to UINT32 to avoid different size in
bitwise operation.

Cc: Qiu Shumin <shumin.qiu@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
8 years agoUefiCpuPkg/Application/Cpuid: Remove unnecessary code check
Jeff Fan [Wed, 2 Mar 2016 02:00:31 +0000 (10:00 +0800)]
UefiCpuPkg/Application/Cpuid: Remove unnecessary code check

gMaximumBasicFunction is set to CPUID_SIGNATURE as below, so removed the compare
code.
UINT32  gMaximumBasicFunction = CPUID_SIGNATURE;

Cc: Qiu Shumin <shumin.qiu@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
8 years agoUefiCpuPkg/CpuMpPei: Load microcode if found newer revision
Jeff Fan [Wed, 2 Mar 2016 01:45:14 +0000 (09:45 +0800)]
UefiCpuPkg/CpuMpPei: Load microcode if found newer revision

Current implementation only loads the latest revision if there is no microcode
loaded. Per IA32 User Manual, we should load the newer revision by comparing
the existing microcode loaded with the updating revision.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
8 years agoEmulatorPkg: Use UEFI Shell by default
Jordan Justen [Tue, 1 Mar 2016 23:39:43 +0000 (15:39 -0800)]
EmulatorPkg: Use UEFI Shell by default

Now we will build the UEFI shell from source and include it in the
EmulatorPkg build.

USE_OLD_SHELL can be defined on the command line to force using the
old shell.

Fixes: https://github.com/tianocore/edk2/issues/60
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
8 years agoShellPkg: Revert git 'd6cf1af9' fix
Jiaxin Wu [Thu, 25 Feb 2016 03:09:17 +0000 (11:09 +0800)]
ShellPkg: Revert git 'd6cf1af9' fix

'd6cf1af9' is associated with '3d0a49ad' commit. So, this patch is
used to respond the revert for '3d0a49ad' to adapt the Ipv4 config
policy update.

Cc: Subramanian Sriram <sriram-s@hpe.com>
Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
8 years agoNetworkPkg: Revert git 'eb213f2f' fix
Jiaxin Wu [Thu, 25 Feb 2016 03:06:14 +0000 (11:06 +0800)]
NetworkPkg: Revert git 'eb213f2f' fix

'eb213f2f' is associated with '3d0a49ad' commit. So, this patch is
used to respond the revert for '3d0a49ad' to adapt the Ipv4 config
policy update.

Cc: Subramanian Sriram <sriram-s@hpe.com>
Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
8 years agoNetworkPkg: Change the default IPv6 config policy
Jiaxin Wu [Thu, 25 Feb 2016 02:52:13 +0000 (10:52 +0800)]
NetworkPkg: Change the default IPv6 config policy

The default policy for Ip6Config is Ip6ConfigPolicyAutomatic,
which results in all NIC ports starting SARR process when it
receives RA message with M flag from IPv6 router. So, this
patch is used to changes the the default IPv6 config policy to
Ip6ConfigPolicyManualand also defer the SetData operation after
Ip6ConfigProtocol installed. This update let the other platform
drivers have chance to change the default config data by consume
Ip6ConfigProtocol.

Cc: Subramanian Sriram <sriram-s@hpe.com>
Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Subramanian Sriram <sriram-s@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
8 years agoMdeModulePkg: Change the default IPv4 config policy
Jiaxin Wu [Thu, 25 Feb 2016 02:48:58 +0000 (10:48 +0800)]
MdeModulePkg: Change the default IPv4 config policy

Git version '3d0a49ad' commit provided a scenario to resolve the
performance issue for IPv4, but it's not workable for IPv6. To
avoid IPv4 and IPv6 inconsistency, we decided to revert that version
fix.

If so, the default policy for Ip4Config2 is Ip4Config2PolicyDhcp,
which results in all NIC ports attempting DHCP. So, this patch is
used to changes the the default IPv4 config policy to
Ip4Config2PolicyStatic and also defer the SetData operation after
Ip4Config2Protocol installed. This update let the other platform
drivers have chance to change the default config data by consume
Ip4Config2Protocol.

Cc: Subramanian Sriram <sriram-s@hpe.com>
Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Subramanian Sriram <sriram-s@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
8 years agoMdeModulePkg: Add ASSERT to make sure pointers are not NULL
Dandan Bi [Mon, 29 Feb 2016 07:08:56 +0000 (15:08 +0800)]
MdeModulePkg: Add ASSERT to make sure pointers are not NULL

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
8 years agoMdeModulePkg: FileExplorerLib: Modify the EFI_FILE_EXPLORE_FORMSET_GUID
Dandan Bi [Tue, 1 Mar 2016 06:36:46 +0000 (14:36 +0800)]
MdeModulePkg: FileExplorerLib: Modify the EFI_FILE_EXPLORE_FORMSET_GUID

Currently the EFI_FILE_EXPLORE_FORMSET_GUID value in BdsDxe in
IntelFrameworkModulePkg is same with the GUID VALUE in FileExplorerLib.
This patch is to modify the EFI_FILE_EXPLORE_FORMSET_GUID in
FileExplorerLib to avoid potential issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
8 years agoOvmfPkg: copy log level comments from DebugLib.h
Laszlo Ersek [Tue, 1 Mar 2016 09:39:49 +0000 (10:39 +0100)]
OvmfPkg: copy log level comments from DebugLib.h

Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOmap35xxPkg: sync log level comments to DebugLib.h
Laszlo Ersek [Tue, 1 Mar 2016 09:28:50 +0000 (10:28 +0100)]
Omap35xxPkg: sync log level comments to DebugLib.h

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoBeagleBoardPkg: sync log level comments to DebugLib.h
Laszlo Ersek [Tue, 1 Mar 2016 09:28:50 +0000 (10:28 +0100)]
BeagleBoardPkg: sync log level comments to DebugLib.h

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoArmVirtPkg: sync log level comments to DebugLib.h
Laszlo Ersek [Tue, 1 Mar 2016 09:28:50 +0000 (10:28 +0100)]
ArmVirtPkg: sync log level comments to DebugLib.h

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoMdePkg: DebugLib: more cleanup for log level comments in lib class header
Laszlo Ersek [Tue, 1 Mar 2016 09:07:31 +0000 (10:07 +0100)]
MdePkg: DebugLib: more cleanup for log level comments in lib class header

The DEBUG_POOL and DEBUG_PAGE clarifications were suggested by Leif
Lindholm.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoMdeModulePkg: FileExplorerLib: Add check when to call FreePool function
Dandan Bi [Mon, 29 Feb 2016 02:08:47 +0000 (10:08 +0800)]
MdeModulePkg: FileExplorerLib: Add check when to call FreePool function

when free up resource allocated for a MenuEntry, there exists
the case that the DevicePath and DisplayString are NULL,
so before calling FreePool function, need to check.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
8 years agoShellPkg: Don't strip BOM when piping UCS2 data to a UEFI app
Jim_Dailey@Dell.com [Tue, 1 Mar 2016 21:02:19 +0000 (13:02 -0800)]
ShellPkg: Don't strip BOM when piping UCS2 data to a UEFI app

If the BOM is stripped from StdIn, then an app that duplicates StdIn
will not be able to duplicate, say, a UCS2 file that was piped into
it (the output file it creates would not start with a BOM).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jim Dailey <jim_dailey@dell.com>
Reviewed-by: Jaben Carsey <Jaben.Carsey@intel.com>
8 years agoArmPlatformPkg/PL180MciDxe: don't check ID_REG3
Ryan Harkin [Tue, 1 Mar 2016 08:23:20 +0000 (08:23 +0000)]
ArmPlatformPkg/PL180MciDxe: don't check ID_REG3

TC2 reads 0x02 for the PL180 ID3 register instead of 0x00 as defined in
the spec.

However, the spec [1] states that the contents of ID3 register represent
the "configuration option of the peripheral" and thus not part of the
Prime Cell identification.

For this patch, we drop checking the value in MCI_PERIPH_ID_REG3.

[1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0172a/index.html

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
8 years agoArmPlatformPkg/PL180MciDxe: warn on probe fail
Ryan Harkin [Tue, 1 Mar 2016 08:20:40 +0000 (08:20 +0000)]
ArmPlatformPkg/PL180MciDxe: warn on probe fail

If the PL180 fails to probe, issue a warning on debug builds.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
8 years agoArmPlatformPkg/PL180MciDxe: fix Depex for TC2
Ryan Harkin [Tue, 1 Mar 2016 07:44:39 +0000 (07:44 +0000)]
ArmPlatformPkg/PL180MciDxe: fix Depex for TC2

PL180 on TC2 has a dependency on gEfiCpuArchProtocolGuid.  Without
adding the dependency, TC2 will crash in the PL180 driver.

This problem has been present since d340ef7 when TC2 stopped booting.
However, it was masked by 300fc77 which prevented PL180 from running on
TC2 due to TC2 using a version on PL180 newer than that documented
publicly.

[1] https://github.com/tianocore/edk2/commit/d340ef7
2014-08-26
ArmPkg/ArmArchTimerLib: Remove non required [depex] and IoLib
[2] https://github.com/tianocore/edk2/commit/300fc77
2015-08-25
ArmPlatformPkg/PL180MciDxe: check PrimeCell ID before initializing

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
8 years agoArmPlatformPkg: delete orphaned ArmVExpress.dsc.inc
Leif Lindholm [Tue, 1 Mar 2016 10:13:06 +0000 (10:13 +0000)]
ArmPlatformPkg: delete orphaned ArmVExpress.dsc.inc

In the recent migration of the ARM Ltd. platforms to
https://git.linaro.org/uefi/OpenPlatformPkg.git, this file unfortunately
got left behind. Delete it to reduce confusion and (further) risk of
duplication of effort.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoMdeModulePkg: DxeCore: fully initialize image context before passing it on
Ard Biesheuvel [Mon, 29 Feb 2016 16:08:45 +0000 (17:08 +0100)]
MdeModulePkg: DxeCore: fully initialize image context before passing it on

When the DXE core is loaded, it invokes the PeCoffExtraActionLib library
function 'PeCoffLoaderRelocateImageExtraAction' explicitly, which may be
in addition to the same function having been called by the DxeIpl PE/COFF
loader instance.

The ImageContext that DXE core presents to this function is only partially
initialized, which may result in the following output on AArch64 systems:

add-symbol-file ..MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll 0x5F226240
<some intermediate output>
add-symbol-file ..MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll 0x5F226000

This is caused by incorrect data in the ImageContext structure, which means
the start of the .text section is calculated incorrectly. In general, it is
the duty of the caller to present a valid ImageContext structure, so let's
add the missing values before invoking PeCoffLoaderRelocateImageExtraAction().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Star Zeng <star.zeng@intel.com>
8 years agoMdePkg: fix comment typo in DebugLib.h
Leif Lindholm [Mon, 29 Feb 2016 19:42:41 +0000 (19:42 +0000)]
MdePkg: fix comment typo in DebugLib.h

The definition of DEBUG_LOADFILE was incorrectly described as "UNDI
Driver". Correct this to align with MdePkg.dec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
8 years agoMdeModulePkg/NvmExpress: Fix uninitialized field used in NVMe DiskInfo
Tian, Feng [Mon, 29 Feb 2016 05:12:38 +0000 (13:12 +0800)]
MdeModulePkg/NvmExpress: Fix uninitialized field used in NVMe DiskInfo

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
8 years agoMdeModulePkg: Add new API HttpUrlGetPath() to HttpLib.h
Fu Siyuan [Mon, 29 Feb 2016 05:51:02 +0000 (13:51 +0800)]
MdeModulePkg: Add new API HttpUrlGetPath() to HttpLib.h

This patch is to add a new interface to get the "Path" component according to
the URI parse result, it would be helpful for the library user to extract the
file path value in a URI.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
8 years agoEmbeddedPkg/AndroidFastboot: fix size with 64bit
Haojian Zhuang [Mon, 29 Feb 2016 14:51:50 +0000 (22:51 +0800)]
EmbeddedPkg/AndroidFastboot: fix size with 64bit

Since there's percentage calcution, multiply on 32bit variable
will cause overflow. So fix the variables as 64bit.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
8 years agoMdeModulePkg/HiiDatabaseDxe: Fix a variable is uninitialized.
Cinnamon Shia [Mon, 22 Feb 2016 02:53:14 +0000 (10:53 +0800)]
MdeModulePkg/HiiDatabaseDxe: Fix a variable is uninitialized.

The StringSize variable in the FindStringBlock function is a IN OUT
parameter of the GetUnicodeStringTextOrSize function.
Thought the GetUnicodeStringTextOrSize function changes the value of
the StringSize variable, it is better to initialize the StringSize
variable before passing it to the GetUnicodeStringTextOrSize function.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
8 years agoMdeModulePkg: PciHostBridgeLibNull: rewrap source to 79 characters
Laszlo Ersek [Mon, 25 Jan 2016 19:47:35 +0000 (20:47 +0100)]
MdeModulePkg: PciHostBridgeLibNull: rewrap source to 79 characters

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
8 years agoBaseTools: fix LzmaCompress VS2013 make failure
Yonghong Zhu [Mon, 29 Feb 2016 03:18:12 +0000 (11:18 +0800)]
BaseTools: fix LzmaCompress VS2013 make failure

when make BaseTools by VS2013, LzmaEnc.c report warning C4127:
conditional expression is constant, so this patch fix this issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
8 years agoMdeModulePkg: Update PeiCore dispatcher to handle PEIM and PEI_CORE only
Liming Gao [Sat, 6 Feb 2016 01:02:57 +0000 (09:02 +0800)]
MdeModulePkg: Update PeiCore dispatcher to handle PEIM and PEI_CORE only

When PcdShadowPeimOnBoot is FALSE, they are not copied to memory and
execute from their original locations. Here, this policy should only
apply for PEIM and PEI_CORE, not for other file type, such as DXE_CORE.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Tested-by: Eugene Cohen <eugene@hp.com>
8 years agoMdeModulePkg RamDiskDxe: Install Block I/O 2 Protocol on RAM disk devices
Hao Wu [Wed, 17 Feb 2016 03:25:14 +0000 (11:25 +0800)]
MdeModulePkg RamDiskDxe: Install Block I/O 2 Protocol on RAM disk devices

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
8 years agoMdeModulePkg: Add RamDiskDxe driver implementation
Hao Wu [Wed, 3 Feb 2016 06:14:47 +0000 (14:14 +0800)]
MdeModulePkg: Add RamDiskDxe driver implementation

The RamDiskDxe driver will:
1. Produce the EFI RAM Disk Protocol
2. Install RAM disk device path and block I/O related protocols on the
   RAM disk device handle.
3. Install RAM disk configuration form to HII database

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
8 years agoMdeModuelPkg/PciBus: Return AddrTranslationOffset in GetBarAttributes
Ruiyu Ni [Wed, 17 Feb 2016 10:06:36 +0000 (18:06 +0800)]
MdeModuelPkg/PciBus: Return AddrTranslationOffset in GetBarAttributes

Some platform doesn't use CPU(HOST)/Device 1:1 mapping for PCI Bus.
But PCI IO doesn't have interface to tell caller (device driver)
whether the address returned by GetBarAttributes() is HOST address
or device address.
UEFI Spec 2.6 addresses this issue by clarifying the address returned
is HOST address and caller can use AddrTranslationOffset to calculate
the device address.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
8 years agoMdeModulePkg/PciBus: reorganize case-statement to reduce code lines
Ruiyu Ni [Wed, 24 Feb 2016 08:02:18 +0000 (16:02 +0800)]
MdeModulePkg/PciBus: reorganize case-statement to reduce code lines

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
8 years agoMdeModulePkg/PciBus: Change local variable AddressSpace to Descriptor
Ruiyu Ni [Mon, 15 Feb 2016 06:53:05 +0000 (14:53 +0800)]
MdeModulePkg/PciBus: Change local variable AddressSpace to Descriptor

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
8 years agoMdeModulePkg: Add missing PCD usage information string.
Qiu Shumin [Fri, 26 Feb 2016 08:37:20 +0000 (16:37 +0800)]
MdeModulePkg: Add missing PCD usage information string.

For new PCDs add their usage information strings in UNI file.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "Yao, Jiewen" <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
8 years agoSecurityPkg: Tcg2Smm: Change TPM2.0 MMIO range attribute
Zhang, Chao B [Mon, 29 Feb 2016 01:17:03 +0000 (09:17 +0800)]
SecurityPkg: Tcg2Smm: Change TPM2.0 MMIO range attribute

Change TPM2.0 MMIO resource attribute to ReadWrite according to TCG PC Client Platform Firmware Profile Spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Anbazhagan Baraneedharan <anbazhagan@hp.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
8 years agoMdeModulePkg:Fix a robustness issue of Mnp Driver
Zhang Lubo [Wed, 24 Feb 2016 03:54:53 +0000 (11:54 +0800)]
MdeModulePkg:Fix a robustness issue of Mnp Driver

v3:
*
When there exists duplicate items in VLAN variable , save the correct
variable content back to the variable storage after duplicate items are removed

Duplicate items in VLAN variable will cause MNP driver binding
start function fall into infinite loop,so we should check it's
content before using it.

Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
8 years agoUefiCpuPkg/Cpuid: Fix GCC build error
Hao Wu [Fri, 26 Feb 2016 08:43:02 +0000 (16:43 +0800)]
UefiCpuPkg/Cpuid: Fix GCC build error

define PRINT_BIT_FIELD(Variable, FieldName) \
  Print (L"%5a%42a: %x\n", #Variable, #FieldName, \
  ##Variable.Bits.##FieldName);

The above definition in UefiCpuPkg/Application/Cpuid/Cpuid.c
will cause GCC build error.

Fix it with:

define PRINT_BIT_FIELD(Variable, FieldName) \
  Print (L"%5a%42a: %x\n", #Variable, #FieldName, \
  Variable.Bits.FieldName);

The '.' has its origin meaning as a member operator in the define
statement. Thus, the token-pasting operator '##' is not necessary here.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
8 years agoShellPkg: Fix unexpected behavior of mouse cursor in Editor.
Qiu Shumin [Fri, 26 Feb 2016 06:52:18 +0000 (14:52 +0800)]
ShellPkg: Fix unexpected behavior of mouse cursor in Editor.

USB mouse cursor cannot move unless the left button is down. The patch
refresh the FileBuffer of Editor every time when the 'MainEditorRefresh'
is called to fix this bug.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
8 years agoCorebootModulePkg-CbParseLib: Fix bad reference in CbParseLib
Leahy, Leroy P [Thu, 25 Feb 2016 02:55:51 +0000 (18:55 -0800)]
CorebootModulePkg-CbParseLib: Fix bad reference in CbParseLib

Dereferencing pMemTableSize in debug statement displays bad values when
it is set to NULL.  Display the actual table size value instead.

TEST=Build and run on Galileo Gen2

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
8 years agoCorebootModulePkg-CbParseLib: Add ACPI table verification
Leahy, Leroy P [Thu, 25 Feb 2016 02:53:31 +0000 (18:53 -0800)]
CorebootModulePkg-CbParseLib: Add ACPI table verification

Verify the register address in the FADT.

TEST=Build and run on Galileo Gen2 when the FADT was not present.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
8 years agoMdeModulePkg: RegularExpressionDxe: support free(NULL)
Laszlo Ersek [Wed, 24 Feb 2016 20:00:04 +0000 (21:00 +0100)]
MdeModulePkg: RegularExpressionDxe: support free(NULL)

The ISO C standard says about free(),

  If ptr is a null pointer, no action occurs.

This is not true of the FreePool() interface of the MemoryAllocationLib
class:

  Buffer must have been allocated on a previous call to the pool
  allocation services of the Memory Allocation Library. [...] If Buffer
  was not allocated with a pool allocation function in the Memory
  Allocation Library, then ASSERT().

Therefore we must not forward the argument of free() to FreePool() without
checking.

Cc: Cecil Sheng <cecil.sheng@hpe.com>
Cc: Cinnamon Shia <cinnamon.shia@hpe.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Qiu Shumin <shumin.qiu@intel.com>
Cc: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Cc: Yao Jiewen <Jiewen.Yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-By: Cinnamon Shia <cinnamon.shia@hpe.com>
8 years agoArmPlatformPkg: PL061 - rewrite the hardware interaction
Leif Lindholm [Wed, 28 Oct 2015 18:11:49 +0000 (18:11 +0000)]
ArmPlatformPkg: PL061 - rewrite the hardware interaction

The PL061 GPIO controller is a bit of an anachronism, and the existing
driver does nothing to hide this - leading to it being very tricky to
read.

Rewrite it to document (in comments and code) what is actually
happening, and fix some bugs in the process.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
8 years agoArmPlatformPkg: PL061 - drop pointless initialize function
Leif Lindholm [Wed, 10 Feb 2016 16:38:26 +0000 (16:38 +0000)]
ArmPlatformPkg: PL061 - drop pointless initialize function

PL061Initialize() did not actually do anything other than call
PL061Identify() - so cut out the middle man.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
8 years agoArmPlatformPkg: PL061 - only initialize on protocol load
Leif Lindholm [Wed, 28 Oct 2015 18:08:53 +0000 (18:08 +0000)]
ArmPlatformPkg: PL061 - only initialize on protocol load

For whatever reason, every single operation on the PL061 looked for an
"Initialized" flag, and manually called the initialization function if
not set. Move this to a single call on protocol installation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
8 years agoArmPlatformPkg: PL061 - reformat copyright statement.
Leif Lindholm [Wed, 28 Oct 2015 18:00:16 +0000 (18:00 +0000)]
ArmPlatformPkg: PL061 - reformat copyright statement.

The copyright statement in PL061Gpio.c would not fit on a normal terminal
screen. Break lines at <= 80 characters.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
8 years agoMdeModulePkg: AcpiTableDxe: fix VS2008 build by merging adjacent if blocks
Ard Biesheuvel [Thu, 25 Feb 2016 16:20:21 +0000 (17:20 +0100)]
MdeModulePkg: AcpiTableDxe: fix VS2008 build by merging adjacent if blocks

The assignment of CurrentRsdtEntry and its subsequent dereference are
subject to the same condition, but for some reason, VS2008 does not see
that and warns about the dereference possibly involving an uninitialized
pointer. Since the single statememt between the blocks is unrelated, we
can just move it and merge the two conditional blocks together.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: David Woodhouse <David.Woodhouse@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
8 years agoMdeModulePkg/PciHostBridge: Don't assume resources are fully NonExistent
Ruiyu Ni [Thu, 25 Feb 2016 09:13:31 +0000 (17:13 +0800)]
MdeModulePkg/PciHostBridge: Don't assume resources are fully NonExistent

The patch removes the assumption that the resources claimed by root
bridges should not exist. Because resources might have been added:
1. by platform modules either in PEI through resource HOB, or in DXE,
   before the PCI host bridge driver runs.
2. Resources claimed by different root bridges may overlap so that
   resource adding operation for latter root bridges may fail if
   we assume the resource should not exist.

In real world, this patch is to fit OVMF platform needs because
different root bridges in OVMF platform shares the same resources.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
[lersek@redhat.com: intersection-based implementation]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
8 years agoMdeModulePkg/PciHostBridge: Refine function header comments.
Ruiyu Ni [Thu, 25 Feb 2016 01:14:29 +0000 (09:14 +0800)]
MdeModulePkg/PciHostBridge: Refine function header comments.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Shumin Qiu <shumin.qiu@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
8 years agoSecurityPkg: Use FileExplorerLib in SecureBootConfigDxe
Dandan Bi [Thu, 28 Jan 2016 01:36:43 +0000 (09:36 +0800)]
SecurityPkg: Use FileExplorerLib in SecureBootConfigDxe

Using existing library FileExplorerLib to replace the same
logic in SecureBootConfigDxe to make the code clear. After using
FileExplorerLib, the UI behavior for enroll PK will change,
previously when select one PK file, commit/discard changes will
return to Device Manager,press ESC will return to FileExplorer.
Now using FileExplorerLib the behavior will keep same with
enroll KEK/DB/..., commit/discard changes will return to Custom
Secure Boot Options form and ESC will return to PK options form.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
8 years agoSecurityPkg: Add FileExplorerLib.inf to the dsc file
Dandan Bi [Wed, 24 Feb 2016 12:21:28 +0000 (20:21 +0800)]
SecurityPkg: Add FileExplorerLib.inf to the dsc file

Add FileExplorerLib to SecurePkg DSC to pass build,
as SecureBootConfigDxe requires this library now.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
8 years agoVlv2TbltDevicePkg: Add FileExplorerLib.inf to the dsc file
Dandan Bi [Wed, 24 Feb 2016 12:20:24 +0000 (20:20 +0800)]
Vlv2TbltDevicePkg: Add FileExplorerLib.inf to the dsc file

Because SecureBootConfigDxe use FileExplorerLib now, but
FileExplorerLib is not in the dsc file of the package
that use SecureBootConfigDxe. Now add it to pass build.

Cc: David Wei <david.wei@intel.com>
Cc: Tim He <tim.he@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
8 years agoOvmfPkg: Add FileExplorerLib.inf to the dsc file
Dandan Bi [Wed, 24 Feb 2016 12:18:53 +0000 (20:18 +0800)]
OvmfPkg: Add FileExplorerLib.inf to the dsc file

Because SecureBootConfigDxe use FileExplorerLib now, but
FileExplorerLib is not in the dsc file of the package
that use SecureBootConfigDxe. Now add it to pass build.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoArmVirtPkg: Add FileExplorerLib.inf to the QEMU dsc files
Dandan Bi [Wed, 24 Feb 2016 12:15:52 +0000 (20:15 +0800)]
ArmVirtPkg: Add FileExplorerLib.inf to the QEMU dsc files

Because SecureBootConfigDxe use FileExplorerLib now, but
FileExplorerLib is not in the dsc files of the package
that use SecureBootConfigDxe. Now add it to pass build.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
8 years agoMdeModulePkg: Add ASSERT to make sure pointer 'OptionalData' not be NULL
Dandan Bi [Thu, 25 Feb 2016 07:09:39 +0000 (15:09 +0800)]
MdeModulePkg: Add ASSERT to make sure pointer 'OptionalData' not be NULL

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>