]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
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>
8 years agoIntelFrameworkPkg/FrameworkUefiLib: implement EfiEventGroupSignal
Laszlo Ersek [Tue, 22 Mar 2016 16:07:14 +0000 (17:07 +0100)]
IntelFrameworkPkg/FrameworkUefiLib: implement EfiEventGroupSignal

This patch follows the implementation seen in MdePkg's UefiLib instance,
so that FrameworkUefiLib also covers the UefiLib.h library class header
completely.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Suggested-by: 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 agoIntelFrameworkPkg/FrameworkUefiLib: move InternalEmptyFunction to UefiLib.c
Laszlo Ersek [Tue, 22 Mar 2016 16:01:22 +0000 (17:01 +0100)]
IntelFrameworkPkg/FrameworkUefiLib: move InternalEmptyFunction to UefiLib.c

The InternalEmptyFunction() is currently only used by code in
"UefiNotTiano.c" -- "Library functions that abstract areas of conflict
between framework and UEFI 2.0.". In the next patches,
InternalEmptyFunction() will be used from "UefiLib.c" as well, hence
promote it to "general utility" status: move the function definition to
"UefiLib.c", and place the function declaration (which is already extern)
into "UefiLibInternal.h".

Fix a typo in the function's name while at it.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
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 agoMdePkg/UefiLib: introduce EfiEventGroupSignal
Laszlo Ersek [Tue, 22 Mar 2016 16:07:14 +0000 (17:07 +0100)]
MdePkg/UefiLib: introduce EfiEventGroupSignal

This is a small convenience function that eases signaling an event group
(identified by GUID). An example where it can be used is Platform BDS
signaling the End-of-DXE event group.

The naming follows EfiNamedEventSignal().

The patch modifies the library class header, and updates the most commonly
used library instance at once. Other library instances in the edk2 tree
will be adapted in the following patches.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Suggested-by: 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 agoMdePkg/UefiLib: move InternalEmptyFunction to UefiLib.c
Laszlo Ersek [Tue, 22 Mar 2016 16:01:22 +0000 (17:01 +0100)]
MdePkg/UefiLib: move InternalEmptyFunction to UefiLib.c

The InternalEmptyFunction() is currently only used by code in
"UefiNotTiano.c" -- "Library functions that abstract areas of conflict
between framework and UEFI 2.0.". In the next patches,
InternalEmptyFunction() will be used from "UefiLib.c" as well, hence
promote it to "general utility" status: move the function definition to
"UefiLib.c", and place the function declaration (which is already extern)
into "UefiLibInternal.h".

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
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 agoBaseTools: not include the undefined macro in response file
Yonghong Zhu [Wed, 23 Mar 2016 06:54:36 +0000 (14:54 +0800)]
BaseTools: not include the undefined macro in response file

In last Nmake patch, when we generate the response file, we would replace
all the Macros in the make file. Once there have undefined macro used,
the tool direct report error. In this patch, we use following solution to
resolve the failure.
1. Add all the defined macros into AutoGenObject macro dict
2. For the undefined macros which used in the Make file, when we generate
the response file, we not include this macro, let make phase to handle.

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/BootMaintenanceManagerUiLib: Remove type casting in ChooseFile
Dandan Bi [Tue, 22 Mar 2016 02:50:23 +0000 (10:50 +0800)]
MdeModulePkg/BootMaintenanceManagerUiLib: Remove type casting in ChooseFile

The type casting is not necessary and now remove it.

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: Eric Dong <eric.dong@intel.com>
Reviewed-by: Gary Lin <glin@suse.com>
8 years agoMdeModulePkg/BootMaintManagerUiLib: Declare EFIAPI for ChooseFile handler
Dandan Bi [Tue, 22 Mar 2016 02:38:01 +0000 (10:38 +0800)]
MdeModulePkg/BootMaintManagerUiLib: Declare EFIAPI for ChooseFile handler

The BootMaintenanceManagerUiLib use ChooseFile() from FileExplorerLib
to select files. And the third parameter in ChooseFile() is CHOOSE_HANDLER,
per the definition of CHOOSE_HANDLER, it must use EFIAPI as the calling
convention. But the calling convention was not specified for following
handlers: CreateBootOptionFromFile, CreateDriverOptionFromFile,
BootFromFile. Now specifies the calling convention for those functions.

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: Eric Dong <eric.dong@intel.com>
Reviewed-by: Gary Lin <glin@suse.com>
8 years agoMdeModulePkg RamDiskDxe: Remove unnecessary TPL raise operations
Hao Wu [Tue, 8 Mar 2016 01:40:57 +0000 (09:40 +0800)]
MdeModulePkg RamDiskDxe: Remove unnecessary TPL raise operations

There is no asynchronous operations to the registered RAM disks link list
maintained within RamDiskDxe driver, therefore, the TPL raise and restore
operations when dealing with the link list are unnecessary.

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 RamDiskDxe: Uninstall DEVICE_PATH_PROTOCOL with correct param
Hao Wu [Tue, 8 Mar 2016 01:35:14 +0000 (09:35 +0800)]
MdeModulePkg RamDiskDxe: Uninstall DEVICE_PATH_PROTOCOL with correct param

Previously, the code uninstalls the DEVICE_PATH_PROTOCOL with the device
path given by caller of the 'RamDiskUnregister' function. The given device
path might be different from the one used to install the
DEVICE_PATH_PROTOCOL.

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 RamDiskDxe: Remove unnecessary 'DisconnectController' calls
Hao Wu [Tue, 8 Mar 2016 01:30:07 +0000 (09:30 +0800)]
MdeModulePkg RamDiskDxe: Remove unnecessary 'DisconnectController' calls

The 'DisconnectController' function calls after
'UninstallMultipleProtocolInterfaces' are unnecessary, since
'DisconnectController' is called inside function
'UninstallMultipleProtocolInterfaces'.

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/Bds: BDS hotkey shouldn't work on inactive consoles
Ruiyu Ni [Fri, 18 Mar 2016 07:48:49 +0000 (15:48 +0800)]
MdeModulePkg/Bds: BDS hotkey shouldn't work on inactive consoles

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: Sunny Wang <sunnywang@intel.com>
8 years agoArmPkg/AArch64Mmu: use correct AP[] bits in ArmClearMemoryRegionReadOnly
Ard Biesheuvel [Thu, 17 Mar 2016 13:55:00 +0000 (14:55 +0100)]
ArmPkg/AArch64Mmu: use correct AP[] bits in ArmClearMemoryRegionReadOnly

The function ArmClearMemoryRegionReadOnly() was supposed to undo the
effect of ArmSetMemoryRegionReadOnly(), but instead, it sets the permissions
to EL0-no access, EL1-read-only. Since the EL0 bit should be 1 to align
with EL2/3 (where the bit is SBO), use TT_AP_RW_RW instead, which makes the
entry read-write for EL0 when executing at EL1, and read-write for all other
levels.

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 agoArmPkg/ArmExceptionLib: reimplement register stack/unstack routines
Ard Biesheuvel [Thu, 17 Mar 2016 13:05:28 +0000 (14:05 +0100)]
ArmPkg/ArmExceptionLib: reimplement register stack/unstack routines

This replaces the somewhat opaque preprocessor based stack/unstack macros
with open coded ldp/stp sequences to preserve the interrupted context
before handing over to the exception handler in C.

This removes various arithmetic operations on the stack pointer, and
reduces the exception return critical section to its minimum size (i.e.,
the bare minimum required to populate the ELR and SPSR registers and invoke
the eret).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Eugene Cohen <eugene@hp.com>
8 years agoArmPkg/ArmExceptionLib: avoid indirect call if using vector table in place
Ard Biesheuvel [Thu, 17 Mar 2016 10:39:01 +0000 (11:39 +0100)]
ArmPkg/ArmExceptionLib: avoid indirect call if using vector table in place

If we are using the vector table in place, there is no need to make an
indirect call to the common handler routine from the vector table entries,
so just use a straight branch instruction in that case.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Eugene Cohen <eugene@hp.com>
8 years agoArmPkg/ArmExceptionLib: make build time define visible to the compiler
Ard Biesheuvel [Thu, 17 Mar 2016 10:33:58 +0000 (11:33 +0100)]
ArmPkg/ArmExceptionLib: make build time define visible to the compiler

The global gArmRelocateVectorTable is a build time constant, but due to
its external linkage and lack of constness, the compiler does not see that.
So turn it into a static boolean, and at the same time, make the function
CopyExceptionHandlers() (which is only called if gArmRelocateVectorTable is
set) static as well, so that the compiler can eliminate it completely if
we are using the vector table in place.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Eugene Cohen <eugene@hp.com>
8 years agoArmPkg/ArmExceptionLib: don't restore ESR and FAR upon exception return
Ard Biesheuvel [Thu, 17 Mar 2016 07:55:39 +0000 (08:55 +0100)]
ArmPkg/ArmExceptionLib: don't restore ESR and FAR upon exception return

ESR and FAR are populated by the hardware upon exception entry, and
describe the exception, not the interrupted context. So there is no point
in restoring their values before returning from the exception.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Eugene Cohen <eugene@hp.com>
8 years agoArmPkg/ArmExceptionLib: stack FPSR on common path
Ard Biesheuvel [Thu, 17 Mar 2016 07:54:11 +0000 (08:54 +0100)]
ArmPkg/ArmExceptionLib: stack FPSR on common path

We have three code paths to stack/unstack the exception context, one for
each of EL3, EL2 and EL1. However, they all access the same copy of FPSR
so move that access to the common path.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Eugene Cohen <eugene@hp.com>
8 years agoArmPkg/ArmExceptionLib: fold exception handler prologue into vector table
Ard Biesheuvel [Wed, 16 Mar 2016 15:45:39 +0000 (16:45 +0100)]
ArmPkg/ArmExceptionLib: fold exception handler prologue into vector table

Unlike the AArch32 vector table, which has room for a single instruction
for each exception type, the AArch64 exception table has 128 byte slots,
which can easily hold the shared prologues that are emitted out of line.

So refactor this code into a single macro, and expand it into each vector
table slot. Since the address of the command handler entry point is no
longer patched in by the C code, we can just emit the literal into each
vector entry directly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Eugene Cohen <eugene@hp.com>
8 years agoArmPkg/AsmMacroIoLibV8: remove undocumented assumption from ELx macros
Ard Biesheuvel [Thu, 17 Mar 2016 08:07:28 +0000 (09:07 +0100)]
ArmPkg/AsmMacroIoLibV8: remove undocumented assumption from ELx macros

The macros EL1_OR_EL2() and EL1_OR_EL2_OR_EL3() allow conditional execution
of assembly sequences based on the current exception level, by jumping to
caller supplied labels 1f, 2f or 3f. However, the jump to 1f is actually
a fallthrough, which means the EL1 code needs to follow right after the
macro invocation, and the 1f label is ignored.

So let's fix this by making all jumps explicit.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Eugene Cohen <eugene@hp.com>
8 years agoBaseTools: Fix nmake failure due to command-line length limitation
Yonghong Zhu [Wed, 16 Mar 2016 03:06:44 +0000 (11:06 +0800)]
BaseTools: Fix nmake failure due to command-line length limitation

NMAKE is limited to command-line length of 4096 characters. Due to the
large number of /I directives specified on command line (one per include
directory), the path length of WORKSPACE is multiplied by the number of
/I directives and can exceed the limit.
This patch:
1. Add new build option -l, --cmd-len to set the maximum command line
length, default value is 4096.
2. Generate the response file only if the command line length exceed its
maximum characters (default is 4096) when build the module. Cover
PP_FLAGS, CC_FLAGS, VFRPP_FLAGS, APP_FLAGS, ASLPP_FLAGS, ASLCC_FLAGS and
ASM_FLAGS.
3. The content of the response file is combine from the FLAGS option and
INC option.
4. When build failure, it would print out the response file's file
location and its content.

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 agoMdePkg/Pci22.h: Fix a coding style issue
Ruiyu Ni [Fri, 18 Mar 2016 06:04:51 +0000 (14:04 +0800)]
MdePkg/Pci22.h: Fix a coding style issue

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
8 years agoMdeModulePkg DxeCore: Address boundary check for Type AllocateAddress
Star Zeng [Fri, 18 Mar 2016 01:52:44 +0000 (09:52 +0800)]
MdeModulePkg DxeCore: Address boundary check for Type AllocateAddress

Check for Type AllocateAddress,
if NumberOfPages is 0 or
if (NumberOfPages << EFI_PAGE_SHIFT) is above MAX_ADDRESS or
if (Start + NumberOfBytes) rolls over 0 or
if Start is above MAX_ADDRESS or
if End is above MAX_ADDRESS,
return EFI_NOT_FOUND.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@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: Liming Gao <liming.gao@intel.com>
8 years agoMdeModulePkg DxeCore: Check Start consistently in CoreConvertPagesEx
Star Zeng [Fri, 18 Mar 2016 01:46:24 +0000 (09:46 +0800)]
MdeModulePkg DxeCore: Check Start consistently in CoreConvertPagesEx

Current check:
ASSERT (NumberOfPages);
ASSERT ((Start & EFI_PAGE_MASK) == 0);
ASSERT (End > Start) ;

if (NumberOfPages == 0 ||
    ((Start & EFI_PAGE_MASK) != 0) ||
    (Start > (Start + NumberOfBytes))) {

This patch is to update "(Start > (Start + NumberOfBytes))" to "(Start >= End)"
to be consistent with "ASSERT (End > Start)"

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@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: Liming Gao <liming.gao@intel.com>