]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
8 years agoUefiCpuPkg/MtrrLib:Initialize local variables before use them
Jeff Fan [Thu, 10 Dec 2015 07:10:13 +0000 (07:10 +0000)]
UefiCpuPkg/MtrrLib:Initialize local variables before use them

Cc: Shumin Qiu <shumin.qiu@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19183 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/UefiCpuPkg.uni: Add PcdCpuNumberOfReservedVariableMtrrs
Jeff Fan [Thu, 10 Dec 2015 07:09:45 +0000 (07:09 +0000)]
UefiCpuPkg/UefiCpuPkg.uni: Add PcdCpuNumberOfReservedVariableMtrrs

Cc: Shumin Qiu <shumin.qiu@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19182 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg/mm: Fix mm to support multiple root bridge platform
Ruiyu Ni [Thu, 10 Dec 2015 04:18:35 +0000 (04:18 +0000)]
ShellPkg/mm: Fix mm to support multiple root bridge platform

In multiple root bridge platforms, different root bridges may
share the same segment but occupy different range of buses,
or may occupy different segments.
The fix is to find the correct root bridge IO instance by
comparing not only the segment but also the bus ranges.
It tries to access the MMIO and IO in the following order:
PciRootBridgeIo, CpuIo and direct IO.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19181 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg/mm: Fix the help message to align to implementation and spec
Ruiyu Ni [Thu, 10 Dec 2015 04:17:59 +0000 (04:17 +0000)]
ShellPkg/mm: Fix the help message to align to implementation and spec

The implementation is already aligned to spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19180 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: Add PciSioSerialDxe driver
Ruiyu Ni [Thu, 10 Dec 2015 02:47:16 +0000 (02:47 +0000)]
MdeModulePkg: Add PciSioSerialDxe driver

PciSioSerialDxe driver can manages UARTs on a SIO chip or a PCI/PCIE
card.
It manages the SIO instance whose last device path node is a ACPI
device path and the HID in the ACPI device path node equals to
EISA_PNP_ID (0x501).
It also manages the PCI IO instance whose class code is 7/0/2 (16550
UART). But when proper value is set to PcdPciSerialParameters, the
driver can also manage non-standard PCI serial cards by matching
the Vendor ID and Device ID specified in PcdPciSerialParameters.
The PCI BAR index, IO/MMIO offset, register stride, clock rate can
also be specified through the same PCD.

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: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19179 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg: Fix the potential NULL pointer dereferenced issue
Jiaxin Wu [Thu, 10 Dec 2015 01:44:56 +0000 (01:44 +0000)]
NetworkPkg: Fix the potential NULL pointer dereferenced issue

This patch is used to fix the potential NULL pointer dereferenced
in function 'ParseDnsResponse'.

Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19178 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Make 'dh' support showing all spec defined protocols.
Jaben Carsey [Wed, 9 Dec 2015 23:08:07 +0000 (23:08 +0000)]
ShellPkg: Make 'dh' support showing all spec defined protocols.

When using 'dh' to dump all protocols installed on a handle, some of
them are shown as 'UnknownDevice'.

Device patch make 'dh' support all spec defined protocols.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19177 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Convert all .uni files to utf-8
Jordan Justen [Wed, 9 Dec 2015 23:07:58 +0000 (23:07 +0000)]
ShellPkg: Convert all .uni files to utf-8

To convert these files I ran:

$ python3 BaseTools/Scripts/ConvertUni.py ShellPkg

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Shumin Qiu <shumin.qiu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19176 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdePkg: Restore SetupMode macro definition
Chao Zhang [Wed, 9 Dec 2015 01:27:38 +0000 (01:27 +0000)]
MdePkg: Restore SetupMode macro definition

Restore SetupMode macro definition to keep backward compatibility. No current module is referencing them now.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19175 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg: update InvalidateInstructionCacheRange to flush only to PoU
Eugene Cohen [Tue, 8 Dec 2015 15:58:53 +0000 (15:58 +0000)]
ArmPkg: update InvalidateInstructionCacheRange to flush only to PoU

This patch updates the ArmPkg variant of InvalidateInstructionCacheRange to
flush the data cache only to the point of unification (PoU). This improves
performance and also allows invalidation in scenarios where it would be
inappropriate to flush to the point of coherency (like when executing code
from L2 configured as cache-as-ram).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <eugene@hp.com>
Added AARCH64 and ARM/GCC implementations of the above.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19174 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg/ArmVExpress-CTA15-A7: remove stale ArmPlatformGlobalVariable PCD
Ard Biesheuvel [Tue, 8 Dec 2015 14:16:30 +0000 (14:16 +0000)]
ArmPlatformPkg/ArmVExpress-CTA15-A7: remove stale ArmPlatformGlobalVariable PCD

Now that we removed the complete ArmPlatformGlobalVariable implementation,
remove stale PCD references to it from ArmVExpress-CTA15-A7.dsc

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19173 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/PrePeiCore: use explicit UINTN cast in VOID* arithmetic
Ard Biesheuvel [Tue, 8 Dec 2015 14:15:14 +0000 (14:15 +0000)]
ArmPkg/PrePeiCore: use explicit UINTN cast in VOID* arithmetic

RVCT does not like the arithmetic involving a VOID* pointer that was
introduced in SVN r19163, so use explicit casts instead.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19172 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoDeviceManagerLib: Update copyright, use BSD license instead of Intel license.
Eric Dong [Tue, 8 Dec 2015 13:49:40 +0000 (13:49 +0000)]
DeviceManagerLib: Update copyright, use BSD license instead of Intel license.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19171 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBootMaintenanceManagerLib: Update copyright, use BSD license instead of Intel license.
Eric Dong [Tue, 8 Dec 2015 13:49:15 +0000 (13:49 +0000)]
BootMaintenanceManagerLib: Update copyright, use BSD license instead of Intel license.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19170 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoFileExplorerLib: Update copyright, use BSD license instead of Intel license.
Eric Dong [Tue, 8 Dec 2015 13:48:35 +0000 (13:48 +0000)]
FileExplorerLib: Update copyright, use BSD license instead of Intel license.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19169 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBootManagerLib: Update copyright, use BSD license instead of Intel license.
Eric Dong [Tue, 8 Dec 2015 13:47:23 +0000 (13:47 +0000)]
BootManagerLib: Update copyright, use BSD license instead of Intel license.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19168 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: Use PcdSet##S to replace PcdSet##
Dandan Bi [Tue, 8 Dec 2015 08:03:42 +0000 (08:03 +0000)]
MdeModulePkg: Use PcdSet##S to replace PcdSet##

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19166 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/CpuMpPei: Add missing point at function header
Jeff Fan [Tue, 8 Dec 2015 07:51:29 +0000 (07:51 +0000)]
UefiCpuPkg/CpuMpPei: Add missing point at function header

Cc: Qiu Shumin <shumin.qiu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19165 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools GCC: avoid the use of COMMON symbols
Ard Biesheuvel [Tue, 8 Dec 2015 07:40:12 +0000 (07:40 +0000)]
BaseTools GCC: avoid the use of COMMON symbols

The default behavior of the GCC compiler is to emit uninitialized globals
with external linkage into a COMMON section, where duplicate definitions
are merged. This may result in unexpected behavior, since global variables
defined under the same name in different C files may not refer to the same
logical data item.

For instance, the definitions of EFI_EVENT mVirtualAddressChangeEvent that
[used to] appear in the following files:

  CryptoPkg/Library/BaseCryptLib/SysCall/RuntimeMemAllocation.c
  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c

will be folded into a single instance of the variable when the latter
module includes the former library, which can lead to unexpected results.

Even if some may argue that there are legal uses for COMMON allocation, the
high modularity of EDK2 combined with the low level of awareness of the
intracicies surrounding common allocation and the generally poor EDK2
developer discipline regarding the use of the STATIC keyword* make a strong
case for disabling it by default, and re-enabling it explicitly for packages
that depend on it.

So prevent GCC from emitting variables into the COMMON section, by passing
-fno-common to the compiler, and discarding the section in the GNU ld linker
script.

* Any function or variable that is only referenced from the translation unit
  that defines it could be made STATIC. This does not only prevent issues
  like the above, it also allows the compiler to generate better code, e.g.,
  drop out of line function definitions after inlining all invocations or
  perform constant propagation on variables.

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>
Tested-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19164 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/PrePeiCore: adhere to architectural stack alignment requirement
Ard Biesheuvel [Tue, 8 Dec 2015 07:35:30 +0000 (07:35 +0000)]
ArmPkg/PrePeiCore: adhere to architectural stack alignment requirement

Instead of using fuzzy arithmetic with a hardcoded stack alignment value
of 0x4, use the symbolic constant CPU_STACK_ALIGNMENT (which is at least
8 bytes, btw) to round the temporary stack base and size.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19163 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/MtrrLib: Add MtrrSetMemoryAttributeInMtrrSettings()
Michael Kinney [Tue, 8 Dec 2015 05:26:26 +0000 (05:26 +0000)]
UefiCpuPkg/MtrrLib: Add MtrrSetMemoryAttributeInMtrrSettings()

Add new API MtrrSetMemoryAttributeInMtrrSettings() in MtrrLib. Platform could
use this API to set MTRR setting into local MTRR settings buffer instead of
MTRRs. At last, platform could use MtrrSetAllMtrrs() to set the MTRR settings
into MTRRs totally. It could improve MTRRs programming performance obviously,
specially when platform is going to program a set of MTRRs.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19162 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/MtrrLib: Add MtrrDebugPrintAllMtrrsWorker()
Michael Kinney [Tue, 8 Dec 2015 05:25:48 +0000 (05:25 +0000)]
UefiCpuPkg/MtrrLib: Add MtrrDebugPrintAllMtrrsWorker()

MtrrDebugPrintAllMtrrsWorker() provides the capability to dump the MTRR setting
from MTRRs or the input MTRR settings buffer.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19161 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/MtrrLib: Add worker functions to access MTRRs or variable
Michael Kinney [Tue, 8 Dec 2015 05:25:21 +0000 (05:25 +0000)]
UefiCpuPkg/MtrrLib: Add worker functions to access MTRRs or variable

Add worker functions that could access MTRRs or MTRR settings in input buffer.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19160 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/MtrrLib: Print MTRR settings when set fixed/variable MTRRs
Michael Kinney [Tue, 8 Dec 2015 05:24:48 +0000 (05:24 +0000)]
UefiCpuPkg/MtrrLib: Print MTRR settings when set fixed/variable MTRRs

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19159 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/MtrrLib: Reduce hardware init when program variable MTRRs
Michael Kinney [Tue, 8 Dec 2015 05:24:18 +0000 (05:24 +0000)]
UefiCpuPkg/MtrrLib: Reduce hardware init when program variable MTRRs

When MtrrSetMemoryAttribute() programs variable MTRRs, it may disable/enable
cache and disable/enable MTRRs several times. This updating tries to do
operation in local variable and does the hardware initialization one time only.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19158 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/MtrrLib: Reduce hardware init when program fixed MTRRs
Michael Kinney [Tue, 8 Dec 2015 05:23:44 +0000 (05:23 +0000)]
UefiCpuPkg/MtrrLib: Reduce hardware init when program fixed MTRRs

When MtrrSetMemoryAttribute() programs fixed MTRRs, it may disable/enable cache
and disable/enable MTRRs several times. This updating tries to do operation in
local variable and does the hardware initialization one time only.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19157 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/MtrrLib: Add MtrrGetMemoryAttributeInVariableMtrrWorker ()
Michael Kinney [Tue, 8 Dec 2015 05:23:13 +0000 (05:23 +0000)]
UefiCpuPkg/MtrrLib: Add MtrrGetMemoryAttributeInVariableMtrrWorker ()

Add function to shadow the content of variable MTRRs into an internal array:
VariableMtrr. And used MtrrGetMemoryAttributeInVariableMtrrWorker() in other
functions.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19156 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/MtrrLib: Make use of worker functions to get MTRRs count
Michael Kinney [Tue, 8 Dec 2015 05:22:42 +0000 (05:22 +0000)]
UefiCpuPkg/MtrrLib: Make use of worker functions to get MTRRs count

Try to make use of worker functions to get MTRRs count. It could avoid invoking
IsMtrrSupported() for many times.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19155 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/MtrrLib: Adjust functions order
Michael Kinney [Tue, 8 Dec 2015 05:22:01 +0000 (05:22 +0000)]
UefiCpuPkg/MtrrLib: Adjust functions order

Only adjust functions order and there is no any real functionality impact.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19154 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/MtrrLib: Add worker functions not invoke IsMtrrSupported()
Michael Kinney [Tue, 8 Dec 2015 05:21:24 +0000 (05:21 +0000)]
UefiCpuPkg/MtrrLib: Add worker functions not invoke IsMtrrSupported()

Abstract some worker functions not to invoke IsMtrrSupported(). They could be
used by other functions to reduce the number of invoking times on
IsMtrrSupported().

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19153 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/MtrrLib: Fix some typo and clean up code format
Michael Kinney [Tue, 8 Dec 2015 05:20:44 +0000 (05:20 +0000)]
UefiCpuPkg/MtrrLib: Fix some typo and clean up code format

Fixed some typo. Removed some trailing spaces and TAB key. Clean up code format.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19152 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/MtrrLib: Add PCD PcdCpuNumberOfReservedVariableMtrrs
Jeff Fan [Tue, 8 Dec 2015 05:19:34 +0000 (05:19 +0000)]
UefiCpuPkg/MtrrLib: Add PCD PcdCpuNumberOfReservedVariableMtrrs

Current MtrrLib reserves 2 variable MTRRs for some legacy OS boot (CSM boots)
may require some MTRRs to be reserved for OS use. But UEFI OS boot will not use
MTRRs.

Per Scott's suggestion in
link: http://article.gmane.org/gmane.comp.bios.edk2.devel/4099
Add one PCD PcdCpuNumberOfReservedVariableMtrrs to specify the number of
variable MTRRs reserved for OS use. Setting its default value to 2 is for
back-compatibility.

Cc: Scott Duplichan <scott@notabs.org>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Suggested-by: Scott Duplichan <scott@notabs.org>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19151 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoRevert the change in r19143 for BUILDRULEORDER.
Yonghong Zhu [Tue, 8 Dec 2015 03:06:41 +0000 (03:06 +0000)]
Revert the change in r19143 for BUILDRULEORDER.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19150 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Refine the code to reduce time cost of 'map -r'
Qiu Shumin [Tue, 8 Dec 2015 02:00:16 +0000 (02:00 +0000)]
ShellPkg: Refine the code to reduce time cost of 'map -r'

In some platform 'map -r' may cost more than 1 min. This patch filter the target handles by
BlockIO and SimpleFileSystem protocol to reduce the time cost.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19149 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/BdsLib: Send RemainingDevicePath to PXE Load File protocol
Heyi Guo [Mon, 7 Dec 2015 16:51:35 +0000 (16:51 +0000)]
ArmPkg/BdsLib: Send RemainingDevicePath to PXE Load File protocol

Load File protocol requires remaining device path rather than whole
device path. For PXE, it actually requires end node device path only,
or else invalid parameter will be returned directly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19148 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCryptoPkg/OpensslLib: comment out unused code
Ard Biesheuvel [Mon, 7 Dec 2015 09:22:21 +0000 (09:22 +0000)]
CryptoPkg/OpensslLib: comment out unused code

This comments out the pqueue and ts_* source files from the OpensslLib
build, since they have no users.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Qin Long <qin.long@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19147 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCryptoPkg/BaseCryptLib: make mVirtualAddressChangeEvent STATIC
Ard Biesheuvel [Mon, 7 Dec 2015 09:20:20 +0000 (09:20 +0000)]
CryptoPkg/BaseCryptLib: make mVirtualAddressChangeEvent STATIC

Make mVirtualAddressChangeEvent STATIC to prevent it from conflicting
with other variables of the same name that may be defined in other
libraries (e.g., MdeModulePkg/Universal/Variable/RuntimeDxe)
This also removes the risk of mVirtualAddressChangeEvent being merged with
other uninitialized variables with external linkage by toolchains that perform
COMMON allocation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Qin Long <qin.long@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19146 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCryptoPkg ARM: add ArmSoftFloatLib resolution to CryptoPkg.dsc
Ard Biesheuvel [Mon, 7 Dec 2015 09:20:09 +0000 (09:20 +0000)]
CryptoPkg ARM: add ArmSoftFloatLib resolution to CryptoPkg.dsc

In order to build the ARM version of CryptoPkg from its own .DSC file,
it needs a resolution for the ArmSoftFloatLib dependency of OpensslLib.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Qin Long <qin.long@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19145 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools: update man page to add some descriptions
Yonghong Zhu [Mon, 7 Dec 2015 09:10:33 +0000 (09:10 +0000)]
BaseTools: update man page to add some descriptions

add the description for --ignore-sources and --check-usage into man page.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19144 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools: process the files by the priority in BUILDRULEORDER
Yonghong Zhu [Mon, 7 Dec 2015 09:09:31 +0000 (09:09 +0000)]
BaseTools: process the files by the priority in BUILDRULEORDER

By the BUILDRULEORDER feature to process files listed in INF [Sources]
sections in priority order, if a filename is listed with multiple
extensions, the tools will use only the file that matches the first
extension in the space separated list.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19143 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools: Fix a bug when apply patches to SEC use the FILE_GUID override
Yonghong Zhu [Mon, 7 Dec 2015 09:08:05 +0000 (09:08 +0000)]
BaseTools: Fix a bug when apply patches to SEC use the FILE_GUID override

Fix a bug when applying patches to SEC modules that use the FILE_GUID
override. Since a temp dir is used when FILE_GUID override is used, the
INF file path comparisons fail. The fix is to capture the real INF file
path comparisons instead of using the temp dir path to the INF.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19142 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools: Enhance GenFv Tool to report error message
Yonghong Zhu [Mon, 7 Dec 2015 09:04:39 +0000 (09:04 +0000)]
BaseTools: Enhance GenFv Tool to report error message

When two vtf files in one FV image, no FV file can be generated, but it
report the stack trace info. so we enhance the tool to report error
message directly but not the stack trace info.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19141 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoSecurityPkg: AuthVariableLib: Fix GCC compile error
Ard Biesheuvel [Mon, 7 Dec 2015 09:03:57 +0000 (09:03 +0000)]
SecurityPkg: AuthVariableLib: Fix GCC compile error

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19140 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools: Fix a bug in the VPD report generation
Yonghong Zhu [Mon, 7 Dec 2015 09:03:35 +0000 (09:03 +0000)]
BaseTools: Fix a bug in the VPD report generation

Changed the if condition to check whether current Region is FD VPD region
to fix a bug in the VPD report generation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19139 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoRevert the change in r19137.
Yonghong Zhu [Mon, 7 Dec 2015 09:01:44 +0000 (09:01 +0000)]
Revert the change in r19137.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19138 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools: Enhance GenFv Tool to report error message
Yonghong Zhu [Mon, 7 Dec 2015 08:29:10 +0000 (08:29 +0000)]
BaseTools: Enhance GenFv Tool to report error message

When two vtf files in one FV image, no FV file can be generated, but it
report the stack trace info. so we enhance the tool to report error
message directly but not the stack trace info.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19137 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools: Add support for INF statement in FD region
Yonghong Zhu [Mon, 7 Dec 2015 08:27:53 +0000 (08:27 +0000)]
BaseTools: Add support for INF statement in FD region

FD region today can be file or data, but not a patched image.Add support
for an INF statement in an FD region, so the binary from the INF can be
patched prior to being added to the FD region.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19136 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCryptoPkg: remove global variable 'timeval' from OpenSslSupport.h
Ard Biesheuvel [Mon, 7 Dec 2015 06:33:27 +0000 (06:33 +0000)]
CryptoPkg: remove global variable 'timeval' from OpenSslSupport.h

The header file OpenSslSupport.h not only defines a type 'struct timeval'
but also defines a global variable 'timeval' of that type. The RVCT
compiler does not merge this definition into a common symbol, resulting
in duplicate definition errors in the final link. So remove the
variable definition.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Qin Long <qin.long@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19135 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoSecurityPkg: SecureBootConfigDxe: SecureBoot UI for Customized SecureBoot Mode
Chao Zhang [Mon, 7 Dec 2015 06:20:36 +0000 (06:20 +0000)]
SecurityPkg: SecureBootConfigDxe: SecureBoot UI for Customized SecureBoot Mode

  Add SecureBoot UI support for Customized SecureBoot Mode transition according to Mantis 1263. User can do secure boot mode transition through UI.
  https://mantis.uefi.org/mantis/view.php?id=1263

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Zeng Star <star.zeng@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19134 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoSecurityPkg: AuthVariableLib: Customized SecureBoot Mode transition.
Chao Zhang [Mon, 7 Dec 2015 06:20:02 +0000 (06:20 +0000)]
SecurityPkg: AuthVariableLib: Customized SecureBoot Mode transition.

  Implement Customized SecureBoot Mode transition logic according to Mantis 1263, including AuditMode/DeployedMode/PK update management.
  Also implement image verification logic in AuditMode. Image Certificate & Hash are recorded to EFI Image Execution Table.
  https://mantis.uefi.org/mantis/view.php?id=1263

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Zeng Star <star.zeng@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19133 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoSecurityPkg: Add gEdkiiSecureBootModeGuid definition
Chao Zhang [Mon, 7 Dec 2015 06:16:23 +0000 (06:16 +0000)]
SecurityPkg: Add gEdkiiSecureBootModeGuid definition

Add gEdkiiSecureBootModeGuid definition for Enable Secure Boot feature defined in
UEFI2.5 Mantis 1263. It is a private variable GUID.
  https://mantis.uefi.org/mantis/view.php?id=1263

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Zeng Star <star.zeng@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19132 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: VarCheckUefiLib: Add DeployedMode/AuditMode var check logic
Chao Zhang [Mon, 7 Dec 2015 06:15:49 +0000 (06:15 +0000)]
MdeModulePkg: VarCheckUefiLib: Add DeployedMode/AuditMode var check logic

DeployedMode & AuditMode are UINT8 Global variable according to Enable Secure Boot feature defined in UEFI2.5 Mantis 1263. Add them to var check list.
  https://mantis.uefi.org/mantis/view.php?id=1263

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Zeng Star <star.zeng@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19131 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdePkg: Add AuditMode/DeployedMode name definition
Chao Zhang [Mon, 7 Dec 2015 06:15:20 +0000 (06:15 +0000)]
MdePkg: Add AuditMode/DeployedMode name definition

Add AuditMode/DeployedMode definition from Enable Secure Boot feature defined in UEFI2.5 Mantis 1263.
  https://mantis.uefi.org/mantis/view.php?id=1263

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Zeng Star <star.zeng@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19130 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoIntelFrameworkModulePkg: DebugAssert enhancement
Baraneedharan Anbazhagan [Mon, 7 Dec 2015 03:06:58 +0000 (03:06 +0000)]
IntelFrameworkModulePkg: DebugAssert enhancement

If the assert happens in a library, then it's hard to determine which module
using that library is generating that assert. Use gEfiCallerBaseName in
DebugAssert to display the module name.

In V2: Updated patch to use CopyMem instead of AsciiSPrint.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Baraneedharan Anbazhagan <anbazhagan@hp.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19129 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: DebugAssert enhancement
Baraneedharan Anbazhagan [Mon, 7 Dec 2015 03:06:30 +0000 (03:06 +0000)]
MdeModulePkg: DebugAssert enhancement

If the assert happens in a library, then it's hard to determine which module
using that library is generating that assert. Use gEfiCallerBaseName in
DebugAssert to display the module name.

V2: Updated code to use copy mem and ModuleNameSize calculation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Baraneedharan Anbazhagan <anbazhagan@hp.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19128 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdePkg: DebugAssert enhancement
Baraneedharan Anbazhagan [Mon, 7 Dec 2015 03:06:02 +0000 (03:06 +0000)]
MdePkg: DebugAssert enhancement

If the assert happens in a library, then it's hard to determine which
module using that library is generating that assert.  Use gEfiCallerBaseName
in DebugAssert to display the module name.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Baraneedharan Anbazhagan <anbazhagan@hp.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19127 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdePkg: Add Ipmi2.0 definitions head file.
Daocheng Bu [Mon, 7 Dec 2015 02:04:22 +0000 (02:04 +0000)]
MdePkg: Add Ipmi2.0 definitions head file.

Add Ipmi2.0 definitions head file based on Ipmi category:
App, Storage and etc.

In V2, correct #include IndustryStandard/IpmiNetFnSensorEventDefinitions.h,
and remove trailing space.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu <daocheng.bu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19125 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg: HighMemDxe: add memory space for the high memory nodes
Shannon Zhao [Fri, 4 Dec 2015 16:17:17 +0000 (16:17 +0000)]
ArmVirtPkg: HighMemDxe: add memory space for the high memory nodes

Here we add the memory space for the high memory nodes except the lowest
one in FDT. So these spaces will show up in the UEFI memory map.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
[lersek@redhat.com: rewrap at 79 chars, use NULL, print Status]

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19124 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg: ArmVirtPlatformLib: find the lowest memory node
Shannon Zhao [Fri, 4 Dec 2015 16:17:12 +0000 (16:17 +0000)]
ArmVirtPkg: ArmVirtPlatformLib: find the lowest memory node

While QEMU NUMA support on ARM will introduce more than one /memory node
in the device tree, it needs to find the lowest one and set
PcdSystemMemorySize with the actual size of this memory node.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19123 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: Fix VS2015 warning C4459 in XenBusDxe
Liming Gao [Fri, 4 Dec 2015 03:16:37 +0000 (03:16 +0000)]
OvmfPkg: Fix VS2015 warning C4459 in XenBusDxe

warning C4459: declaration of 'xs' hides global declaration.
Update code to rename local variable xs to xsp to be different.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19116 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCryptoPkg: Disable VS2015 warning C4311 in OpensslLib
Liming Gao [Fri, 4 Dec 2015 03:15:45 +0000 (03:15 +0000)]
CryptoPkg: Disable VS2015 warning C4311 in OpensslLib

Warning C4311: pointer truncation from 'type' to 'type'.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Qin Long <qin.long@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19115 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: Fix VS2015 warning C4311 & C4312 in RegularExpressionDxe
Liming Gao [Fri, 4 Dec 2015 03:15:08 +0000 (03:15 +0000)]
MdeModulePkg: Fix VS2015 warning C4311 & C4312 in RegularExpressionDxe

warning C4311: pointer truncation from 'void *' to 'unsigned long'
warning C4312: conversion from 'unsigned long' to 'void *' of greater size
Update code to convert type to UINTN first, then convert it to other type.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com>
Acked-by: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19114 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: Fix VS2015 warning C4456 in RegularExpressionDxe
Liming Gao [Fri, 4 Dec 2015 03:14:14 +0000 (03:14 +0000)]
MdeModulePkg: Fix VS2015 warning C4456 in RegularExpressionDxe

warning C4456: declaration of 'q' hides previous local declaration.
Update code to use the different local variable name.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com>
Acked-by: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19113 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: Fix VS2015 warning C4459 in DriverSampleDxe
Liming Gao [Fri, 4 Dec 2015 03:06:07 +0000 (03:06 +0000)]
MdeModulePkg: Fix VS2015 warning C4459 in DriverSampleDxe

warning C4459: declaration of 'PrivateData' hides global declaration.
Update DriverSampleDxe to rename global variable name to be different.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19112 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdePkg: Disable VS2015 warning C4701 & C4703
Liming Gao [Fri, 4 Dec 2015 03:05:28 +0000 (03:05 +0000)]
MdePkg: Disable VS2015 warning C4701 & C4703

C4701 & C4703 may cause false positive issues.
They have been disabled in VS2013.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19111 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Fix wrong return status for Ifconfig.c
Jiaxin Wu [Fri, 4 Dec 2015 01:10:17 +0000 (01:10 +0000)]
ShellPkg: Fix wrong return status for Ifconfig.c

The Ifconfig command handler tries to return an EFI_STATUS when
the return type should be SHELL_STATUS.

Cc: Cohen Eugene <eugene@hp.com>
Cc: Carsey Jaben <jaben.carsey@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19110 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg: update RVCT assembly functions to use new RVCT_ASM_EXPORT macro
Eugene Cohen [Thu, 3 Dec 2015 20:28:02 +0000 (20:28 +0000)]
ArmPkg: update RVCT assembly functions to use new RVCT_ASM_EXPORT macro

This has the effect of splitting assembly functions into their own sections
so the linker can remove unused ones to save space.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19109 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg: use explicit KERNEL_BLOB_TYPE cast
Ard Biesheuvel [Thu, 3 Dec 2015 08:51:36 +0000 (08:51 +0000)]
ArmVirtPkg: use explicit KERNEL_BLOB_TYPE cast

The ARM RVCT compiler does not allow implicit casts between enumerated
types and integer types. In this particular case, the STUB_FILE::Position
member is overloaded as a KERNEL_BLOB_TYPE identifier, so it does not
hurt to make that cast explicit.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19108 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoSecurityPkg: put missing empty lines at the end of some header files
Ard Biesheuvel [Thu, 3 Dec 2015 08:51:27 +0000 (08:51 +0000)]
SecurityPkg: put missing empty lines at the end of some header files

Some compilers (like RVCT) reject input files that do not end in a
newline. So add missing newlines to some SecurityPkg header files.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19107 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: remove unreachable code
Ard Biesheuvel [Thu, 3 Dec 2015 08:51:17 +0000 (08:51 +0000)]
MdeModulePkg: remove unreachable code

Some compilers (like RVCT) are finicky about unreachable code,
so remove it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19106 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoIntelFrameworkModulePkg: remove unreachable code
Ard Biesheuvel [Thu, 3 Dec 2015 08:51:06 +0000 (08:51 +0000)]
IntelFrameworkModulePkg: remove unreachable code

Some compilers (like RVCT) are finicky about unreachable code,
so remove it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19105 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools PatchCheck.py: Support binary diff
Jordan Justen [Thu, 3 Dec 2015 08:18:00 +0000 (08:18 +0000)]
BaseTools PatchCheck.py: Support binary diff

This allows a patch with binary data that is generated with --binary
to be parsed by the PatchCheck.py script.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19104 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools: Add VS2015 tool chain in tools_def.template
Wang Yu [Thu, 3 Dec 2015 03:19:01 +0000 (03:19 +0000)]
BaseTools: Add VS2015 tool chain in tools_def.template

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wang Yu <yu.wang@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19101 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/CpuS3DataDxe: Add more detailed description on GUID in INF
Jeff Fan [Thu, 3 Dec 2015 01:13:57 +0000 (01:13 +0000)]
UefiCpuPkg/CpuS3DataDxe: Add more detailed description on GUID in INF

Add the GUID gEfiEndOfDxeEventGroupGuid usage description in more details in
INF file.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19100 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoEmulatorPkg: Fix GCC49 build hang in PeiCore
Jordan Justen [Wed, 2 Dec 2015 20:02:58 +0000 (20:02 +0000)]
EmulatorPkg: Fix GCC49 build hang in PeiCore

This is a port of 55e96f9c601781b8dc52c40747922f6ca3521f9e / r17902 to
EmulatorPkg:

commit 55e96f9c601781b8dc52c40747922f6ca3521f9e
Author: Ruiyu Ni <ruiyu.ni@intel.com>
Date:   Thu Jul 9 08:55:23 2015 +0000

    OvmfPkg: Fix GCC49 build hang in PeiCore

Cc: Andrew Fish <afish@apple.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Fixes: https://github.com/tianocore/edk2/issues/24
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19099 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg RVCT: add asm macro combining EXPORT, AREA and label definition
Eugene Cohen [Wed, 2 Dec 2015 16:23:20 +0000 (16:23 +0000)]
ArmPkg RVCT: add asm macro combining EXPORT, AREA and label definition

In response to Leif's request earlier, this adds a new RVCT assembler
macro to centralize the exporting of assembly functions including the
EXPORT directive (so the linker can see it), the AREA directive (so
it's in its own section for code size reasons) and the function label
itself.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19098 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools RVCT: add preprocessor preinclude for AutoGen.h
Eugene Cohen [Wed, 2 Dec 2015 16:11:33 +0000 (16:11 +0000)]
BaseTools RVCT: add preprocessor preinclude for AutoGen.h

Ensure that AutoGen.h is force-included when the RVCT preprocessor
is invoked.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19097 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/CpuMpPei: Fix typo and add some comments
Jeff Fan [Wed, 2 Dec 2015 00:44:05 +0000 (00:44 +0000)]
UefiCpuPkg/CpuMpPei: Fix typo and add some comments

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19090 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/CpuMpPei: Save/Restore CRx/DRx register for APs waking up
Jeff Fan [Wed, 2 Dec 2015 00:43:45 +0000 (00:43 +0000)]
UefiCpuPkg/CpuMpPei: Save/Restore CRx/DRx register for APs waking up

PeiStartupAllAPs()/PeiStartupThisAP() will send INIT-SIPI-SIPI to wakeup APs to
execute AP function. However, some registers will be reset after APs received
INIT IPI. We need to restore some registers (For example, CRx/DRx) manually
after APs wakeup.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19089 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/CpuMpPei: Sync BSP's CRx to APs when initialization
Jeff Fan [Wed, 2 Dec 2015 00:43:19 +0000 (00:43 +0000)]
UefiCpuPkg/CpuMpPei: Sync BSP's CRx to APs when initialization

Save BSP's volatile register and sync CRx register to APs when AP 1st wake up.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19088 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/CpuMpPei: Set AP state to CpuStateIdle after initialization
Jeff Fan [Wed, 2 Dec 2015 00:42:59 +0000 (00:42 +0000)]
UefiCpuPkg/CpuMpPei: Set AP state to CpuStateIdle after initialization

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19087 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/CpuMpPei: Add CPU_VOLATILE_REGISTERS & worker functions
Jeff Fan [Wed, 2 Dec 2015 00:42:40 +0000 (00:42 +0000)]
UefiCpuPkg/CpuMpPei: Add CPU_VOLATILE_REGISTERS & worker functions

Add CPU_VOLATILE_REGISTERS definitions for CRx and DRx required to be restored
after APs received INIT IPI.

Add worker functions SaveVolatileRegisters()/RestoreVolatileRegisters() used to
save/restore CRx and DRx. It also check if Debugging Extensions supported or
not.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19086 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/CpuMpPei: Exchange whole CPU data in SortApicId()
Jeff Fan [Wed, 2 Dec 2015 00:42:09 +0000 (00:42 +0000)]
UefiCpuPkg/CpuMpPei: Exchange whole CPU data in SortApicId()

Current implementation only exchanges the APIC ID and BIST, this updating is to
exchange all CPU data.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19085 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg: Convert whole-cache InvalidateInstructionCache to just ASSERT
Eugene Cohen [Tue, 1 Dec 2015 18:39:29 +0000 (18:39 +0000)]
ArmPkg: Convert whole-cache InvalidateInstructionCache to just ASSERT

In SVN 18756 ("disallow whole D-cache maintenance operations")
InvalidateInstructionCache was modified to remove the full data cache
clean but left the full instruction cache invalidate. The change was
made to address issues in the set/way clean methodology but the
resulting code could lead someone to a painful debug. If a component
called this function, the proper code would not be flushed to the PoU,
since the intent of this function is not only to invalidate the I-cache
but to provide coherency after code loading / modification. This change
simply places an ASSERT(FALSE) in this function to avoid this hazard.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19084 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg/BootLogoLib: Fix INF comments to follow coding standards
Ruiyu Ni [Tue, 1 Dec 2015 06:56:36 +0000 (06:56 +0000)]
MdeModulePkg/BootLogoLib: Fix INF comments to follow coding standards

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19083 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg/BmpImageDecoderLib: Fix function header comments
Ruiyu Ni [Tue, 1 Dec 2015 06:52:44 +0000 (06:52 +0000)]
MdeModulePkg/BmpImageDecoderLib: Fix function header comments

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19082 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools: Clean some coding style issues
Yonghong Zhu [Tue, 1 Dec 2015 04:22:16 +0000 (04:22 +0000)]
BaseTools: Clean some coding style issues

This patch clean some coding style issues, majorly for space character.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19080 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg/NvmExpressDxe: Fix wrong logic in GetControllerName()
Anbazhagan, Baraneedharan [Tue, 1 Dec 2015 00:40:37 +0000 (00:40 +0000)]
MdeModulePkg/NvmExpressDxe: Fix wrong logic in GetControllerName()

NvmExpressComponentNameGetControllerName returns EFI_UNSUPPORTED if
child handle is passed. gEfiNvmExpressPassThruProtocolGuid needs to
be passed to EfiTestChildHandle instead of gEfiPciIoProtocolGuid.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Anbazhagan, Baraneedharan" <anbazhagan@hp.com>
Reviewed-by: "Tian, Feng" <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19071 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: replace README fine print about X64 SMM S3 with PlatformPei check
Laszlo Ersek [Mon, 30 Nov 2015 23:36:31 +0000 (23:36 +0000)]
OvmfPkg: replace README fine print about X64 SMM S3 with PlatformPei check

At the moment, the "UefiCpuPkg/Universal/Acpi/S3Resume2Pei" module doesn't
support S3 resume if the platform has SMM enabled and the PEI phase is
built for X64. We document this in the README, but it is not conspicuous
enough.

Replace the "fine print" in the README with a runtime check in
PlatformPei.

Cc: Jordan Justen <jordan.l.justen@intel.com>
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>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19070 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCorebootPayloadPkg PlatformHookLib: Fix GCC build failure
Star Zeng [Mon, 30 Nov 2015 21:11:29 +0000 (21:11 +0000)]
CorebootPayloadPkg PlatformHookLib: Fix GCC build failure

Add return status check to fix GCC build failure below.

error: right-hand operand of comma expression has no effect
[-Werror=unused-value]
((_gPcd_BinaryPatch_PcdSerialUseMmio = (Value)), RETURN_SUCCESS)

error: right-hand operand of comma expression has no effect
[-Werror=unused-value]
((_gPcd_BinaryPatch_PcdSerialRegisterBase = (Value)), RETURN_SUCCESS)

http://article.gmane.org/gmane.comp.bios.edk2.devel/4949

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Suggested-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19069 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/PiSmmCpu: Always set WP in CR0
Yao, Jiewen [Mon, 30 Nov 2015 19:57:45 +0000 (19:57 +0000)]
UefiCpuPkg/PiSmmCpu: Always set WP in CR0

So that we can use write-protection for code later.

It is REPOST.
It includes suggestion from Michael Kinney <michael.d.kinney@intel.com>:
- "For IA32 assembly, can we combine into a single OR instruction that
  sets both page enable and WP?"
- "For X64, does it make sense to use single OR instruction instead of 2
  BTS instructions as well?"

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Suggested-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Cc: "Fan, Jeff" <jeff.fan@intel.com>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: "Laszlo Ersek" <lersek@redhat.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19068 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/PiSmmCpu: Always set RW+P bit for page table by default
Yao, Jiewen [Mon, 30 Nov 2015 19:57:40 +0000 (19:57 +0000)]
UefiCpuPkg/PiSmmCpu: Always set RW+P bit for page table by default

So that we can use write-protection for code later.

This is REPOST.
It includes the bug fix from "Paolo Bonzini" <pbonzini@redhat.com>:

  Title: fix generation of 32-bit PAE page tables

  "Bits 1 and 2 are reserved in 32-bit PAE Page Directory Pointer Table
  Entries (PDPTEs); see Table 4-8 in the SDM.  With VMX extended page
  tables, the processor notices and fails the VM entry as soon as CR0.PG
  is set to 1."

And thanks "Laszlo Ersek" <lersek@redhat.com> to validate the fix.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Signed-off-by: "Paolo Bonzini" <pbonzini@redhat.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Cc: "Fan, Jeff" <jeff.fan@intel.com>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: "Laszlo Ersek" <lersek@redhat.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19067 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: README: document SMM status
Laszlo Ersek [Mon, 30 Nov 2015 18:49:07 +0000 (18:49 +0000)]
OvmfPkg: README: document SMM status

Cc: Paolo Bonzini <pbonzini@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19066 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: pull in SMM-based variable driver stack
Laszlo Ersek [Mon, 30 Nov 2015 18:49:03 +0000 (18:49 +0000)]
OvmfPkg: pull in SMM-based variable driver stack

When -D SMM_REQUIRE is given, replace both
- OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf and
- OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf
with
- OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf.

The outermost (= runtime DXE driver) VariableSmmRuntimeDxe enters SMM, and
the rest:
- the privileged half of the variable driver, VariableSmm,
- the fault tolerant write driver, FaultTolerantWriteSmm,
- and the FVB driver, FvbServicesSmm,
work in SMM purely.

We also resolve the BaseCryptLib class for DXE_SMM_DRIVER modules, for the
authenticated VariableSmm driver's sake.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19065 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: consolidate variable driver stack in DSC and FDF files
Laszlo Ersek [Mon, 30 Nov 2015 18:48:59 +0000 (18:48 +0000)]
OvmfPkg: consolidate variable driver stack in DSC and FDF files

The following modules constitute the variable driver stack:

- QemuFlashFvbServicesRuntimeDxe and EmuVariableFvbRuntimeDxe, runtime
  alternatives for providing the Firmware Volume Block(2) Protocol,
  dependent on qemu pflash presence,

- FaultTolerantWriteDxe, providing the Fault Tolerant Write Protocol,

- MdeModulePkg/Universal/Variable/RuntimeDxe, independently of
  -D SECURE_BOOT_ENABLE, providing the Variable and Variable Write
  Architectural Protocols.

Let's move these drivers closer to each other in the DSC and FDF files, so
that we can switch the variable driver stack to SMM with more local
changes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19064 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: QemuFlashFvbServicesRuntimeDxe: adhere to -D SMM_REQUIRE
Laszlo Ersek [Mon, 30 Nov 2015 18:48:54 +0000 (18:48 +0000)]
OvmfPkg: QemuFlashFvbServicesRuntimeDxe: adhere to -D SMM_REQUIRE

When the user requires "security" by passing -D SMM_REQUIRE, and
consequently by setting PcdSmmSmramRequire, enforce flash-based variables.

Furthermore, add two ASSERT()s to catch if the wrong module were pulled
into the build.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19063 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: QemuFlashFvbServicesRuntimeDxe: add DXE_SMM_DRIVER build
Laszlo Ersek [Mon, 30 Nov 2015 18:48:50 +0000 (18:48 +0000)]
OvmfPkg: QemuFlashFvbServicesRuntimeDxe: add DXE_SMM_DRIVER build

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19062 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: build PiSmmCpuDxeSmm for -D SMM_REQUIRE
Laszlo Ersek [Mon, 30 Nov 2015 18:48:46 +0000 (18:48 +0000)]
OvmfPkg: build PiSmmCpuDxeSmm for -D SMM_REQUIRE

At this point we can enable building PiSmmCpuDxeSmm.

CPU specific features, like SMRR detection, and functions that are used to
initialize SMM and process SMIs, are abstracted through the
SmmCpuFeaturesLib class for the PiSmmCpuDxeSmm module. Resolve it to our
own implementation under OvmfPkg -- it allows PiSmmCpuDxeSmm to work with
QEMU's and KVM's 64-bit state save map format, which follows the
definition from AMD's programmer manual.

SmmCpuPlatformHookLib provides platform specific functions that are used
to initialize SMM and process SMIs. Resolve it to the one Null instance
provided by UefiCpuPkg, which is expected to work for most platforms.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
[pbonzini@redhat.com: resolve the SmmCpuFeaturesLib class to OVMF's own
 instance]

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19061 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: build CpuS3DataDxe for -D SMM_REQUIRE
Laszlo Ersek [Mon, 30 Nov 2015 18:46:55 +0000 (18:46 +0000)]
OvmfPkg: build CpuS3DataDxe for -D SMM_REQUIRE

The PiSmmCpuDxeSmm driver from UefiCpuPkg depends on the ACPI_CPU_DATA
structure -- created by a platform- and CPU-specific driver -- in order to
support ACPI S3. The address of this structure is communicated through the
dynamic PCD PcdCpuS3DataAddress.

The "UefiCpuPkg/Include/AcpiCpuData.h" header file documents the fields of
this structure in detail.

The simple/generic "UefiCpuPkg/CpuS3DataDxe" driver creates and populates
the structure in a conformant way, and it co-operates well with
PiSmmCpuDxeSmm, for OVMF's purposes.

         PlatformBdsLib  CpuS3DataDxe     PiSmmCpuDxeSmm    S3Resume2Pei
         (DXE_DRIVER)    (DXE_DRIVER)     (DXE_SMM_DRIVER)  (PEIM)
         --------------  ---------------  ----------------  --------------
normal                   collects data
boot                     except MTRR
                         settings into
                         ACPI_CPU_DATA

                         sets
                         PcdCpuS3Da...

         signals
         End-of-Dxe
            |
            +----------> collects MTRR
                         settings into
                         ACPI_CPU_DATA

         installs
         [Dxe]Smm
         ReadyToLock
            |
            +---------------------------> fetches
                                          PcdCpuS3Dat...

                                          copies
                                          ACPI_CPU_DATA
                                          into SMRAM

runtime

S3
suspend

S3                                                          transfers
resume                                                      control to
                                                            PiSmmCpuDxe...
                                                                |
                                          uses             <----+
                                          ACPI_CPU_DATA
                                          from SMRAM

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19060 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: any AP in SMM should not wait for the BSP for more than 100 ms
Laszlo Ersek [Mon, 30 Nov 2015 18:46:50 +0000 (18:46 +0000)]
OvmfPkg: any AP in SMM should not wait for the BSP for more than 100 ms

This patch complements the previous one, "OvmfPkg: use relaxed AP SMM
synchronization mode". While that patch focuses on the case when the SMI
is raised synchronously by the BSP, on the BSP:

  BSPHandler()             [UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c]
    SmmWaitForApArrival()  [UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c]
      IsSyncTimerTimeout() [UefiCpuPkg/PiSmmCpuDxeSmm/SyncTimer.c]

this patch concerns itself with the case when it is one of the APs that
raises (and sees delivered) the synchronous SMI:

  APHandler()            [UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c]
    IsSyncTimerTimeout() [UefiCpuPkg/PiSmmCpuDxeSmm/SyncTimer.c]

Namely, in APHandler() the AP waits for the BSP to enter SMM regardless of
PcdCpuSmmSyncMode, for PcdCpuSmmApSyncTimeout microseconds (the default
value is 1 second). If the BSP doesn't show up in SMM within that
interval, then the AP brings it in with a directed SMI, and waits for the
BSP again for PcdCpuSmmApSyncTimeout microseconds.

Although during boot services, SmmControl2DxeTrigger() is only called by
the BSP, at runtime the OS can invoke runtime services from an AP (it can
even be forced with "taskset -c 1 efibootmgr"). Because on QEMU
SmmControl2DxeTrigger() only raises the SMI for the calling processor (BSP
and AP alike), the first interval above times out invariably in such cases
-- the BSP never shows up before the AP calls it in.

In order to mitigate the performance penalty, decrease
PcdCpuSmmApSyncTimeout to one tenth of its default value: 100 ms. (For
comparison, Vlv2TbltDevicePkg sets 1 ms.)

NOTE: once QEMU becomes capable of synchronous broadcast SMIs, this patch
and the previous one ("OvmfPkg: use relaxed AP SMM synchronization mode")
should be reverted, and SmmControl2DxeTrigger() should be adjusted
instead.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19059 6f19259b-4bc3-4df7-8a09-765794883524