]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
8 years agoSecurityPkg: Tcg2Dxe: Fix undersized TempBuf
Zhang, Chao B [Thu, 31 Mar 2016 01:40:28 +0000 (09:40 +0800)]
SecurityPkg: Tcg2Dxe: Fix undersized TempBuf

TempBuf in SetupEventLog needs to include sizeof(UINT32) to hold NumberOfAlgorithms.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
8 years agoMdeModulePkg/UefiBootManagerLib: BmGetActiveConsoleIn code cleanup
Thomas Palmer [Wed, 30 Mar 2016 17:16:48 +0000 (01:16 +0800)]
MdeModulePkg/UefiBootManagerLib: BmGetActiveConsoleIn code cleanup

Check for NULL from AllocateCopyPool before setting Count to 1. Also
change sizeof (EFI_HANDLE*) to sizeof (EFI_HANDLE).  Handles is a
EFI_HANDLE pointer, so the allocated memory must be the size of
EFI_HANDLE.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
8 years agoOptionRomPkg: Ax88772b: Fixing register access issue in Apple Eth Adapter
Shivamurthy Shastri [Wed, 30 Mar 2016 09:14:14 +0000 (17:14 +0800)]
OptionRomPkg: Ax88772b: Fixing register access issue in Apple Eth Adapter

The USB command CMD_RXQTC ("RX Queue Cascade Threshold Control") tries
to access the register and is always failing when using the Apple
Ethernet adapter.

It is fixed by checking flag before sending command.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Shivamurthy Shastri <shivamurthy.shastri@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
8 years agoOptionRomPkg: Ax88772b: Fixing compilation
Shivamurthy Shastri [Wed, 30 Mar 2016 05:24:58 +0000 (13:24 +0800)]
OptionRomPkg: Ax88772b: Fixing compilation

error: pNicDevice variable set but not used

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Shivamurthy Shastri <shivamurthy.shastri@linaro.org>
Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
8 years agoOptionRomPkg: Ax88772b: support for multiple dongles and chips
Shivamurthy Shastri [Wed, 23 Mar 2016 15:09:27 +0000 (23:09 +0800)]
OptionRomPkg: Ax88772b: support for multiple dongles and chips

Driver code is modified to support multiple ethernet dongles, which uses
similar ASIX chips. Also, it can be used for multiple ASIX chips with
similar register map.

Enabled support for Apple Ethernet Adapter

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Shivamurthy Shastri <shivamurthy.shastri@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
8 years agoMdeModulePkg/SdMmc: Add EDKII SD/MMC stack
Feng Tian [Wed, 23 Mar 2016 02:47:05 +0000 (10:47 +0800)]
MdeModulePkg/SdMmc: Add EDKII SD/MMC stack

This stack includes:
1. Dxe phase support by:
   1) SdMmcPciHcDxe driver to consume PciIo and produce
      SdMmcPassThru.
   2) SdDxe driver to consume SdMmcPassThru to produce
      BlkIo1/BlkIo2.
   3) EmmcDxe driver to consume SdMmcPassThru to produce
      BlkIo1/BlkIo2/SSP.

2. Pei phase support
   1) SdBlockIoPei driver to consume SdMmcHostController
      Ppi and produce VirutalBlkIo1&2.
   2) EmmcBlockIoPei driver to consume SdMmcHostController
      Ppi and produce VirutalBlkIo1&2.
   3) SdMmcPciHcPei driver to produce SdMmcHostController
      Ppi.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
8 years agoMdePkg/IndustryStandard: Add SD/EMMC common definitions
Feng Tian [Wed, 30 Mar 2016 03:23:57 +0000 (11:23 +0800)]
MdePkg/IndustryStandard: Add SD/EMMC common definitions

These definitions are defined in SD physical layer simplified spec
and eMMC electrical standard spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
8 years agoMdePkg/DevicePath: Add EMMC device path definition
Feng Tian [Tue, 22 Mar 2016 15:15:53 +0000 (23:15 +0800)]
MdePkg/DevicePath: Add EMMC device path definition

This device path node is introduced in UEFI2.6 spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
8 years agoMdePkg: Add EFI_SD_MMC_PASS_THRU_PROTOCOL definition
Feng Tian [Tue, 22 Mar 2016 15:08:30 +0000 (23:08 +0800)]
MdePkg: Add EFI_SD_MMC_PASS_THRU_PROTOCOL definition

This protocol is introduced in UEFI2.6 spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
8 years agoUefiCpuPkg/Cpuid.h: Display Intel SGX Resource Enumeration Leaves
Jeff Fan [Mon, 28 Mar 2016 01:53:03 +0000 (09:53 +0800)]
UefiCpuPkg/Cpuid.h: Display Intel SGX Resource Enumeration Leaves

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
8 years agoUefiCpuPkg/Cpuid.h: Add CPUID defines and structures for Intel SGX
Jeff Fan [Mon, 28 Mar 2016 01:51:06 +0000 (09:51 +0800)]
UefiCpuPkg/Cpuid.h: Add CPUID defines and structures for Intel SGX

Add Intel SGX Resource Enumeration Leaves as described by Section 37.7 in
Intel(R) 64 and IA-32 Architectures Software Developer's Manual, Volume 3D,
December 2015.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
8 years agoShellPkg: Refine the comparisons code in ShellPkg.
Qiu Shumin [Mon, 28 Mar 2016 06:05:57 +0000 (14:05 +0800)]
ShellPkg: Refine the comparisons code in ShellPkg.

For Boolean values not use explicit comparisons to TRUE or FALSE. For non-Boolean
comparisons we should use a compare operator.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
8 years agoMdeModulePkg PartitionDxe: Add Re-entry handling logic for BindingStop
Hao Wu [Fri, 11 Mar 2016 07:33:54 +0000 (15:33 +0800)]
MdeModulePkg PartitionDxe: Add Re-entry handling logic for BindingStop

There are scenario when the BindingStop service of PartitionDxe driver be
re-entered.

An example will be ejecting a DVD from a SATA DVDROM and then run
"reconnect -r" under shell. In this specific case, part of the calling
stack will be:

PartitionDriverBindingStop() (PartitionDxe) ->
Stop first child handle (PartitionDxe) ->
ScsiDiskFlushBlocksEx() (ScsiDiskDxe) ->
A media change is detected (ScsiDiskDxe) ->
Reinstall of BlockIO(2) protocols (ScsiDiskDxe) ->
Entering PartitionDriverBindingStop() again (PartitionDxe) ->
Potential risk of referencing already stopped child handle (PartitionDxe)
...

The current code has potential issue of referencing of already stopped
child handle. This commit adds re-entry handling logic to resolve such
issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
8 years agoSecurityPkg: Enable Opal password solution build.
Eric Dong [Tue, 29 Mar 2016 06:50:37 +0000 (14:50 +0800)]
SecurityPkg: Enable Opal password solution build.

This patch used to enable opal password solution build
in Security package level build.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
8 years agoSecurityPkg: OpalPasswordSmm: Add Opal password Smm driver.
Eric Dong [Tue, 29 Mar 2016 06:49:25 +0000 (14:49 +0800)]
SecurityPkg: OpalPasswordSmm: Add Opal password Smm driver.

This driver used to unlock device in S3 resume phase.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
8 years agoSecurityPkg: OpalPasswordDxe: Add Opal password dxe driver.
Eric Dong [Tue, 29 Mar 2016 06:48:20 +0000 (14:48 +0800)]
SecurityPkg: OpalPasswordDxe: Add Opal password dxe driver.

This driver used to enables opal feature in bios.
It adds setup menu and unlock device process in boot phase.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
8 years agoSecurityPkg: OpalPasswordSupportLib: Add Opal password support library.
Eric Dong [Tue, 29 Mar 2016 06:45:36 +0000 (14:45 +0800)]
SecurityPkg: OpalPasswordSupportLib: Add Opal password support library.

APIs used to support opal password solution to trig opal command.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
8 years agoSecurityPkg: TcgStorageOpalLib: Add TCG storage opal library.
Eric Dong [Tue, 29 Mar 2016 06:42:13 +0000 (14:42 +0800)]
SecurityPkg: TcgStorageOpalLib: Add TCG storage opal library.

Library APIs used to create commands defined by TCG storage opal spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
8 years agoSecurityPkg: TcgStorageCoreLib: Add TCG storage core library.
Eric Dong [Tue, 29 Mar 2016 06:41:20 +0000 (14:41 +0800)]
SecurityPkg: TcgStorageCoreLib: Add TCG storage core library.

APIs used to create commands defined by TCG storage core spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
8 years agoMdePkg: Add definition for TCG Storage Core and Opal specs.
Eric Dong [Tue, 29 Mar 2016 06:39:52 +0000 (14:39 +0800)]
MdePkg: Add definition for TCG Storage Core and Opal specs.

The definitions are defined in TCG storage core and opal spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
8 years agoBaseTools: Add two new sections for PCD in the build report
Yonghong Zhu [Wed, 23 Mar 2016 09:34:13 +0000 (17:34 +0800)]
BaseTools: Add two new sections for PCD in the build report

Build Spec updated to add two new sections for PCD in the build report.
1.Conditional directives section:If the DSC or FDF file contains
conditional directive statements.
2.Unused PCDs section: If the DSC or FDF file define values for PCDs that
are not used by any module and are not used in conditional directive
statements.

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/SerialDxe: Set FIFO depth with PCD
Heyi Guo [Thu, 17 Mar 2016 14:36:53 +0000 (22:36 +0800)]
MdeModulePkg/SerialDxe: Set FIFO depth with PCD

Set UART receive FIFO depth with PCD instead of fixed number "1".
The default value of PCD is also 1, so it makes no difference for
platforms which do not explicitly set this PCD.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
8 years agoMdePkg: Add PCD for UART default receive FIFO depth
Heyi Guo [Thu, 17 Mar 2016 14:36:52 +0000 (22:36 +0800)]
MdePkg: Add PCD for UART default receive FIFO depth

PcdUartDefaultReceiveFifoDepth is added to indicate UART default
receive FIFO depth.
Type of UINT16 is enough for FIFO depth.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
8 years agoMdeModulePkg DiskIoDxe: Media status check not be done at DiskIo level
Hao Wu [Thu, 17 Mar 2016 02:03:44 +0000 (10:03 +0800)]
MdeModulePkg DiskIoDxe: Media status check not be done at DiskIo level

Found an issue that file system cannot be started on a DVD when doing the
following process:

Boot to shell with a DVD inside a SATA DVDROM. Eject the DVD and run
"reconnect -r". Put the DVD inside again and run "reconnect -r".

The cause is that after executing the second reconnect action, DiskIo
immediately returns EFI_NO_MEDIA in function DiskIo2ReadWriteDisk() when
checking the media information. However, at this time, the media
information does not get updated by the ScsiDisk driver. Therefore, DiskIo
driver should left the no media check to ScsiDisk driver.

Generally, the media changed and media write protect check should also be
left to lower-level device driver. Thus, these two checks in function
DiskIo2ReadWriteDisk() are also removed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
8 years agoMdeModulePkg PartitionDxe: Some ISO images cannot be recognized properly
Hao Wu [Fri, 11 Mar 2016 07:55:36 +0000 (15:55 +0800)]
MdeModulePkg PartitionDxe: Some ISO images cannot be recognized properly

Some ISO images cannot be recognized properly when they are on media whose
block size is not 2048 bytes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
8 years agoMdeModulePkg ScsiDiskDxe: Fix hang issue when reconnecting an ISCSI device
Hao Wu [Mon, 7 Mar 2016 05:59:18 +0000 (13:59 +0800)]
MdeModulePkg ScsiDiskDxe: Fix hang issue when reconnecting an ISCSI device

The 'Reset' function for BlockIO(2) in ScsiDiskDxe should return
EFI_SUCCESS instead of EFI_DEVICE_ERROR when a device does not support
reset feature.

Otherwise, a 'reconnect -r' action when an ISCSI device is attached will
cause system hang.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
8 years agoPcAtChipsetPkg/PciHostBridge: Remove PciHostBridge driver
Ruiyu Ni [Fri, 18 Mar 2016 06:29:42 +0000 (14:29 +0800)]
PcAtChipsetPkg/PciHostBridge: Remove PciHostBridge driver

MdeModulePkg contains a new PciHostBridgeDxe driver which is a
super set of PcAtChipsetPkg/PciHostBridgeDxe.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
8 years agoShellPkg/UefiDpLib: Fix a memory leak issue in Dp.
Cinnamon Shia [Mon, 28 Mar 2016 03:03:23 +0000 (11:03 +0800)]
ShellPkg/UefiDpLib: Fix a memory leak issue in Dp.

The allocated memory of ParamPackage is not freed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
8 years agoPerformancePkg/Dp_App: Fix a memory leak issue in Dp.
Cinnamon Shia [Mon, 28 Mar 2016 03:03:22 +0000 (11:03 +0800)]
PerformancePkg/Dp_App: Fix a memory leak issue in Dp.

The allocated memory of ParamPackage is not freed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
8 years agoBaseTools: Remove the unnecessary check for RAW File
Yonghong Zhu [Mon, 28 Mar 2016 04:27:50 +0000 (12:27 +0800)]
BaseTools: Remove the unnecessary check for RAW File

Because the __VerifyFile function already checked whether the file is
valid.

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 agoBaseTools: generate alignment when the FV content come from the filesystem
Yonghong Zhu [Wed, 23 Mar 2016 09:55:50 +0000 (17:55 +0800)]
BaseTools: generate alignment when the FV content come from the filesystem

when the FV contents come from the filesystem instead of from a named FDF
section, the build tool missed to generate alignment for this FV. The fix
is get the alignment value from FV header and use this value to generate
alignment.

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 agoBaseTools: Extend the RAW format to support multiple binary files
Yonghong Zhu [Mon, 21 Mar 2016 11:27:35 +0000 (19:27 +0800)]
BaseTools: Extend the RAW format to support multiple binary files

Current FDF spec updated to support multiple binary files for RAW File
in the [FV] and [Capsule] section. For the multiple normal files, it may
have the optional FfsAlignment.
Example:
FILE RAW = 197DB236-F856-4924-91F8-C1F12FB875F3 {
 Align=16 $(PLATFORM_PACKAGE)/Binaries/File1.pdb
 Align=16 $(PLATFORM_PACKAGE)/Binaries/File2.pdb
 Align=16 $(PLATFORM_PACKAGE)/Binaries/File3.pdb
}

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 agoShellPkg AARCH64: remove DEBUG BuildOptions override
Ard Biesheuvel [Thu, 31 Dec 2015 12:57:27 +0000 (13:57 +0100)]
ShellPkg AARCH64: remove DEBUG BuildOptions override

The BuildOptions for AARCH64 in Application/Shell/Shell.inf only affect
the core Shell binary, and not the Shell component libraries which are
merged into the final Shell binary via NULL library class resolution.

This means we need to override the UEFI_APPLICATION build options in
the platform .DSC anyway, there is no point in setting these options
here as well. So remove them.

Contributed-under: TianoCore Contribution Agreement 1.0
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>
8 years agoBaseTools AARCH64: move DEBUG GCC49 to the small code model
Ard Biesheuvel [Fri, 25 Mar 2016 11:33:28 +0000 (12:33 +0100)]
BaseTools AARCH64: move DEBUG GCC49 to the small code model

When building AARCH64 platforms that include a Shell binary built from
source, we run into trouble when using the tiny code model for DEBUG
builds. The reason is that the Shell binary built in DEBUG mode exceeds
the 1 MB range of the ADR instruction, so anything that gets pulled into
the final link of the Shell binary either needs to be built with the small
or large model, or needs to be sorted in some way to put the ADR references
close to their targets.

Since code size is not a big concern for DEBUG builds anyway, let's move
to the small code model for all modules when using DEBUG GCC49. This way,
there is no need for workarounds that are specific to UEFI_APPLICATION
modules in general, or the Shell application in particular.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
8 years agoOvmfPkg: Increase the maximum size for Authenticated variables
James Bottomley [Fri, 25 Mar 2016 01:38:41 +0000 (21:38 -0400)]
OvmfPkg: Increase the maximum size for Authenticated variables

During real world testing I was getting an error with too many entries
in db: On my Secure boot laptop, I currently have seven certificates:
two Microsoft ones, Three Kernel ones from various distributions, my
own Secure Key and a temporary test key.  That gives a total EFI
Signature List size of 8317 which is over the 0x2000 maximum.

Fix this by setting the PcdMaxAuthVariableSize to 0x2800 (10K) which
isn't much of an increase but allows for 9-10 certificates.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
8 years agoBaseTools/GCC: set -Wno-unused-but-set-variables only on RELEASE builds
Ard Biesheuvel [Thu, 24 Mar 2016 06:28:20 +0000 (07:28 +0100)]
BaseTools/GCC: set -Wno-unused-but-set-variables only on RELEASE builds

This aligns the GCC definitions for 4.6 and up to align with the ARM and
AARCH64 definitions, which is to ignore unused but set variables only on
RELEASE builds. This allows us to find instances of unused variables that
are left behind after refactoring. It also allows us to find bad new code,
which, due to the EDK2 coding style which disallows initialized automatic
variables, may contain such variables without having been noticed by other
toolchains.

(Slightly edited) observation from Jordan Justen
<jordan.l.justen@intel.com>: RELEASE builds must keep the flag because
debug code (such as assertions) may collapse to nothing -- e.g. if a
platform defines MDEPKG_NDEBUG for RELEASE -- and therefore trigger the
warning.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
[lersek@redhat.com: incorporate commit message update from Jordan]
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
8 years agoUefiCpuPkg: CpuMpPei: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 20:03:16 +0000 (21:03 +0100)]
UefiCpuPkg: CpuMpPei: remove set but unused variables

Cc: Jeff Fan <jeff.fan@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: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoUefiCpuPkg: PiSmmCpuDxeSmm: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 19:56:04 +0000 (20:56 +0100)]
UefiCpuPkg: PiSmmCpuDxeSmm: remove set but unused variables

Cc: Jeff Fan <jeff.fan@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: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoUefiCpuPkg/MtrrLib: remove unused but set variable
Ard Biesheuvel [Thu, 24 Mar 2016 06:28:19 +0000 (07:28 +0100)]
UefiCpuPkg/MtrrLib: remove unused but set variable

Remove variable TempQWord that is declared, assigned but never referenced.
This fixes a warning emitted by GCC when -Wunused-but-set-variable is in
effect.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoSourceLevelDebugPkg: DebugCommunicationLibUsb: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 21:05:34 +0000 (22:05 +0100)]
SourceLevelDebugPkg: DebugCommunicationLibUsb: remove set but unused variables

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoSourceLevelDebugPkg: DebugAgentCommon: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 21:02:42 +0000 (22:02 +0100)]
SourceLevelDebugPkg: DebugAgentCommon: remove set but unused variables

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoQuarkSocPkg: Ohci/Pei: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 20:46:11 +0000 (21:46 +0100)]
QuarkSocPkg: Ohci/Pei: remove set but unused variables

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.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>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoQuarkSocPkg: Ohci/Dxe: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 20:44:16 +0000 (21:44 +0100)]
QuarkSocPkg: Ohci/Dxe: remove set but unused variables

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.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>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoQuarkSocPkg: SDMediaDeviceDxe: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 20:41:51 +0000 (21:41 +0100)]
QuarkSocPkg: SDMediaDeviceDxe: remove set but unused variables

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.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>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoQuarkSocPkg: Spi/Common: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 20:39:59 +0000 (21:39 +0100)]
QuarkSocPkg: Spi/Common: remove set but unused variables

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.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>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoQuarkSocPkg: SmmControlPei: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 20:34:31 +0000 (21:34 +0100)]
QuarkSocPkg: SmmControlPei: remove set but unused variables

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.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>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoQuarkSocPkg: SmmControlDxe: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 20:32:59 +0000 (21:32 +0100)]
QuarkSocPkg: SmmControlDxe: remove set but unused variables

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.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>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoQuarkSocPkg: QNCInit/Dxe: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 20:29:44 +0000 (21:29 +0100)]
QuarkSocPkg: QNCInit/Dxe: remove set but unused variables

This patch also eliminates a PCI config space access, but that should be
fine.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.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>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoQuarkSocPkg: MemoryInit/Pei: remove set but unused variable TRFC
Laszlo Ersek [Fri, 18 Mar 2016 20:28:03 +0000 (21:28 +0100)]
QuarkSocPkg: MemoryInit/Pei: remove set but unused variable TRFC

The expression that was used to set it had no side effects.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.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>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoQuarkSocPkg: QNCSmmLib: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 20:25:45 +0000 (21:25 +0100)]
QuarkSocPkg: QNCSmmLib: remove set but unused variables

This patch also removes a PcdGet16() call, but that should be harmless.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.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>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoQuarkSocPkg: MtrrLib: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 20:23:23 +0000 (21:23 +0100)]
QuarkSocPkg: MtrrLib: remove set but unused variables

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.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>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoQuarkSocPkg: IntelQNCLib: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 20:22:02 +0000 (21:22 +0100)]
QuarkSocPkg: IntelQNCLib: remove set but unused variables

This patch also removes a few PCI config space accesses, but that
shouldn't be a problem.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.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>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoOptionRomPkg: FtdiUsbSerialDxe: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 19:46:17 +0000 (20:46 +0100)]
OptionRomPkg: FtdiUsbSerialDxe: remove set but unused variables

Cc: Ruiyu Ni <ruiyu.ni@intel.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>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoNetworkPkg: IpSecDxe: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 19:41:40 +0000 (20:41 +0100)]
NetworkPkg: IpSecDxe: remove set but unused variables

Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoMdeModulePkg: DeviceManagerUiLib: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 19:31:02 +0000 (20:31 +0100)]
MdeModulePkg: DeviceManagerUiLib: remove set but unused variables

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoMdeModulePkg: BootMaintenanceManagerUiLib: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 19:30:31 +0000 (20:30 +0100)]
MdeModulePkg: BootMaintenanceManagerUiLib: remove set but unused variables

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoMdeModulePkg: UfsPassThruDxe: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 19:29:15 +0000 (20:29 +0100)]
MdeModulePkg: UfsPassThruDxe: remove set but unused variables

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.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>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoMdeModulePkg: BootManagerMenuApp: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 19:26:10 +0000 (20:26 +0100)]
MdeModulePkg: BootManagerMenuApp: remove set but unused variables

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.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>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoMdeModulePkg/PciHostBridgeDxe: remove unused but set variables
Ard Biesheuvel [Thu, 24 Mar 2016 06:28:17 +0000 (07:28 +0100)]
MdeModulePkg/PciHostBridgeDxe: remove unused but set variables

Remove variables that are declared, assigned but never referenced. This
fixes a warning emitted by GCC when -Wunused-but-set-variable is in effect.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoIntelFspWrapperPkg: PeiFspHobProcessLibSample: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 19:05:39 +0000 (20:05 +0100)]
IntelFspWrapperPkg: PeiFspHobProcessLibSample: remove set but unused variables

Cc: Jiewen Yao <jiewen.yao@intel.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>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoIntelFrameworkModulePkg: LegacyBootMaintUiLib: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 18:52:46 +0000 (19:52 +0100)]
IntelFrameworkModulePkg: LegacyBootMaintUiLib: remove set but unused variables

Cc: Jeff Fan <jeff.fan@intel.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>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoIntelFrameworkModulePkg: DxeCapsuleLib: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 18:51:28 +0000 (19:51 +0100)]
IntelFrameworkModulePkg: DxeCapsuleLib: remove set but unused variables

Cc: Jeff Fan <jeff.fan@intel.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>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoIntelFrameworkModulePkg: BiosVideo: remove set but unused variable
Laszlo Ersek [Fri, 18 Mar 2016 18:50:08 +0000 (19:50 +0100)]
IntelFrameworkModulePkg: BiosVideo: remove set but unused variable

Cc: Jeff Fan <jeff.fan@intel.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>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoEmulatorPkg: CpuRuntimeDxe: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 18:41:34 +0000 (19:41 +0100)]
EmulatorPkg: CpuRuntimeDxe: remove set but unused variables

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.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>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoEdkCompatibilityPkg: SmmBaseHelper: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 18:27:12 +0000 (19:27 +0100)]
EdkCompatibilityPkg: SmmBaseHelper: remove set but unused variables

This patch also eliminates an AsmReadCr3() call in PageFaultHandler(), but
that should not be a problem.

Cc: Liming Gao <liming.gao@intel.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>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoEdkCompatibilityPkg: EdkIIGlueLib: remove set but unused variables
Laszlo Ersek [Fri, 18 Mar 2016 18:25:02 +0000 (19:25 +0100)]
EdkCompatibilityPkg: EdkIIGlueLib: remove set but unused variables

Cc: Liming Gao <liming.gao@intel.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>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoEdkCompatibilityPkg: BsSerialStatusCode: remove set but unused variable
Laszlo Ersek [Fri, 18 Mar 2016 18:22:47 +0000 (19:22 +0100)]
EdkCompatibilityPkg: BsSerialStatusCode: remove set but unused variable

Cc: Liming Gao <liming.gao@intel.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>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoEdkCompatibilityPkg: UefiEfiIfrSupportLib: remove set but not used variables
Laszlo Ersek [Fri, 18 Mar 2016 18:21:02 +0000 (19:21 +0100)]
EdkCompatibilityPkg: UefiEfiIfrSupportLib: remove set but not used variables

Cc: Liming Gao <liming.gao@intel.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>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoCorebootPayloadPkg: PlatformBdsLib: remove set but unused variables
Laszlo Ersek [Thu, 24 Mar 2016 09:48:21 +0000 (10:48 +0100)]
CorebootPayloadPkg: PlatformBdsLib: remove set but unused variables

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.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>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoCorebootPayloadPkg: FbGop: remove set but unused variables
Laszlo Ersek [Thu, 24 Mar 2016 09:47:03 +0000 (10:47 +0100)]
CorebootPayloadPkg: FbGop: remove set but unused variables

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.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>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoArmPkg|EmbeddedPkg: make PcdCpuVectorBaseAddress 64 bits wide
Leendert van Doorn [Thu, 24 Mar 2016 20:30:06 +0000 (15:30 -0500)]
ArmPkg|EmbeddedPkg: make PcdCpuVectorBaseAddress 64 bits wide

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leo Duran <leo.duran@amd.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoArmPlatformPkg: fixups for 64-bit pointers
Leendert van Doorn [Thu, 24 Mar 2016 20:30:08 +0000 (15:30 -0500)]
ArmPlatformPkg: fixups for 64-bit pointers

This retypes some stack base PCD as 64-bit, and fixes up a number of references
to 64-bit PCDs (including the retypes ones), to use the correct PcdGet64()
accessors. Note that, in the case of FixedPcdGet64, this does not actually
caused any problems, since that resolves to an immediate value. But the
generic PcdGetxx accessors should be typed according to the size of the PCD.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leo Duran <leo.duran@amd.com>
[ard.biesheuvel: fixed up some instances in the 32-bit ARM code]
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoArmPkg: apply Cortex-A57 errata
Leendert van Doorn [Thu, 24 Mar 2016 20:30:05 +0000 (15:30 -0500)]
ArmPkg: apply Cortex-A57 errata

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leo Duran <leo.duran@amd.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoEmbeddedPkg/RTC: use returned status at init-time
Leo Duran [Thu, 24 Mar 2016 20:30:11 +0000 (15:30 -0500)]
EmbeddedPkg/RTC: use returned status at init-time

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leo Duran <leo.duran@amd.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoNetworkPkg:Fix bug when parsing the dhcp6 option 16
Zhang, Lubo [Thu, 24 Mar 2016 08:45:32 +0000 (16:45 +0800)]
NetworkPkg:Fix bug when parsing the dhcp6 option 16

when to parse the DHCP6 reply packet,there will be 6
bytes offset before the option data according to
RFC 3315.

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: Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
8 years agoNetworkPkg:Fix Http boot download issue.
Zhang Lubo [Thu, 24 Mar 2016 08:59:22 +0000 (16:59 +0800)]
NetworkPkg:Fix Http boot download issue.

When http boot download the second time without return
out of the boot manager, the DHCP process will start twice
with the same Boot file uri and print the information twice
which we not expected. This is caused by wrong logic
of handling the device path of the boot file when loading 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: Fu Siyuan <siyuan.fu@intel.com>
8 years agoShellPkg/UefiHandleParsingLib: Fix GUID reference
Qiu Shumin [Fri, 25 Mar 2016 01:45:43 +0000 (09:45 +0800)]
ShellPkg/UefiHandleParsingLib: Fix GUID reference

Pass in GUID* for the GUID reference in a CatSPrint statement. Issue was noticed when running "dh -d -v" command on a system with a PCI NIC installed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
8 years agoBaseTools: Updated BuildNotes URLs
Peter Kirmeier [Thu, 17 Mar 2016 22:21:50 +0000 (06:21 +0800)]
BaseTools: Updated BuildNotes URLs

Updated URLs (git repository and step-by-step instructions)

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Peter Kirmeier <topeterk@freenet.de>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
8 years agoMdeModulePkg/RamDiskDxe: Fix typo in HII message
Alcantara, Paulo [Wed, 23 Mar 2016 17:19:44 +0000 (17:19 +0000)]
MdeModulePkg/RamDiskDxe: Fix typo in HII message

s/Configutation/Configuration/

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Paulo Alcantara <paulo.alc.cavalcanti@hp.com>
Signed-off-by: Juliano Ciocari <juliano.ciocari@hp.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
8 years agoSecurityPkg/SecureBootConfigDxe: Remove type casting from the ChooseFile handlers
Gary Lin [Mon, 21 Mar 2016 09:04:37 +0000 (17:04 +0800)]
SecurityPkg/SecureBootConfigDxe: Remove type casting from the ChooseFile handlers

The type casting in the ChooseFile is not necessary and it actually
hid the incompatible handlers from the compiler.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
8 years agoSecurityPkg/SecureBootConfigDxe: Declare EFIAPI for the ChooseFile handlers
Gary Lin [Mon, 21 Mar 2016 09:04:36 +0000 (17:04 +0800)]
SecurityPkg/SecureBootConfigDxe: Declare EFIAPI for the ChooseFile handlers

The SecureBootConfig now uses ChooseFile() from FileExplorerLib
to select the certificates to be enrolled into PK, KEK, DB, DBX,
or DBT, and the corresponding handlers to get the content of the
file. Per the definition of CHOOSE_HANDLER, the handler must use
EFIAPI as the calling convention. However, the calling convention
was not specified the following handlers: UpdatePKFromFile(),
UpdateKEKFromFile(), UpdateDBFromFile(), UpdateDBXFromFile(), and
UpdateDBTFromFile(). When compiling the firmware with gcc, the
default calling convention is not compatible with EFIAPI, so the
handlers interpreted the argument the wrong way and passed the
wrong device path to UpdatePage(), and the system crashed when
the user tried to enroll a certificate into the key database.

This commit specifies the calling convention for those functions
so that gcc can generate the right code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
8 years agoShellPkg/UefiShellDebug1CommandsLib: remove unused but set variable
Ard Biesheuvel [Thu, 24 Mar 2016 06:15:45 +0000 (07:15 +0100)]
ShellPkg/UefiShellDebug1CommandsLib: remove unused but set variable

Remove variable FStartRow that is declared, assigned but never referenced.
This fixes a warning emitted by GCC when -Wunused-but-set-variable is in
effect.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
8 years agoMdeModulePkg/PciBus: Should reserve enough bus number for HPC
Ruiyu Ni [Wed, 23 Mar 2016 05:54:51 +0000 (13:54 +0800)]
MdeModulePkg/PciBus: Should reserve enough bus number for HPC

When there is no bridge before the HPC (hot plug controller),
the issue cannot be seen.
But when there are bridges before the HPC, the PciBus will only
use the value (= <CurrentBusNumber> + <ReservedBusNumber>) as the
sub-ordinary bus number for HPC.
The correct sub-ordinary bus number should be:
<CurrentBusNumber> + <OccupiedBusNumber>(by earlier bridges) +
<ReservedBusNumber>.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoMdeModulePkg/Bds: Fix VS2012 build failure.
Ruiyu Ni [Thu, 24 Mar 2016 02:30:25 +0000 (10:30 +0800)]
MdeModulePkg/Bds: Fix VS2012 build failure.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
8 years agoShellPkg: Modify the 'dh' Shell command to dump the Firmware Management Protocol...
Tapan Shah [Fri, 18 Mar 2016 16:28:03 +0000 (11:28 -0500)]
ShellPkg: Modify the 'dh' Shell command to dump the Firmware Management Protocol Image Descriptor Information.

Modify 'dh' shell command to dump FirmwareManagement Protocol information.
Add FirmwareManagement image descriptor V1 and V2 structure definition in UefiHandleParsingLib.h to support decoding V1/V2 revisions.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tapan Shah <tapandshah@hpe.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
8 years agoMdePkg: Move SMBIOS data into the IndustryStandard header.
Marvin Häuser [Tue, 22 Mar 2016 14:53:08 +0000 (14:53 +0000)]
MdePkg: Move SMBIOS data into the IndustryStandard header.

As the SMBIOS table types belong to the SMBIOS standard, they were
moved from the SMBIOS Protocol header into the SMBIOS
IndustryStandard header without the EFI_-prefix. Defines with the
EFI_-prefix have been kept in the Protocol header for
backwards-compatibility, resolving to the IndustryStandard defines.
The same has been done with the C types.

The SMBIOS table header structure had been duplicated -
SMBIOS_STRUCTURE in the IndustryStandard header and
EFI_SMBIOS_TABLE_HEADER in the Protocol file - and thus the
Protocol type was replaced with a typedef to the InudstryStandard's.
This doesn't only make it easier to maintain, but it also prevents
potential future issues as the Protocol type has been aligned, while
the standard and the IndustryStandard header declare it as
byte-packed.
This has worked well till now only because the members of the
structure do not require alignment yet.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
8 years agoShellPkg: Make the USB mouse behavior in 'edit' consistent with 'hexedit'.
Qiu Shumin [Mon, 14 Mar 2016 03:14:56 +0000 (11:14 +0800)]
ShellPkg: Make the USB mouse behavior in 'edit' consistent with 'hexedit'.

1. Make the USB mouse cursor move smoothly in 'edit'.
2. Make the USB mouse can drag and select text in 'edit'.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
8 years agoNetworkPkg: Fix HII related problem in HTTP boot driver.
Fu Siyuan [Thu, 17 Mar 2016 01:27:07 +0000 (09:27 +0800)]
NetworkPkg: Fix HII related problem in HTTP boot driver.

According to UEFI spec, HII_Config_Access.RouteConfig() should return success
if the required configuration has been processed. Current HTTP boot driver
may return error code in some situation, which failed the UEFI SCT test.
This patch fix this issue by removing the returned error status code and adding
extra check point in the Callback() function, which will pop up a message box
if user input an unsupported URI string.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Dong Eric <eric.dong@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
8 years agoMdeModulePkg/FileExplorerLib.h: Remove the redefinition of typedefs
Dandan Bi [Tue, 22 Mar 2016 07:37:54 +0000 (15:37 +0800)]
MdeModulePkg/FileExplorerLib.h: Remove the redefinition of typedefs

Xcode clang seems unhappy with both FileExplorerLib.h and
Protocol/FileExplorer.h both defining CHOOSE_HANDLER, now
remove the definition in FileExplorerLib.h.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Andrew Fish <afish@apple.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
8 years agoOvmfPkg: PciHostBridgeLib: install 64-bit PCI host aperture
Laszlo Ersek [Fri, 4 Mar 2016 19:06:26 +0000 (20:06 +0100)]
OvmfPkg: PciHostBridgeLib: install 64-bit PCI host aperture

On the normal boot path (which is when PciHostBridgeDxe runs), the PCDs
have been calculated; report the 64-bit PCI host aperture to
PciHostBridgeDxe.

In the Ia32 build, the PCD values (zeros) come directly from the DEC file,
and this patch makes no difference.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Cc: Thomas Lamprecht <t.lamprecht@proxmox.com>
Ref: https://github.com/tianocore/edk2/issues/59
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: PlatformPei: determine the 64-bit PCI host aperture for X64 DXE
Laszlo Ersek [Fri, 4 Mar 2016 18:30:45 +0000 (19:30 +0100)]
OvmfPkg: PlatformPei: determine the 64-bit PCI host aperture for X64 DXE

The main observation about the 64-bit PCI host aperture is that it is the
highest part of the useful address space. It impacts the top of the GCD
memory space map, and, consequently, our maximum address width calculation
for the CPU HOB too.

Thus, modify the GetFirstNonAddress() function to consider the following
areas above the high RAM, while calculating the first non-address (i.e.,
the highest inclusive address, plus one):

- the memory hotplug area (optional, the size comes from QEMU),

- the 64-bit PCI host aperture (we set a default size).

While computing the first non-address, capture the base and the size of
the 64-bit PCI host aperture at once in PCDs, since they are natural parts
of the calculation.

(Similarly to how PcdPciMmio32* are not rewritten on the S3 resume path
(see the InitializePlatform() -> MemMapInitialization() condition), nor
are PcdPciMmio64*. Only the core PciHostBridgeDxe driver consumes them,
through our PciHostBridgeLib instance.)

Set 32GB as the default size for the aperture. Issue#59 mentions the
NVIDIA Tesla K80 as an assignable device. According to nvidia.com, these
cards may have 24GB of memory (probably 16GB + 8GB BARs).

As a strictly experimental feature, the user can specify the size of the
aperture (in MB) as well, with the QEMU option

  -fw_cfg name=opt/ovmf/X-PciMmio64Mb,string=65536

The "X-" prefix follows the QEMU tradition (spelled "x-" there), meaning
that the property is experimental, unstable, and might go away any time.
Gerd has proposed heuristics for sizing the aperture automatically (based
on 1GB page support and PCPU address width), but such should be delayed to
a later patch (which may very well back out "X-PciMmio64Mb" then).

For "everyday" guests, the 32GB default for the aperture size shouldn't
impact the PEI memory demand (the size of the page tables that the DXE IPL
PEIM builds). Namely, we've never reported narrower than 36-bit addresses;
the DXE IPL PEIM has always built page tables for 64GB at least.

For the aperture to bump the address width above 36 bits, either the guest
must have quite a bit of memory itself (in which case the additional PEI
memory demand shouldn't matter), or the user must specify a large aperture
manually with "X-PciMmio64Mb" (and then he or she is also responsible for
giving enough RAM to the VM, to satisfy the PEI memory demand).

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Cc: Thomas Lamprecht <t.lamprecht@proxmox.com>
Ref: https://github.com/tianocore/edk2/issues/59
Ref: http://www.nvidia.com/object/tesla-servers.html
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: PlatformPei: factor out GetFirstNonAddress()
Laszlo Ersek [Fri, 4 Mar 2016 16:23:35 +0000 (17:23 +0100)]
OvmfPkg: PlatformPei: factor out GetFirstNonAddress()

Factor out the expression that is currently the basis of the address width
calculation into a standalone function. In the next patches we'll raise
the return value under certain circumstances.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Cc: Thomas Lamprecht <t.lamprecht@proxmox.com>
Ref: https://github.com/tianocore/edk2/issues/59
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: AcpiPlatformDxe: enable PCI IO and MMIO while fetching QEMU tables
Laszlo Ersek [Sun, 13 Mar 2016 14:34:07 +0000 (15:34 +0100)]
OvmfPkg: AcpiPlatformDxe: enable PCI IO and MMIO while fetching QEMU tables

Now that the previous patches ensure that we can access all PCI devices in
AcpiPlatformDxe, we can enable IO and MMIO decoding for all of them while
we contact QEMU for the ACPI tables. See more details in the patch titled:

  OvmfPkg: introduce gRootBridgesConnectedEventGroupGuid

In particular, this patch will prevent the bug when the 64-bit MMIO
aperture is completely missing from QEMU's _CRS, and consequently Linux
rejects 64-bit BARs with the error message

  pci 0000:00:03.0: can't claim BAR 4 [mem 0x800000000-0x8007fffff 64bit
                    pref]: no compatible bridge window

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
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: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOvmfPkg: AcpiPlatformDxe: when PCI is enabled, wait for Platform BDS's cue
Laszlo Ersek [Sun, 13 Mar 2016 17:09:57 +0000 (18:09 +0100)]
OvmfPkg: AcpiPlatformDxe: when PCI is enabled, wait for Platform BDS's cue

This patch doesn't change the behavior of AcpiPlatformDxe when
PcdPciDisableBusEnumeration is TRUE -- that is, when the driver runs on
Xen (OvmfPkg and ArmVirtPkg both), or when the driver runs on QEMU as part
of ArmVirtPkg but no PCI host bridge was found by VirtFdtDxe. In these
cases the driver continues to install the ACPI tables immediately.

However, when PcdPciDisableBusEnumeration is FALSE (i.e., when the driver
runs on QEMU as part of OVMF, or as part of ArmVirtPkg and VirtFdtDxe
finds a PCI host bridge), we now delay the ACPI table download from QEMU.
We wait until the Platform BDS tells us that root bridges have been
connected, and PciIo instances are available.

The explanation is in the patch titled

  OvmfPkg: introduce gRootBridgesConnectedEventGroupGuid

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
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: Jordan Justen <jordan.l.justen@intel.com>
8 years agoArmVirtPkg: PlatformIntelBdsLib: signal gRootBridgesConnectedEventGroupGuid
Laszlo Ersek [Sun, 13 Mar 2016 17:08:45 +0000 (18:08 +0100)]
ArmVirtPkg: PlatformIntelBdsLib: signal gRootBridgesConnectedEventGroupGuid

The explanation is in the patch titled

  OvmfPkg: introduce gRootBridgesConnectedEventGroupGuid

At this point, this signal doesn't do anything yet.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
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: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOvmfPkg: PlatformBdsLib: signal gRootBridgesConnectedEventGroupGuid
Laszlo Ersek [Sun, 13 Mar 2016 17:08:26 +0000 (18:08 +0100)]
OvmfPkg: PlatformBdsLib: signal gRootBridgesConnectedEventGroupGuid

The explanation is in the patch titled

  OvmfPkg: introduce gRootBridgesConnectedEventGroupGuid

At this point, this signal doesn't do anything yet.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
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: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOvmfPkg: introduce gRootBridgesConnectedEventGroupGuid
Laszlo Ersek [Sun, 13 Mar 2016 16:35:05 +0000 (17:35 +0100)]
OvmfPkg: introduce gRootBridgesConnectedEventGroupGuid

QEMU's ACPI table generator can only create meaningful _CRS objects --
apertures -- for the root buses if all of the PCI devices behind those
buses are actively decoding their IO and MMIO resources, at the time of
the firmware fetching the "etc/table-loader" fw_cfg file. This is not a
QEMU error; QEMU follows the definition of BARs (which are meaningless
when decoding is disabled).

Currently we hook up AcpiPlatformDxe to the PCI Bus driver's
gEfiPciEnumerationCompleteProtocolGuid cue. Unfortunately, when the PCI
Bus driver installs this protocol, it's *still* not the right time for
fetching "etc/table-loader": although resources have been allocated and
BARs have been programmed with them, the PCI Bus driver has also cleared
IO and MMIO decoding in the command registers of the devices.

Furthermore, we couldn't reenable IO and MMIO decoding temporarily in our
gEfiPciEnumerationCompleteProtocolGuid callback even if we wanted to,
because at that time the PCI Bus driver has not produced PciIo instances
yet.

Our Platform BDSes are responsible for connecting the root bridges, hence
they know exactly when the PciIo instances become available -- not when
PCI enumeration completes (signaled by the above protocol), but when the
ConnectController() calls return.

This is when our Platform BDSes should explicitly cue in AcpiPlatformDxe.
Then AcpiPlatformDxe can temporarily enable IO and MMIO decoding for all
devices, while it contacts QEMU for the ACPI payload.

This patch introduces the event group GUID that we'll use for unleashing
AcpiPlatformDxe from our Platform BDSes.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
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: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOvmfPkg: OvmfPkg.dec: add horizontal whitespace under Guids and Protocols
Laszlo Ersek [Tue, 22 Mar 2016 09:16:44 +0000 (10:16 +0100)]
OvmfPkg: OvmfPkg.dec: add horizontal whitespace under Guids and Protocols

We'll need more room in the next patch. No functional changes.

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: Jordan Justen <jordan.l.justen@intel.com>
8 years agoOvmfPkg/PlatformBdsLib: rebase to EfiEventGroupSignal
Laszlo Ersek [Tue, 22 Mar 2016 16:37:36 +0000 (17:37 +0100)]
OvmfPkg/PlatformBdsLib: rebase to EfiEventGroupSignal

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: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
8 years agoArmVirtPkg/PlatformIntelBdsLib: rebase to EfiEventGroupSignal
Laszlo Ersek [Tue, 22 Mar 2016 16:37:36 +0000 (17:37 +0100)]
ArmVirtPkg/PlatformIntelBdsLib: rebase to EfiEventGroupSignal

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Quickly-acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>