]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
8 years agoAdd TPM2 definition in trusted computing group.
Yao, Jiewen [Thu, 13 Aug 2015 08:22:05 +0000 (08:22 +0000)]
Add TPM2 definition in trusted computing group.

1) TCG Physical Presence Interface Specification 1.30 at http://www.trustedcomputinggroup.org/resources/tcg_physical_presence_interface_specification
2) TCG EFI Protocol Specification for TPM 2.0 at http://www.trustedcomputinggroup.org/resources/tcg_efi_protocol_specification
3) Update TPM2.0 header file to include Hash Algo definition.
4) Update UEFI TCG platform header file to include more TCG event structure.

Test Win8/Win10 with secure boot enabled, PCR7 shows bound.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <Jiewen.Yao@intel.com>
Reviewed-by: "Zhang, Chao B" <chao.b.zhang@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18218 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools IA32/X64: prevent .eh_frame sections from being generated
Ard Biesheuvel [Thu, 13 Aug 2015 06:02:00 +0000 (06:02 +0000)]
BaseTools IA32/X64: prevent .eh_frame sections from being generated

After the recent GNU linker script changes, the following warning is
emitted many times during the OVMF build:

BFD: <...>: warning: Empty loadable segment detected, is this intentional ?

This is caused by the fact that, now that the section layout has changed
somewhat, the .eh_frame section is assigned an ELF segment of its own,
which ends up with no contents at all after we strip the .eh_frame
section from the output. (Note that the program headers that contain the
segment information are completely irrelevant to us since the PE/COFF
conversion does not rely on them.)

Since we only retain the .eh_frame data for external debugging, and not
for things like stack unwinding or generating backtraces at runtime, we
can remedy the situation by passing -fno-asynchronous-unwind-tables on
the GCC command line. This option instructs the compiler to emit the
unwind data into a debug section called .debug_frame instead of into
.eh_frame.

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

8 years agoMdeModulePkg: Refine the code in UiApp
Dandan Bi [Thu, 13 Aug 2015 00:58:56 +0000 (00:58 +0000)]
MdeModulePkg: Refine the code in UiApp

Refine the code in UiApp to prevent the potential risk.

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

8 years agoIntelFrameworkModulePkg:Refine the code in LegacyBootMaintUiLib
Dandan Bi [Thu, 13 Aug 2015 00:56:09 +0000 (00:56 +0000)]
IntelFrameworkModulePkg:Refine the code in LegacyBootMaintUiLib

Refine the code in LegacyBootMaintUiLib to prevent the potential risk.

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

8 years agoMdeModulePkg:Use safe string functions in UiApp.
Dandan Bi [Thu, 13 Aug 2015 00:15:06 +0000 (00:15 +0000)]
MdeModulePkg:Use safe string functions in UiApp.

Replace the unsafe string  functions with the safe one in UiApp.

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

8 years agoMdeModulePkg: Add codes to support trailer parse in HttpLib.
Zhang Lubo [Wed, 12 Aug 2015 12:44:31 +0000 (12:44 +0000)]
MdeModulePkg: Add codes to support trailer parse in HttpLib.

In HttpLib, the Event BodyParseComplete should return to the
callback function when the whole message body has been parsed
including the trailer if it has.

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

8 years agoBaseTools: remove ARMGCC and ARMLINUXGCC toolchains
Ard Biesheuvel [Wed, 12 Aug 2015 05:25:48 +0000 (05:25 +0000)]
BaseTools: remove ARMGCC and ARMLINUXGCC toolchains

The ARMGCC and ARMLINUXGCC toolchains are specific to the ARM and
AARCH64 architectures, and overlap with the toolchain configuration
that is provided by the GCC44 - GCC49 toolchains, which are defined
for all architectures.

To reduce the maintenance burden, and make it easier to keep these
different architectures aligned, remove the ARMGCC and ARMLINUXGCC
toolchains entirely.

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: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18212 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBeagleBoardPkg: remove outdated build scripts and instructions
Ard Biesheuvel [Wed, 12 Aug 2015 05:25:41 +0000 (05:25 +0000)]
BeagleBoardPkg: remove outdated build scripts and instructions

Now that we can build the Beagleboard NOR image without the custom
build scripts, let's remove them since they are outdated and out of
sync with each other.

Remove readme.txt as well: it is also outdated, and mostly covers
QEMU and how to build Linaro SD images, which may not be relevant to
most users.

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@18211 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBeagleBoardPkg: fold configuration header into FD build
Ard Biesheuvel [Wed, 12 Aug 2015 05:25:33 +0000 (05:25 +0000)]
BeagleBoardPkg: fold configuration header into FD build

Since the configuration header never changes unless the board parameters
in ConfigurationHeader.dat are updated, we can take a snapshot of the
binary and add it to the FDF definition. This way, it will get emitted
by the EDK2 build system instead of having to use a separate
post-processing tool to add it to the flash image.

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@18210 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg: remove mention of ARMGCC and ARMLINUXGCC
Ard Biesheuvel [Wed, 12 Aug 2015 05:25:26 +0000 (05:25 +0000)]
ArmPlatformPkg: remove mention of ARMGCC and ARMLINUXGCC

Remove the ARMGCC and ARMLINUXGCC from comments in the respective
Makefiles of ArmPlatformPkg and ArmJunoPkg. Also drop the wildly
outdated Versatile Express instructions, since they refer to ARMGCC
as well.

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@18209 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoEmbeddedPkg: remove mention of ARMGCC
Ard Biesheuvel [Wed, 12 Aug 2015 05:25:19 +0000 (05:25 +0000)]
EmbeddedPkg: remove mention of ARMGCC

We are going to remove the ARMGCC toolchains, so replace any references
to it with its replacement GCC48.

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@18208 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoStdLib: remove mention of ARMGCC
Ard Biesheuvel [Wed, 12 Aug 2015 05:25:12 +0000 (05:25 +0000)]
StdLib: remove mention of ARMGCC

The ARMGCC toolchain will be removed, and so will the build rule family
by the same name. So remove the BuildOptions specific to ARMGCC.

Cc: Daryl McDaniel <edk2-lists@mc2research.org>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Daryl McDaniel <edk2-lists@mc2research.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18207 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools: add ARCH detection for AARCH64 and ARM
Ard Biesheuvel [Wed, 12 Aug 2015 05:22:49 +0000 (05:22 +0000)]
BaseTools: add ARCH detection for AARCH64 and ARM

Add auto detection for the ARCH variable for AARCH64 and ARM
systems. This allows us to do a native build of the BaseTools
without the need to set ARCH externally.

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@18206 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools/GenFds: Fix 'NoneType' object is not iterable error.
Qiu Shumin [Wed, 12 Aug 2015 01:27:31 +0000 (01:27 +0000)]
BaseTools/GenFds: Fix 'NoneType' object is not iterable error.

When adding section VERSION in FDF file, for example:
FILE FREEFORM = PCD(gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile) {
    SECTION RAW = MdeModulePkg/Logo/Logo.bmp
    SECTION UI = "Logo"
    SECTION VERSION = "0001"
  }
GenFds will report the following error:
Traceback (most recent call last):
  File "GenFds.py", line 276, in main
  File "GenFds.py", line 391, in GenFd
  File "Fd.py", line 93, in GenFd
  File "Region.py", line 106, in AddToBuffer
  File "Fv.py", line 114, in AddToBuffer
  File "FfsFileStatement.py", line 117, in GenFfs
  File "VerSection.py", line 80, in GenSection
  File "GenFdsGlobalVariable.py", line 401, in GenerateSection
TypeError: 'NoneType' object is not iterable.
We found in GenFdsGlobalVariable.py line 401 'list' requires a iteralbe object as parameter while the 'Input' is None.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Yingke Liu <yingke.d.liu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18205 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg/Xen: use lower case x in hex immediate value
Ard Biesheuvel [Tue, 11 Aug 2015 12:32:53 +0000 (12:32 +0000)]
OvmfPkg/Xen: use lower case x in hex immediate value

The Clang assembler for AArch64 chokes on the value 0XEA1 since it
expects the 0x prefix to use a lower case x.

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@18204 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg: use global section alignment in custom linker script
Ard Biesheuvel [Tue, 11 Aug 2015 12:32:45 +0000 (12:32 +0000)]
ArmVirtPkg: use global section alignment in custom linker script

The ArmVirtPrePiUniCoreRelocatable module comes with its own GNU
linker script to create a PIE executable that can relocate itself
at runtime. In order to be able to build this module using CLANG,
we need to adhere to the section alignment passed via to the linker
using -z commmon-page-size, so add this to the linker script.

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

8 years agoArmVirtPkg: avoid relocated immediates in AARCH64 asm
Ard Biesheuvel [Tue, 11 Aug 2015 12:32:38 +0000 (12:32 +0000)]
ArmVirtPkg: avoid relocated immediates in AARCH64 asm

The relocated immediate notation supported by GNU as (e.g., #:lo12:foo)
is not supported by clang. Since we are loading a constant value, they
were not entirely appropriate here anyway, so simply replace them with
assembler arithmetic expressions.

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

8 years agoMdeModulePkg: Fix issue about current Ip4Dxe implementation for DHCP DORA process
Jiaxin Wu [Tue, 11 Aug 2015 11:07:17 +0000 (11:07 +0000)]
MdeModulePkg: Fix issue about current Ip4Dxe implementation for DHCP DORA process

DHCP policy is applied as default at boot time on all NICs in the system, which results
in all NIC ports attempting DHCP and trying to acquire IP addresses during boot.
Ip4 driver should only set dhcp as default policy, and not trigger DORA at driver binding
start(). We should start DORA until one IP child is configured to use default address.

Cc: Fu Siyuan <siyuan.fu@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: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18201 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: Change the macro name to fit coding style
fanwang2 [Tue, 11 Aug 2015 01:11:54 +0000 (01:11 +0000)]
MdeModulePkg: Change the macro name to fit coding style

Change a macro name to fit EDK2 naming conventions: Use all capital letters for #define.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: fanwang2 <fan.wang@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18200 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg: Change the macro name to fit coding style
fanwang2 [Tue, 11 Aug 2015 01:11:29 +0000 (01:11 +0000)]
NetworkPkg: Change the macro name to fit coding style

Change several macro names to fit name EDK2 naming conventions: Use all capital letters for #define.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: fanwang2 <fan.wang@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18199 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools: add CLANG35 toolchain with AARCH64 support
Ard Biesheuvel [Mon, 10 Aug 2015 07:55:26 +0000 (07:55 +0000)]
BaseTools: add CLANG35 toolchain with AARCH64 support

This adds support for building the AARCH64 platforms using the
Clang compiler and assembler combined with the GNU (cross-)linker.

The chosen name CLANG35 is based on version 3.5 being the oldest
supported version, but no issues are known that should prevent its
use with any later version.

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

8 years agoBaseTools/GenFw: allow AArch64 tiny and small code model relocations
Ard Biesheuvel [Mon, 10 Aug 2015 07:55:18 +0000 (07:55 +0000)]
BaseTools/GenFw: allow AArch64 tiny and small code model relocations

The AArch64 small C model makes extensive use of ADRP/ADD and
ADRP/{LDR,STR} pairs to emit PC-relative symbol references with
a +/- 4 GB range. Since the relocation pair splits the relative
offset into a relative page offset and an absolute offset into
a 4 KB page, we need to take extra care to ensure that the target
of the relocation preserves its alignment relative to a 4 KB
alignment boundary.

Also, due to a problem with the --emit-relocs GNU ld option, where
it does not recalculate the addends for section relative relocations,
the only way to guarantee correct code is by requiring the relative
section offset to be equal in the ELF and PE/COFF versions of the
binary. This affects both the 'tiny' and 'small' GCC code models.

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

8 years agoArmPlatformPkg/FVP: use 'auto' alignment and FIXED placement for XIP modules
Ard Biesheuvel [Mon, 10 Aug 2015 07:55:10 +0000 (07:55 +0000)]
ArmPlatformPkg/FVP: use 'auto' alignment and FIXED placement for XIP modules

Now that GenFw correctly propagates the minimum alignment of the ELF
input sections to the PE/COFF binary, we can simply select 'auto'
alignment in the FDF Rule section instead of tweaking it by hand.

Also add the FIXED FFS attribute to the module types that may execute
in place. This enables a newly added optimization in GenFfs that strips
redundant padding, preventing excessive waste of FV space if the section
alignment is considerable (i.e., 2 KB or 4 KB)

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

8 years agoArmPlatformPkg/ArmJunoPkg: use TE 'auto' alignment for SEC modules
Ard Biesheuvel [Mon, 10 Aug 2015 07:55:03 +0000 (07:55 +0000)]
ArmPlatformPkg/ArmJunoPkg: use TE 'auto' alignment for SEC modules

No need to hardcode the TE alignment anymore, now that GenFw sets
the PE/COFF alignment according to the alignment requirements of
the ELF input sections.

Also enable FIXED FFS placement so that we can reclaim some of the
space wasted to padding when using clang with 4 KB section alignment.

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

8 years agoArmPlatformPkg/ArmJunoPkg: use a rodata symbol for ReferenceAcpiTable
Ard Biesheuvel [Mon, 10 Aug 2015 07:54:55 +0000 (07:54 +0000)]
ArmPlatformPkg/ArmJunoPkg: use a rodata symbol for ReferenceAcpiTable

The ACPI .aslc files contain a ReferenceAcpiTable() function whose
sole purpose is to ensure that the table itself does not get optimized
away. However, when using clang, these dummy functions result in a 4 KB
section alignment requirement, which is silly since everything except
the .data section is discarded later anyway.

So instead, make ReferenceAcpiTable a CONST pointer to VOID*. This way,
we still have a .text section, which is mandatory for the PE/COFF
conversion, but no executable code with small model relocations that
impose additional alignment requirements.

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

8 years agoArmPkg/GenericWatchdogDxe: add missing VOID* cast
Ard Biesheuvel [Mon, 10 Aug 2015 07:54:47 +0000 (07:54 +0000)]
ArmPkg/GenericWatchdogDxe: add missing VOID* cast

Use an explicit VOID* cast when passing a static char array into
a function taking a void pointer.

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

8 years agoArmPkg/GicV3: use GICv3 generic sysreg names only for GNU as
Ard Biesheuvel [Mon, 10 Aug 2015 07:54:39 +0000 (07:54 +0000)]
ArmPkg/GicV3: use GICv3 generic sysreg names only for GNU as

The GNU assembler extends the generic notation for IMPLEMENTATION
DEFINED system registers to support any system register, so that
system registers defined by newer versions of the architecture can
still be used by older versions of the toolchain.

Clang before v3.6 supports the generic notation, but does not
support this extension, nor does it need to in the particular case
of the GICv3 support code, since it knows the GICv3 registers by
their architectural names. So only redefine their real names to
their generic aliases if we are not using clang.

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

8 years agoUefiCpuPkg CpuDxe: Sync up the settings of Execute Disable to APs
Star Zeng [Sat, 8 Aug 2015 00:00:36 +0000 (00:00 +0000)]
UefiCpuPkg CpuDxe: Sync up the settings of Execute Disable to APs

when stack NX has been enabled for BSP.

DxeIpl may have enabled Execute Disable for BSP,
APs need to get the status and sync up the settings,
otherwise EFI_MP_SERVICES_PROTOCOL->StartupAllAPs
may not work.

Got positive comments and test result from Laszlo
for the early draft patch, thanks.

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

8 years agoMdeModulePkg DxeIpl: Fix IA32 build failure with GCC 5.1.1
Star Zeng [Fri, 7 Aug 2015 23:53:53 +0000 (23:53 +0000)]
MdeModulePkg DxeIpl: Fix IA32 build failure with GCC 5.1.1

Got the build failure feedback below, this patch is to fix that.

This broke the IA32 Ovmf build for me, with GCC 5.1.1 (Fedora 22):

/home/dwmw2/git/edk2/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c:377:7:
error: â€˜PageTables’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
       AsmWriteCr3 (PageTables);
       ^
/home/dwmw2/git/edk2/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c:224:9:
note: â€˜PageTables’ was declared here
   UINTN                     PageTables;
         ^
cc1: all warnings being treated as errors

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

8 years agoArmPlatformPkg/PlatformPeim: constify EFI_PEI_PPI_DESCRIPTOR globals
Ard Biesheuvel [Fri, 7 Aug 2015 17:27:33 +0000 (17:27 +0000)]
ArmPlatformPkg/PlatformPeim: constify EFI_PEI_PPI_DESCRIPTOR globals

Make global EFI_PEI_PPI_DESCRIPTOR instances CONST to prevent them
from being emitted into the .data section.

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@18189 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg/PrePeiCore: constify PPI globals
Ard Biesheuvel [Fri, 7 Aug 2015 17:27:24 +0000 (17:27 +0000)]
ArmPlatformPkg/PrePeiCore: constify PPI globals

Since PrePeiCore's .text section contains an AARCH64 exception
vector table, its 2 KB alignment propagates to other sections as
well. Since this is a SEC module, it should not have any writable
data in the first place, so change some non-const PPI globals to
const. The resulting binary has no .data section at all, which
saves 2 KB in the XIP image.

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@18188 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellBinPkg: Ia32/X64 Shell binary update.
Qiu Shumin [Fri, 7 Aug 2015 06:25:28 +0000 (06:25 +0000)]
ShellBinPkg: Ia32/X64 Shell binary update.

The binaries of ShellBinPkg are generated with ShellPkg project 18186. The binaries are built with no debug information by building with "RELEASE" target.

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

8 years agoShellPkg: Add function comments and refine code format to follow EDKII coding style.
Qiu Shumin [Fri, 7 Aug 2015 05:42:02 +0000 (05:42 +0000)]
ShellPkg: Add function comments and refine code format to follow EDKII coding style.

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

8 years agoMdeModulePkg: Use monotonic count to initialize the NetLib random seed.
Fu Siyuan [Fri, 7 Aug 2015 03:22:10 +0000 (03:22 +0000)]
MdeModulePkg: Use monotonic count to initialize the NetLib random seed.

NetRandomInitSeed() function use current time to initialize the random seed,
while in some platform the time service is not accuracy that make the random
seed collision. This patch add the monotonic count to the seed to avoid this.

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

8 years agoShellPkg: Refine global variable name to follow EDK II coding style.
Kinney, Michael D [Fri, 7 Aug 2015 01:33:32 +0000 (01:33 +0000)]
ShellPkg: Refine global variable name to follow EDK II coding style.

EDK II C coding style requires use of 'm' or 'g' for module globals.

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

8 years agoShellPkg: Fix build failure in VS2015.
Kinney, Michael D [Fri, 7 Aug 2015 01:32:17 +0000 (01:32 +0000)]
ShellPkg: Fix build failure in VS2015.

Initialize local variable before it is passed into a function by reference.

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

8 years agoOvmfPkg: SmbiosVersionLib: recognize SMBIOS 3.x entry point
Laszlo Ersek [Thu, 6 Aug 2015 10:14:12 +0000 (10:14 +0000)]
OvmfPkg: SmbiosVersionLib: recognize SMBIOS 3.x entry point

Also set the DocRev field the way QEMU exposes it, because
MdeModulePkg/Universal/SmbiosDxe lets us control that field too.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Wei Huang <wei@redhat.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gabriel L. Somlo <somlo@cmu.edu>
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@18182 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg: set default for PcdSmbiosDocRev
Laszlo Ersek [Thu, 6 Aug 2015 10:14:07 +0000 (10:14 +0000)]
ArmVirtPkg: set default for PcdSmbiosDocRev

When MdeModulePkg/Universal/SmbiosDxe is instructed to compose & install
an SMBIOS 3.0 entry point, it keys the Docrev (specification document
revision) field of that structure off of PcdSmbiosDocRev. An upcoming
OvmfPkg patch will have OvmfPkg/Library/SmbiosVersionLib set this PCD
dynamically. Because we use that driver in the ArmVirtQemu.dsc platform,
we must provide a default for the dynamic PCD.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Wei Huang <wei@redhat.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>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18181 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: SmbiosPlatformDxe: eliminate duplicate entry point validation
Laszlo Ersek [Thu, 6 Aug 2015 10:14:03 +0000 (10:14 +0000)]
OvmfPkg: SmbiosPlatformDxe: eliminate duplicate entry point validation

At this point all platforms that use OvmfPkg/SmbiosPlatformDxe in edk2,
namely ArmVirtQemu.dsc and OvmfPkg*.dsc, have been migrated to
SmbiosVersionLib. Therefore SmbiosPlatformDxe itself can forego verifying
QEMU's SMBIOS entry point; if SmbiosVersionLib's validation was
successful, it should just rely on that.

(Note that SmbiosPlatformDxe has a depex on EFI_SMBIOS_PROTOCOL, installed
by SmbiosDxe, containing SmbiosVersionLib, therefore the set/get order of
PcdQemuSmbiosValidated is ensured.)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Wei Huang <wei@redhat.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gabriel L. Somlo <somlo@cmu.edu>
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@18180 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg/ArmVirtQemu.dsc: set default for PcdQemuSmbiosValidated
Laszlo Ersek [Thu, 6 Aug 2015 10:13:59 +0000 (10:13 +0000)]
ArmVirtPkg/ArmVirtQemu.dsc: set default for PcdQemuSmbiosValidated

The upcoming OvmfPkg patches will implicitly affect the ArmVirtQemu.dsc
build, necessitating a default value for the new dynamic
PcdQemuSmbiosValidated. Add it.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Wei Huang <wei@redhat.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>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18179 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: introduce PcdQemuSmbiosValidated
Laszlo Ersek [Thu, 6 Aug 2015 10:13:55 +0000 (10:13 +0000)]
OvmfPkg: introduce PcdQemuSmbiosValidated

This dynamic PCD will enable a small code de-duplication between
OvmfPkg/SmbiosPlatformDxe and OvmfPkg/Library/SmbiosVersionLib. Since both
of those are also used in ArmVirtQemu.dsc, and we should avoid
cross-package commits when possible, this patch declares
PcdQemuSmbiosValidated first, and sets defaults for it in the OvmfPkg DSC
files.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Wei Huang <wei@redhat.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gabriel L. Somlo <somlo@cmu.edu>
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@18178 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg: revert "ArmVirtPkg: add QemuFwCfgToPcdDxe"
Laszlo Ersek [Thu, 6 Aug 2015 10:13:50 +0000 (10:13 +0000)]
ArmVirtPkg: revert "ArmVirtPkg: add QemuFwCfgToPcdDxe"

This reverts git commit d2733aa9 (SVN r18042), because it is empty now.
The original problem:

  Many universal DXE drivers in edk2 can be controlled by setting dynamic
  PCDs. Such a PCD must be set before the consumer DXE driver is
  dispatched.

should be hereafter solved similarly to how
OvmfPkg/Library/SmbiosVersionLib is plugged into
MdeModulePkg/Universal/SmbiosDxe now (originally suggested by Jordan
Justen <jordan.l.justen@intel.com>).

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Wei Huang <wei@redhat.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>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18177 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg: set SMBIOS version in DetectSmbiosVersionLib instead of QemuFwCfgToPcdDxe
Laszlo Ersek [Thu, 6 Aug 2015 10:13:46 +0000 (10:13 +0000)]
ArmVirtPkg: set SMBIOS version in DetectSmbiosVersionLib instead of QemuFwCfgToPcdDxe

This patch de-duplicates the logic added in commit

  ArmVirtPkg: QemuFwCfgToPcdDxe: set SMBIOS entry point version
  dynamically

(git c98da334, SVN r18043) by hooking DetectSmbiosVersionLib into
SmbiosDxe.

Although said commit was supposed to work with SMBIOS 3.0 payloads from
QEMU, in practice that never worked, because the size / signature checks
in SmbiosVersionInitialization() would always fail, due to the SMBIOS 3.0
entry point being structurally different. Therefore this patch doesn't
regress ArmVirtPkg.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Wei Huang <wei@redhat.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: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18176 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: set SMBIOS version in DetectSmbiosVersionLib instead of PlatformPei
Laszlo Ersek [Thu, 6 Aug 2015 10:13:42 +0000 (10:13 +0000)]
OvmfPkg: set SMBIOS version in DetectSmbiosVersionLib instead of PlatformPei

This patch de-duplicates the logic added in commit

  OvmfPkg: PlatformPei: set SMBIOS entry point version dynamically

(git 37baf06b, SVN r17676) by hooking DetectSmbiosVersionLib into
SmbiosDxe.

Although said commit was supposed to work with SMBIOS 3.0 payloads from
QEMU, in practice that never worked, because the size / signature checks
in SmbiosVersionInitialization() would always fail, due to the SMBIOS 3.0
entry point being structurally different. Therefore this patch doesn't
regress OvmfPkg.

Cc: Wei Huang <wei@redhat.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gabriel L. Somlo <somlo@cmu.edu>
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@18175 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: SmbiosVersionLib: add "plugin" for detecting SMBIOS version
Laszlo Ersek [Thu, 6 Aug 2015 10:13:37 +0000 (10:13 +0000)]
OvmfPkg: SmbiosVersionLib: add "plugin" for detecting SMBIOS version

Introduce a minimal library instance for fetching and validating the
SMBIOS entry point structure exposed by QEMU over fw_cfg. This library is
meant to be hooked into MdeModulePkg/Universal/SmbiosDxe by platform DSC
files, so that the library can set the PCD(s) that SmbiosDxe consumes at
the right moment.

At the moment only SMBIOS 2.x entry points are recognized.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Wei Huang <wei@redhat.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gabriel L. Somlo <somlo@cmu.edu>
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@18174 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: PlatformDebugLibIoPort: fix AsciiSPrint() format string
Laszlo Ersek [Thu, 6 Aug 2015 10:13:33 +0000 (10:13 +0000)]
OvmfPkg: PlatformDebugLibIoPort: fix AsciiSPrint() format string

The LineNumber parameter of the DebugAssert() function has type UINTN.
DebugAssert() passes it to AsciiSPrint() with the %d conversion specifier
at the moment, but %d would require an INT32 argument.

Fix this by casting LineNumber to UINT64, also employing the matching
decimal conversion specifier, %Lu.

(Another possibility would be to cast LineNumber to INT32, but a
UINTN->INT32 cast is not value preserving, generally speaking.)

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

8 years agoNt32Pkg: Platform BDS should test the untested memory
Ruiyu Ni [Thu, 6 Aug 2015 08:39:30 +0000 (08:39 +0000)]
Nt32Pkg: Platform BDS should test the untested memory

NT32 has two ranges of memory, each 64MB. The first range is tested
but the second range is not tested. Platform BDS should have code
to use MemoryTest protocol to test the memory so that the second
range of untested memory can be added to the system memory pool.

Without the code SCT MemoryAllocation test case may fail. Because it
firstly use GetMemoryMap to find the biggest free memory descriptor
and then requests to allocate one page more than that biggest free memory.
It expects the allocation fails but actually the DXE core automatically
converts the second range of untested memory to tested and allocate the memory
from the second range.

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

8 years agoSecurityPkg: Update coding style
Chao Zhang [Thu, 6 Aug 2015 08:17:54 +0000 (08:17 +0000)]
SecurityPkg: Update coding style

Update to EDK2 coding style

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

8 years agoBaseTools/Trim: Fixed a bug that cannot trim long values
Yingke Liu [Thu, 6 Aug 2015 08:05:59 +0000 (08:05 +0000)]
BaseTools/Trim: Fixed a bug that cannot trim long values

The long value substitution must move to the front of
HEX substitution, and updated build_rule to add --trim-long

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

8 years agoMdeModulePkg/Usb: Adjust TPL to not block async transfer during usb enum.
Feng Tian [Thu, 6 Aug 2015 07:13:16 +0000 (07:13 +0000)]
MdeModulePkg/Usb: Adjust TPL to not block async transfer during usb enum.

EDKII usb stack is using a TPL_CALLBACK timer to monitor async transfer
request and signal event if it's done. As usb enumeration and usb mass
storage block i/o read/write runs on TPL_CALLBACK and TPL_NOTIFY level
respectively, It blocks usb async transfer requests, usually usb mouse
/use kb, getting time to run.

Without this change, user couldn't get usb mouse/kb state in time (will
show a little lag from UI view) when there is other usb transactions, such
as a new usb device inserted.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18169 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/CpuMpPei: Update files format to DOS
Jeff Fan [Thu, 6 Aug 2015 06:57:47 +0000 (06:57 +0000)]
UefiCpuPkg/CpuMpPei: Update files format to DOS

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

8 years agoShellPkg: Fix issue about ping fail with IPv4
Jiaxin Wu [Thu, 6 Aug 2015 05:45:32 +0000 (05:45 +0000)]
ShellPkg: Fix issue about ping fail with IPv4

Fix issue about ping fail with IPv4, which is caused by the incorrect
checksum in request message.

Cc: Fu Siyuan <siyuan.fu@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: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18167 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg DxeIpl: Add stack NX support
Star Zeng [Wed, 5 Aug 2015 12:45:21 +0000 (12:45 +0000)]
MdeModulePkg DxeIpl: Add stack NX support

This feature is added for UEFI spec that says
"Stack may be marked as non-executable in identity mapped page tables".
A PCD PcdSetNxForStack is added to turn on/off this feature, and it is
FALSE by default.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: "Yao, Jiewen" <Jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18166 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoVlv2TbltDevicePkg: Sync the branch changes to trunk.
Tim He [Wed, 5 Aug 2015 07:26:45 +0000 (07:26 +0000)]
Vlv2TbltDevicePkg: Sync the branch changes to trunk.

Set USB Ports as User Visible in the _PLD.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tim He <tim.he@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18165 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUiApp: Update copyright info, cover old code existed in old BdsDxe driver.
Eric Dong [Wed, 5 Aug 2015 07:10:01 +0000 (07:10 +0000)]
UiApp: Update copyright info, cover old code existed in old BdsDxe driver.

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

8 years agoLegacyBootMaintUi: Update copyright info, cover old code existed in old BdsDxe driver.
Eric Dong [Wed, 5 Aug 2015 07:08:02 +0000 (07:08 +0000)]
LegacyBootMaintUi: Update copyright info, cover old code existed in old BdsDxe driver.

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

8 years agoNetworkPkg: Fix assert caused by wrong parameter in AsciiStrCpyS()
Zhang Lubo [Wed, 5 Aug 2015 03:25:20 +0000 (03:25 +0000)]
NetworkPkg: Fix assert caused by wrong parameter in AsciiStrCpyS()

The 2nd parameter in AsciiStrCpyS() should be the max available
memory of the destination.

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

8 years agoMdePkg UefiLib: Fix wrong DestMax passed to StrCpyS()
Hao Wu [Wed, 5 Aug 2015 02:55:40 +0000 (02:55 +0000)]
MdePkg UefiLib: Fix wrong DestMax passed to StrCpyS()

The second parameter 'DestMax' of StrCpyS() should be the number of
unicode characters, not the size in bytes.

Also, code is modified to keep align with the one in
IntelFrameworkPkg\Library\FrameworkUefiLib\UefiLibPrint.c.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18160 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoIntelFrameworkPkg FrameworkUefiLib: Fix wrong DestMax passed to StrCpyS()
Hao Wu [Wed, 5 Aug 2015 02:55:05 +0000 (02:55 +0000)]
IntelFrameworkPkg FrameworkUefiLib: Fix wrong DestMax passed to StrCpyS()

The second parameter 'DestMax' of StrCpyS() should be the number of
unicode characters, not the size in bytes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18159 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/CpuMpPei: Add meta data description
Jeff Fan [Wed, 5 Aug 2015 02:28:49 +0000 (02:28 +0000)]
UefiCpuPkg/CpuMpPei: Add meta data description

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@18158 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Fix 'drivers' assert issue for a driver name longer than 35 characters.
Tapan Shah [Wed, 5 Aug 2015 00:53:10 +0000 (00:53 +0000)]
ShellPkg: Fix 'drivers' assert issue for a driver name longer than 35 characters.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tapan Shah <tapandshah@hp.com>
Reviewed-by: Chris Phillips <chrisp@hp.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18157 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg/ArmVirtXen: add missing BdsLib instance
Ard Biesheuvel [Tue, 4 Aug 2015 19:44:25 +0000 (19:44 +0000)]
ArmVirtPkg/ArmVirtXen: add missing BdsLib instance

Now that the ARM BDS has been removed, there is a remaining BdsLib
dependency in ArmVirtXen that has now become unresolved. So re-add
the BdsLib resolution that we removed from ArmVirt.dsc.inc to
ArmVirtXen.dsc

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

8 years agoArmVirtPkg/ArmVirtQemu: add LinuxLoader UEFI app to ARM build
Ard Biesheuvel [Tue, 4 Aug 2015 18:41:45 +0000 (18:41 +0000)]
ArmVirtPkg/ArmVirtQemu: add LinuxLoader UEFI app to ARM build

The ARM build still needs an intermediate loader to boot Linux,
since ARM/Linux has no builtin UEFI boot stub (yet).

So add the LinuxLoader UEFI application to the FV, and enable
the FvSimpleFileSystemDxe driver so that we can invoke the
Linux loader from the shell, e.g.,

  Shell> linuxloader fs2:zImage -c console=ttyAMA0

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@18155 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg/ArmVirtXen: remove unused PcdFirmwareVendor PCD
Ard Biesheuvel [Tue, 4 Aug 2015 18:41:33 +0000 (18:41 +0000)]
ArmVirtPkg/ArmVirtXen: remove unused PcdFirmwareVendor PCD

The PcdFirmwareVendor PCD was never used on this platform, since
it has never supported the ARM BDS. So remove it.

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@18154 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg/ArmVirtQemu: drop ARM BDS and make Intel BDS the default
Ard Biesheuvel [Tue, 4 Aug 2015 18:41:19 +0000 (18:41 +0000)]
ArmVirtPkg/ArmVirtQemu: drop ARM BDS and make Intel BDS the default

ARM BDS support in ArmVirtQemu has been broken since SVN r17969
("ArmPkg/BdsLib: Remove Linux loader from BdsLib") dated July 14th.

Instead of fixing this, let's get rid of the ARM BDS and LinuxLoader
altogether: they violate both the UEFI spec and the arm64 Linux boot
protocol, and lack the level of integration with the QEMU command
line that the Intel BDS has when running under ArmVirtPkg or OvmfPkg.

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@18153 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoIntelFrameworkModulePkg:Refine the code comments in LegacyBootMaintUiLib
Dandan Bi [Tue, 4 Aug 2015 09:13:47 +0000 (09:13 +0000)]
IntelFrameworkModulePkg:Refine the code comments in LegacyBootMaintUiLib

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

8 years agoMdeModulePkg:Refine the code comments in UiApp
Dandan Bi [Tue, 4 Aug 2015 09:11:42 +0000 (09:11 +0000)]
MdeModulePkg:Refine the code comments in UiApp

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

8 years agoMdeModulePkg:Fix the issue that refresh the question fail in DriverSample
Dandan Bi [Tue, 4 Aug 2015 09:09:10 +0000 (09:09 +0000)]
MdeModulePkg:Fix the issue that refresh the question fail in DriverSample

Once the question is refreshed,the processing should happen in the callback function
of EFI_BROWSER_ACTION_RETRIEVE case,rather than EFI_BROWSER_ACTION_CHANGING in DriverSample.

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

8 years agoVlv2TbltDevicePkg: Sync the branch changes to trunk.
Tim He [Tue, 4 Aug 2015 02:55:02 +0000 (02:55 +0000)]
Vlv2TbltDevicePkg: Sync the branch changes to trunk.

Support compatible board, and fixed some bugs.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tim He <tim.he@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18149 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg DxeCore: Move ProcessLibraryConstructorList()
Star Zeng [Tue, 4 Aug 2015 01:41:48 +0000 (01:41 +0000)]
MdeModulePkg DxeCore: Move ProcessLibraryConstructorList()

to right after CoreInitializeGcdServices().

Why?
Some platforms maybe report both below 4G and above 4G memory resource hob as tested,
then CoreInitializeMemoryServices() will find and add the tested above 4G memory resource hob to memory descriptor for early memory allocation services,
then if ProcessLibraryConstructorList() that has library constructor tries to allocate below 4G memory and will fail.
In fact, the following CoreInitializeGcdServices() will add all the memory resource hob to GCD map,
and add the tested below 4G memory resource hob to memory descriptor,
but it has been too late for ProcessLibraryConstructorList().

Also move below two lines as they are needed to be after
the constructor of DxeCorePerfomanceLib.
  PERF_END   (NULL,"PEI", NULL, 0) ;
  PERF_START (NULL,"DXE", NULL, 0) ;

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

8 years agoMdePkg/UefiDevicePathLib: Fix RAM Disk Device Path To Text Issue
Tapan Shah [Tue, 4 Aug 2015 01:09:49 +0000 (01:09 +0000)]
MdePkg/UefiDevicePathLib: Fix RAM Disk Device Path To Text Issue

Perform Left Shift 32 bits of a 32-bit StartAddr[1] and EndingAddr[1]
instead of Right Shift when displaying 64-bit Start and End Address Value.

StartAddr[1] and EndingAddr[1] are already a 32-bit value and it should
perform left shift 32-bit to generate a complete 64-bit value along with
StartAddr[0] and EndingAddr[0] respectively.

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

8 years agoMdeModulePkg:Fix the issue FindQuestionFromProgress in SetupBrowserDxe is broken
Dandan Bi [Mon, 3 Aug 2015 09:44:04 +0000 (09:44 +0000)]
MdeModulePkg:Fix the issue FindQuestionFromProgress in SetupBrowserDxe is broken

If the storage of the question is EFI_HII_VARSTORE_BUFFER/EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER,
in SetupBrowserDxe the configuration stings contain uppercase,but HiiDataBaseDxe generates the
ConfigResp string in lowercase,they mismatch,so FindQuestionFromProgress function is broken.
Now convert the configuration string in SetupBrowserDxe to lowercase to fix this issue.

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

8 years agoBaseTools IA32/X64: Use GccBase.lds instead of gcc*-ld-script
Ard Biesheuvel [Mon, 3 Aug 2015 08:23:59 +0000 (08:23 +0000)]
BaseTools IA32/X64: Use GccBase.lds instead of gcc*-ld-script

These scripts all now have the same contents, so we only need to use
GccBase.lds. Therefore we can delete gcc-4K-align-ld-script,
gcc4.4-ld-script and gcc4.9-ld-script.

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

8 years agoBaseTools AARCH64: remove incremental linker script for 64K alignment
Ard Biesheuvel [Mon, 3 Aug 2015 08:23:36 +0000 (08:23 +0000)]
BaseTools AARCH64: remove incremental linker script for 64K alignment

Now that we moved all users to the unified GCC linker script, remove
the old 64 KB incremental linker script for AARCH64 since it is now
unused.

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

8 years agoArmVirtPkg: move to unified GCC linker script
Ard Biesheuvel [Mon, 3 Aug 2015 08:23:26 +0000 (08:23 +0000)]
ArmVirtPkg: move to unified GCC linker script

Move to the parametrised generic GCC linker script and set 64 KB
alignment, instead of using the AARCH64 specific incremental linker
script for 64 KB alignment which is about to be removed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-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@18140 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg/ArmVExpressPkg: move to unified GCC linker script
Ard Biesheuvel [Mon, 3 Aug 2015 08:23:16 +0000 (08:23 +0000)]
ArmPlatformPkg/ArmVExpressPkg: move to unified GCC linker script

Move to the parametrised generic GCC linker script and set 64 KB
alignment, instead of using the AARCH64 specific incremental linker
script for 64 KB alignment which is about to be removed.

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

8 years agoBaseTools AARCH64: move to unified GCC linker script
Ard Biesheuvel [Mon, 3 Aug 2015 08:23:05 +0000 (08:23 +0000)]
BaseTools AARCH64: move to unified GCC linker script

Drop the GCC AARCH64 specific linker script and use the new
unified one instead.

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

8 years agoBaseTools GCC: move AutoGen.obj contents to .text section
Ard Biesheuvel [Mon, 3 Aug 2015 08:22:50 +0000 (08:22 +0000)]
BaseTools GCC: move AutoGen.obj contents to .text section

All AutoGen.obj files consist of global GUID definitions, fixed
and patchable PCDs and other data that is essentially read-only at
runtime but has not been declared as such for various reasons.

By moving these contents to .text we achieve two things:
- global GUIDs and other data items which must be constant for correct
  program operation can no longer be modified, for instance, when
  running a DXE_RUNTIME_MODULE binary under the OS with the Properties
  Table feature for memory protection enabled;
- the .data section becomes smaller, and may be dropped completely for
  many XIP modules, which reduces wasted FV space if the PE/COFF section
  alignment is large.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Liming Gao <liming.gao@intel.com>
Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18137 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools GCC: align start of .data to .text alignment
Ard Biesheuvel [Mon, 3 Aug 2015 08:22:39 +0000 (08:22 +0000)]
BaseTools GCC: align start of .data to .text alignment

Now that GenFw honors the ELF section alignment when placing the
PE/COFF sections in the output, the start of the PE/COFF version of
.data will be aligned to the alignment of .text if its alignment is
higher than the default. So duplicate this behavior in the ELF output,
this will make the memory layout of the PE/COFF binary match the
layout of the ELF version more closely.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Liming Gao <liming.gao@intel.com>
Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18136 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools GCC: add unified GCC linker script for all archs and versions
Ard Biesheuvel [Mon, 3 Aug 2015 08:22:28 +0000 (08:22 +0000)]
BaseTools GCC: add unified GCC linker script for all archs and versions

This unifies all GCC linker scripts into a single parametrised GCC
linker script that can be used for all GCC versions and architectures.

The two parameters that can be set on the linker command line are:
- PECOFF_HEADER_SIZE, this is a build time property of GenFw, but
  its value is different between 32-bit and 64-bit;
- common-page-size, this can be set using -z on the ld command line,
  and controls the value of the COMMONPAGESIZE constant when used in
  a linker script. This value is used for the minimum section alignment.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Liming Gao <liming.gao@intel.com>
Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18135 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools IA32/X64: get header size and alignment from ld commandline
Ard Biesheuvel [Mon, 3 Aug 2015 08:22:16 +0000 (08:22 +0000)]
BaseTools IA32/X64: get header size and alignment from ld commandline

Instead of hardcoding the values for the PE/COFF header size and the
section alignment, set them on the linker command line. This factors
out these values from the various linker scripts, which will allow us
to unify them in a subsequent patch.

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

8 years agoBaseTools IA32/X64: move .got contents to the PE/COFF .text section
Ard Biesheuvel [Mon, 3 Aug 2015 08:22:00 +0000 (08:22 +0000)]
BaseTools IA32/X64: move .got contents to the PE/COFF .text section

Move the .got contents to the PE/COFF .text section. This should be
a no-op, since we typically don't generate position independent code
(i.e., using -fPIC). But since the GOT contains variable addresses that
are updated at relocation time only, its contents are best kept in .text
to prevent them from being overwritten inadvertently.

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

8 years agoBaseTools IA32/X64: drop redundant alignment from linker script
Ard Biesheuvel [Mon, 3 Aug 2015 08:21:49 +0000 (08:21 +0000)]
BaseTools IA32/X64: drop redundant alignment from linker script

There is no need to pad out the end of a section of the start of
the following section is aligned to the same value. So drop the
redundant ALIGN() statements.

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

8 years agoBaseTools IA32/X64: move .rodata to PE/COFF .text section
Ard Biesheuvel [Mon, 3 Aug 2015 08:21:39 +0000 (08:21 +0000)]
BaseTools IA32/X64: move .rodata to PE/COFF .text section

The .rodata ELF section contains constant non-executable data that
should never be modified by the program itself. Since the risk of
inadvertent modification is typically higher than the risk of
inadvertent execution, it makes sense to put this data in the
R-X .text section rather than in the RW- .data section.
So move it there.

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

8 years agoBaseTools IA32/X64: remove NOP padding from X86/IA32 GCC linker scripts
Ard Biesheuvel [Mon, 3 Aug 2015 08:21:28 +0000 (08:21 +0000)]
BaseTools IA32/X64: remove NOP padding from X86/IA32 GCC linker scripts

The NOP padding in the GCC linker scripts ensures that all empty
regions in the ELF binary are filled with x86 NOP instructions.

There is no upside to doing this: if the CPU ends up executing these
instructions, we have little hope of resuming normal execution of the
program anyway. And having NOP slides in memory only makes it easier
for attackers to launch exploits. So remove them.

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

8 years agoSecurityPkg/Tcg/MemoryOverwriteRequestControlLock: Add missing header file descriptio...
Qiu Shumin [Mon, 3 Aug 2015 07:14:11 +0000 (07:14 +0000)]
SecurityPkg/Tcg/MemoryOverwriteRequestControlLock: Add missing header file description in INF file.

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

8 years agoNt32Pkg: Remove old useless bds platform lib.
Eric Dong [Mon, 3 Aug 2015 05:31:41 +0000 (05:31 +0000)]
Nt32Pkg: Remove old useless bds platform lib.

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

8 years agoNt32Pkg: Do connect all and Refresh boot option action after console is connected.
Eric Dong [Mon, 3 Aug 2015 05:30:25 +0000 (05:30 +0000)]
Nt32Pkg: Do connect all and Refresh boot option action after console is connected.

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

8 years agoFixed GCC49 build fail issue.
Eric Dong [Mon, 3 Aug 2015 03:22:49 +0000 (03:22 +0000)]
Fixed GCC49 build fail issue.

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@18126 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg PeiCore: Add PCD to specify PEIM Shadow
Liming Gao [Mon, 3 Aug 2015 03:18:37 +0000 (03:18 +0000)]
MdeModulePkg PeiCore: Add PCD to specify PEIM Shadow

v2 changelog:
Check CurrentPeimHandle to check the matched PeimHandle.
Add check point to ShadowPeiCore based on PCD.

v1 changelog:
PeiCore LoadImage always shadow itself and PEIM on normal boot after
the physical memory is installed. On the emulator platform, the shadow
may be not necessary. To support such usage, new PCD PcdShadowPeimOnBoot
is introduced to specify whether loads PEIM in memory by default.

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

8 years agoIntelFspPkg: Remove the const condition if statement to refine the code.
Qiu Shumin [Mon, 3 Aug 2015 02:59:55 +0000 (02:59 +0000)]
IntelFspPkg: Remove the const condition if statement to refine the code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: "Yao, Jiewen" <Jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18124 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoAdd Dual-FSP support (MemoryInitUpd/SiliconInitUpd)
Yao, Jiewen [Sun, 2 Aug 2015 04:02:37 +0000 (04:02 +0000)]
Add Dual-FSP support (MemoryInitUpd/SiliconInitUpd)

Add FspUpdSignatureCheck() API in FspSecPlatformLib, so that FspSecCore can check if UPD data is valid in FSP API.
Add Set/GetFspMemoryInitUpdDataPointer() and Set/GetFspSiliconInitUpdDataPointer() API in FspCommonLib,
 so that core can set this UdpDataPointer and platform code may get UpdDataPointer easily.
Add UpdateMemSiUpdInitOffsetValue function in GenCfgOpt.py tool, so that the MemoryInitUpdOffset and SiUpdInitOffset is recorded.
Add missing EMBED comment in GenCfgOptUserManual.docx

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <Jiewen.Yao@intel.com>
Reviewed-by: "Mudusuru, Giri P" <giri.p.mudusuru@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18123 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg: use 'auto' alignment and FIXED placement for XIP modules
Ard Biesheuvel [Fri, 31 Jul 2015 08:24:18 +0000 (08:24 +0000)]
ArmVirtPkg: use 'auto' alignment and FIXED placement for XIP modules

Now that GenFw correctly propagates the minimum alignment of the ELF
input sections to the PE/COFF binary, we can simply select 'auto'
alignment in the FDF Rule section instead of tweaking it by hand.

Also add the FIXED FFS attribute to the module types that may execute
in place. This enables a newly added optimization in GenFfs that strips
redundant padding, preventing excessive waste of FV space if the section
alignment is considerable (i.e., 2 KB or 4 KB)

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@18122 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUiApp: Move reset menu from Front Page to BMM Page.
Eric Dong [Fri, 31 Jul 2015 02:14:26 +0000 (02:14 +0000)]
UiApp: Move reset menu from Front Page to BMM Page.

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

8 years agoRemove the useless code to fix build failure caused by error depend on IntelFramework...
Eric Dong [Fri, 31 Jul 2015 02:12:54 +0000 (02:12 +0000)]
Remove the useless code to fix build failure caused by error depend on IntelFrameworkModulePkg.

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

8 years agoFixed GCC tool chain build fail.
Eric Dong [Fri, 31 Jul 2015 01:21:50 +0000 (01:21 +0000)]
Fixed GCC tool chain build fail.

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@18119 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoStdLib: Add support for AArch64
Harry Liebel [Thu, 30 Jul 2015 09:51:04 +0000 (09:51 +0000)]
StdLib: Add support for AArch64

- Use some files from ARM version.
- Use NetBSD software floating point library to provide floating point
  operations not handled directly by hardware floating point enabled
  GCC compiler.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Harry Liebel <Harry.Liebel@arm.com>
Reviewed-by: Olivier Martin <Olivier.Martin@arm.com>
Reviewed-by: Daryl McDaniel <edk2-lists@mc2research.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18118 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoStdLib/LibC: Provide missing ARM symbols
Harry Liebel [Thu, 30 Jul 2015 09:50:58 +0000 (09:50 +0000)]
StdLib/LibC: Provide missing ARM symbols

Provide missing functionality by using files from LLVM.

Changes made:
- Formatting changes (tabs to spaces, DOS line endings etc).
- Simplified 'int_endianness.h' to work for our case.
- Added LLVM licence to the individual files.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Harry Liebel <Harry.Liebel@arm.com>
Reviewed-by: Olivier Martin <Olivier.Martin@arm.com>
Reviewed-by: Daryl McDaniel <edk2-lists@mc2research.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18117 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoStdLib/LibC: Add software floating point library from NetBSD
NetBSD project [Thu, 30 Jul 2015 09:50:51 +0000 (09:50 +0000)]
StdLib/LibC: Add software floating point library from NetBSD

Floating point processing is not supported on ARM for UEFI. In order to
support UEFI applications in AppPkg we use this library to provide the
required functionality.

Changes as compared to the NetBSD version:
- Formatting changes (tabs to spaces, DOS line endings etc).
- Disable exceptions as described in the float_raise() function.
- Disable definition of 'Symbolic Boolean literals' in milieu.h.

Source originally from: NetBSD project
- Source: http://cvsweb.netbsd.org/bsdweb.cgi/?only_with_tag=MAIN
- Licensing and Copyright: http://www.netbsd.org/about/redistribution.html

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Harry Liebel <Harry.Liebel@arm.com>
Reviewed-by: Olivier Martin <Olivier.Martin@arm.com>
Reviewed-by: Daryl McDaniel <edk2-lists@mc2research.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18116 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoStdLib: Added BaseStackLib for ARM architectures
Olivier Martin [Thu, 30 Jul 2015 09:50:43 +0000 (09:50 +0000)]
StdLib: Added BaseStackLib for ARM architectures

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <Olivier.Martin@arm.com>
Reviewed-by: Ronald Cron <Ronald.Cron@arm.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Daryl McDaniel <edk2-lists@mc2research.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18115 6f19259b-4bc3-4df7-8a09-765794883524