]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
8 years agoMdeModulePkg: enforce arch-specific alignment for split regions
Ard Biesheuvel [Thu, 2 Jul 2015 07:32:56 +0000 (07:32 +0000)]
MdeModulePkg: enforce arch-specific alignment for split regions

The splitting of memory regions into code and data regions violates
architecture specific alignment rules by using a fixed alignment
of 4 KB. Replace it with EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT,
which is defined appropriately on each architecture.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: "Jaben Carsey" <jaben.carsey@intel.com>
Reviewed-by: "Yao, Jiewen" <Jiewen.Yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17812 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: move arch-specific allocation granularity defines to DxeMain.h
Ard Biesheuvel [Thu, 2 Jul 2015 07:32:44 +0000 (07:32 +0000)]
MdeModulePkg: move arch-specific allocation granularity defines to DxeMain.h

Move the definitions of EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT and
DEFAULT_PAGE_ALLOCATION to DxeMain.h to make them available explicitly
to all parts of DxeCore.

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

8 years agoMdeModulePkg: rename PropertiesTableEnable to PcdPropertiesTableEnable
Ard Biesheuvel [Thu, 2 Jul 2015 07:32:33 +0000 (07:32 +0000)]
MdeModulePkg: rename PropertiesTableEnable to PcdPropertiesTableEnable

PCD names should start with 'Pcd' so rename PropertiesTableEnable
to PcdPropertiesTableEnable.

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

8 years agoMdeModulePkg: make internal functions STATIC in Core/Dxe/Misc/PropertiesTable.c
Ard Biesheuvel [Thu, 2 Jul 2015 07:32:22 +0000 (07:32 +0000)]
MdeModulePkg: make internal functions STATIC in Core/Dxe/Misc/PropertiesTable.c

Add STATIC to functions that are only used internally.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: "Jaben Carsey" <jaben.carsey@intel.com>
Reviewed-by: "Yao, Jiewen" <Jiewen.Yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17809 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: remove unused functions from Core/Dxe/Misc/PropertiesTable.c
Ard Biesheuvel [Thu, 2 Jul 2015 07:32:10 +0000 (07:32 +0000)]
MdeModulePkg: remove unused functions from Core/Dxe/Misc/PropertiesTable.c

This removes the functions RevertRuntimeMemoryMap () and
DumpMemoryMap () which are not referenced anywhere in the code.

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

8 years agoRevert tree to r17801
Jordan Justen [Thu, 2 Jul 2015 07:23:33 +0000 (07:23 +0000)]
Revert tree to r17801

Revert r17802 "BaseTools: AArch64: use explicit linker scripts"
Revert r17803 "ArmVirtPkg: build runtime drivers with 64 KB section alignment"
Revert r17804 "IntelFrameworkModulePkg: AcpiS3SaveDxe: prepare for End-of-Dxe callback"
Revert r17805 "IntelFrameworkModulePkg: AcpiS3SaveDxe: call S3Ready() at End-of-Dxe"
Revert r17806 "OvmfPkg: AcpiS3SaveDxe: prepare for End-of-Dxe callback"

Requested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
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@17807 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: AcpiS3SaveDxe: prepare for End-of-Dxe callback
Laszlo Ersek [Thu, 2 Jul 2015 06:36:38 +0000 (06:36 +0000)]
OvmfPkg: AcpiS3SaveDxe: prepare for End-of-Dxe callback

We are preparing for detaching the S3Ready() functionality from the
EFI_ACPI_S3_SAVE_PROTOCOL.S3Save() protocol member function. Instead, we
will hook the same logic to the End-of-Dxe event group.

The EFI_ACPI_S3_SAVE_PROTOCOL has another member: GetLegacyMemorySize().
According to the documenation,

  This function returns the size of the legacy memory (meaning below 1 MB)
  that is required during an S3 resume. Before the Framework-based
  firmware transfers control to the OS, it has to transition from flat
  mode into real mode in case the OS supplies only a real-mode waking
  vector. This transition requires a certain amount of legacy memory.
  After getting the size of legacy memory below, the caller is responsible
  for allocating the legacy memory below 1 MB according to the size that
  is returned. The specific implementation of allocating the legacy memory
  is out of the scope of this specification.

When EFI_ACPI_S3_SAVE_PROTOCOL.S3Save() is called, the address of the
legacy memory allocated above must be passed to it, in the
LegacyMemoryAddress parameter.

In practice however:

- The S3Ready() function ignores the LegacyMemoryAddress completely.

- No code in the edk2 tree calls
  EFI_ACPI_S3_SAVE_PROTOCOL.GetLegacyMemorySize(), ever.

- All callers of this specific implementation of
  EFI_ACPI_S3_SAVE_PROTOCOL.S3Save() in the edk2 tree pass a NULL
  LegacyMemoryAddress:

  BdsLibBootViaBootOption()
  [IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c]

For this reason, ASSERT() explicitly that LegacyGetS3MemorySize() is never
called, and that the LegacyMemoryAddress parameter is always NULL.

This fact is important to capture in the code, because in the End-of-Dxe
callback, no LegacyMemoryAddress parameter can be taken. So let's make it
clear that we actually don't even have any use for that parameter.

This patch ports the identical change from IntelFrameworkModulePkg to
OvmfPkg.

Cc: Jordan Justen <jordan.l.justen@intel.com>
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@17806 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoIntelFrameworkModulePkg: AcpiS3SaveDxe: call S3Ready() at End-of-Dxe
Laszlo Ersek [Thu, 2 Jul 2015 06:36:29 +0000 (06:36 +0000)]
IntelFrameworkModulePkg: AcpiS3SaveDxe: call S3Ready() at End-of-Dxe

Call S3Ready() whenever the first of the following occurs:
- a driver signals End-of-Dxe,
- a driver calls EFI_ACPI_S3_SAVE_PROTOCOL.S3Save().

S3Ready() already contains a static, function scope "latch" that causes it
to exit early when called for the second time or later.

(At the moment, the only platform in the edk2 tree that includes this
driver is Vlv2TbltDevicePkg. That platform does not signal End-of-Dxe
(yet).)

http://thread.gmane.org/gmane.comp.bios.tianocore.devel/16088/focus=16146
Suggested-by: Yao Jiewen <jiewen.yao@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Cc: David Wei <david.wei@intel.com>
Cc: Tim He <tim.he@intel.com>
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@17805 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoIntelFrameworkModulePkg: AcpiS3SaveDxe: prepare for End-of-Dxe callback
Laszlo Ersek [Thu, 2 Jul 2015 06:36:19 +0000 (06:36 +0000)]
IntelFrameworkModulePkg: AcpiS3SaveDxe: prepare for End-of-Dxe callback

We are preparing for detaching the S3Ready() functionality from the
EFI_ACPI_S3_SAVE_PROTOCOL.S3Save() protocol member function. Instead, we
will hook the same logic to the End-of-Dxe event group.

The EFI_ACPI_S3_SAVE_PROTOCOL has another member: GetLegacyMemorySize().
According to the documenation,

  This function returns the size of the legacy memory (meaning below 1 MB)
  that is required during an S3 resume. Before the Framework-based
  firmware transfers control to the OS, it has to transition from flat
  mode into real mode in case the OS supplies only a real-mode waking
  vector. This transition requires a certain amount of legacy memory.
  After getting the size of legacy memory below, the caller is responsible
  for allocating the legacy memory below 1 MB according to the size that
  is returned. The specific implementation of allocating the legacy memory
  is out of the scope of this specification.

When EFI_ACPI_S3_SAVE_PROTOCOL.S3Save() is called, the address of the
legacy memory allocated above must be passed to it, in the
LegacyMemoryAddress parameter.

In practice however:

- The S3Ready() function ignores the LegacyMemoryAddress completely.

- No code in the edk2 tree calls
  EFI_ACPI_S3_SAVE_PROTOCOL.GetLegacyMemorySize(), ever.

- All callers of EFI_ACPI_S3_SAVE_PROTOCOL.S3Save() in the edk2 tree pass
  a NULL LegacyMemoryAddress:

  BdsLibBootViaBootOption()
  [IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c]

  OnReadyToBoot()
  [Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c]

  InstallReadyToLock()
  [Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c]

  BdsLibBootViaBootOption()
  [Vlv2TbltDevicePkg/Override/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c]

For this reason, ASSERT() explicitly that LegacyGetS3MemorySize() is never
called, and that the LegacyMemoryAddress parameter is always NULL.

This fact is important to capture in the code, because in the End-of-Dxe
callback, no LegacyMemoryAddress parameter can be taken. So let's make it
clear that we actually don't even have any use for that parameter.

Cc: Yao Jiewen <jiewen.yao@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Cc: David Wei <david.wei@intel.com>
Cc: Tim He <tim.he@intel.com>
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@17804 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg: build runtime drivers with 64 KB section alignment
Ard Biesheuvel [Thu, 2 Jul 2015 06:36:10 +0000 (06:36 +0000)]
ArmVirtPkg: build runtime drivers with 64 KB section alignment

This adds the 64 KB alignment overlay linker script to the linker
command line of DXE_RUNTIME_DRIVER modules. This makes these modules
compatible with the new Properties Table feature by aligning the .text
and .data sections to 64 KB.

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

8 years agoBaseTools: AArch64: use explicit linker scripts
Ard Biesheuvel [Thu, 2 Jul 2015 06:36:00 +0000 (06:36 +0000)]
BaseTools: AArch64: use explicit linker scripts

Instead of relying on the builtin linker script of GNU ld, which
may vary based on binutils version (which is not tightly coupled to
the GCC version) and linker command line options, introduce a linker
script for AArch64 to be used by all GCC/binutils versions.

The script is laid out such that two ELF sections .text and .data are
created that map onto the PE/COFF with the same names. By aligning
.data to the minimum alignment of .text, and by not adding any
additional padding -which is what LD's builtin linker script does- the
relative offset between .text and .data is retained after the PE/COFF
conversion. This should prevent problems with debuggers and other
tooling that are ELF based.

Also provided is an overlay linker script that increases the alignment
of .text and .data to 64 KB. This is intended for DXE_RUNTIME_DRIVER
modules, to make them compatible with the newly introduced
Properties Table feature.

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

8 years agoBaseTools/Ecc: Fix a bug when checking copyright format
Hess Chen [Thu, 2 Jul 2015 06:05:26 +0000 (06:05 +0000)]
BaseTools/Ecc: Fix a bug when checking copyright format

Fix a bug to only checking the copyright listed in config.ini file.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: YangX Li <yangx.li@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17801 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools/Ecc: Fix a bug to get correct member variable
Hess Chen [Thu, 2 Jul 2015 06:02:42 +0000 (06:02 +0000)]
BaseTools/Ecc: Fix a bug to get correct member variable

Fix a bug to get correct member variable by ignoring 'OPTIONAL' modifier

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: YangX Li <yangx.li@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17800 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: Update DxeCore to handle LoadFile DevicePath
Liming Gao [Thu, 2 Jul 2015 04:28:21 +0000 (04:28 +0000)]
MdeModulePkg: Update DxeCore to handle LoadFile DevicePath

UEFI Spec HTTP Boot Device Path, after retrieving the boot resource
information, the BootURI device path node will be updated to include
the BootURI information. It means the device path on the child handle
will be updated after the LoadFile() service is called.

To handle this case, DxeCore LoadImage() service is updated as the below:
1) Get Device handle based on Device Path
2) Call LoadFile() service (GetFileBufferByFilePath() API) to get Load File Buffer.
3) Retrieve DevicePath from Device handle

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

8 years agoMdeModulePkg: UefiBootManagerLib to handle LoadFile DevicePath
Liming Gao [Thu, 2 Jul 2015 04:27:54 +0000 (04:27 +0000)]
MdeModulePkg: UefiBootManagerLib to handle LoadFile DevicePath

UEFI Spec HTTP Boot Device Path, after retrieving the boot resource
information, the BootURI device path node will be updated to include
the BootURI information. It means the device path on the child handle
will be updated after the LoadFile() service is called.

To handle this case, UefiBootManagerLib BmGetLoadOptionBuffer API
is updated as the below:
1) Get Device handle based on Device Path
2) Call LoadFile() service (GetFileBufferByFilePath() API) to get Load File Buffer.
3) Retrieve DevicePath from Device handle

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

8 years agoMdeModulePkg: SecurityManagementLib to handle LoadFile DevicePath
Liming Gao [Thu, 2 Jul 2015 04:27:32 +0000 (04:27 +0000)]
MdeModulePkg: SecurityManagementLib to handle LoadFile DevicePath

UEFI Spec HTTP Boot Device Path, after retrieving the boot resource
information, the BootURI device path node will be updated to include
the BootURI information. It means the device path on the child handle
will be updated after the LoadFile() service is called.

To handle this case, SecurityManagementLib ExecuteSecurityHandlers API
is updated as the below:
1) Get Device handle based on Device Path
2) Call LoadFile() service (GetFileBufferByFilePath() API) to get Load File Buffer.
3) Retrieve DevicePath from Device handle

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

8 years agoBaseTools: Fixed BuildOptions bug.
Yingke Liu [Thu, 2 Jul 2015 03:42:34 +0000 (03:42 +0000)]
BaseTools: Fixed BuildOptions bug.

The BuildOptions in an INF should also follow override rule: If '==' is used, all previous options are overridden.

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

8 years agoShellPkg: Refine the code logic of StrnCatGrow.
Qiu Shumin [Thu, 2 Jul 2015 01:12:03 +0000 (01:12 +0000)]
ShellPkg: Refine the code logic of StrnCatGrow.

In order to indicate the catena length use StrnCatS instead of StrCatS to generate Destination string, and update the DestMax of Destination string.

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

8 years agoMdeModulePkg Variable: Minor enhancement to VarCheck
Star Zeng [Thu, 2 Jul 2015 00:50:42 +0000 (00:50 +0000)]
MdeModulePkg Variable: Minor enhancement to VarCheck

1. When Property->Attributes == 0, don't check input Attributes.
2. Enhance comments to be indent aligned and debug message
to be aligned with other messages.

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

8 years agoMdePkg: Add P2P Bridge Secondary Latency Timer register definition
Samer El-Haj-Mahmoud [Wed, 1 Jul 2015 15:21:35 +0000 (15:21 +0000)]
MdePkg: Add P2P Bridge Secondary Latency Timer register definition

Add P2P Bridge Secondary Latency Timer register definition to Pci22.h

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

8 years agoBaseTools: Add missing EfiPersistentMemory to EFI_MEMORY_TYPE
Samer El-Haj-Mahmoud [Wed, 1 Jul 2015 15:21:03 +0000 (15:21 +0000)]
BaseTools: Add missing EfiPersistentMemory to EFI_MEMORY_TYPE

To sync with the EFI_MEMROYT_TYPE definition in MdePkg

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

8 years agoCorebootModulePkg: Get power management register addresses.
Guo Dong [Wed, 1 Jul 2015 09:41:58 +0000 (09:41 +0000)]
CorebootModulePkg: Get power management register addresses.

This patch will get power management event register address and power management GPE enable register address.
Add missing code in CbParseLib.c.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Guo Dong <guo.dong@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17791 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoFixed a couple of typos of 'Configuration' ('Congfiguration') in Vlv2TbltDevicePkg.
Bruce Cran [Wed, 1 Jul 2015 08:45:46 +0000 (08:45 +0000)]
Fixed a couple of typos of 'Configuration' ('Congfiguration') in Vlv2TbltDevicePkg.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bruce Cran <bruce.cran@gmail.com>
Reviewed-by: Shifei Lu <shifeix.a.lu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17790 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg/Universal/Variable: Use safe string functions to refine code.
Qiu Shumin [Wed, 1 Jul 2015 08:34:22 +0000 (08:34 +0000)]
MdeModulePkg/Universal/Variable: Use safe string functions to refine code.

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

8 years agoMdeModulePkg/Universal/SmbiosDxe: Use safe string functions to refine code.
Qiu Shumin [Wed, 1 Jul 2015 08:32:29 +0000 (08:32 +0000)]
MdeModulePkg/Universal/SmbiosDxe: Use safe string functions to refine code.

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

8 years agoMdeModulePkg/Universal/PlatformDriOverrideDxe: Use safe string functions to refine...
Qiu Shumin [Wed, 1 Jul 2015 08:28:13 +0000 (08:28 +0000)]
MdeModulePkg/Universal/PlatformDriOverrideDxe: Use safe string functions to refine code.

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

8 years agoMdeModulePkg/Universal/PCD: Use safe string functions to refine code.
Qiu Shumin [Wed, 1 Jul 2015 08:27:03 +0000 (08:27 +0000)]
MdeModulePkg/Universal/PCD: Use safe string functions to refine code.

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

8 years agoMdeModulePkg/Universal/FvSimpleFileSystemDxe: Use safe string functions to refine...
Qiu Shumin [Wed, 1 Jul 2015 08:25:33 +0000 (08:25 +0000)]
MdeModulePkg/Universal/FvSimpleFileSystemDxe: Use safe string functions to refine code.

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

8 years agoMdeModulePkg/Universal/CapsuleRuntimeDxe: Use safe string functions to refine code.
Qiu Shumin [Wed, 1 Jul 2015 08:23:30 +0000 (08:23 +0000)]
MdeModulePkg/Universal/CapsuleRuntimeDxe: Use safe string functions to refine code.

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

8 years agoMdeModulePkg/Universal/CapsulePei: Use safe string functions to refine code.
Qiu Shumin [Wed, 1 Jul 2015 08:22:31 +0000 (08:22 +0000)]
MdeModulePkg/Universal/CapsulePei: Use safe string functions to refine code.

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

8 years agoMdeModulePkg/Library/UefiBootManagerLib: Use safe string functions to refine code.
Qiu Shumin [Wed, 1 Jul 2015 08:21:16 +0000 (08:21 +0000)]
MdeModulePkg/Library/UefiBootManagerLib: Use safe string functions to refine code.

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

8 years agoMdeModulePkg/Library/SmmCorePerformanceLib: Use safe string functions to refine code.
Qiu Shumin [Wed, 1 Jul 2015 08:19:56 +0000 (08:19 +0000)]
MdeModulePkg/Library/SmmCorePerformanceLib: Use safe string functions to refine code.

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

8 years agoMdeModulePkg/Library/PeiPerformanceLib: Use safe string functions to refine code.
Qiu Shumin [Wed, 1 Jul 2015 08:15:27 +0000 (08:15 +0000)]
MdeModulePkg/Library/PeiPerformanceLib: Use safe string functions to refine code.

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

8 years agoMdeModulePkg/Library/PeiDxeDebugLibReportStatusCode: Use safe string functions to...
Qiu Shumin [Wed, 1 Jul 2015 08:14:36 +0000 (08:14 +0000)]
MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode: Use safe string functions to refine code.

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

8 years agoMdeModulePkg/Library/DxeCorePerformanceLib: Use safe string functions to refine code.
Qiu Shumin [Wed, 1 Jul 2015 08:05:00 +0000 (08:05 +0000)]
MdeModulePkg/Library/DxeCorePerformanceLib: Use safe string functions to refine code.

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

8 years agoMdeModulePkg/Application/MemoryProfileInfo: Use safe string functions to refine code.
Qiu Shumin [Wed, 1 Jul 2015 08:03:50 +0000 (08:03 +0000)]
MdeModulePkg/Application/MemoryProfileInfo: Use safe string functions to refine code.

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

8 years agoSecurityPkg: Delete empty directory after R17772.
Star Zeng [Wed, 1 Jul 2015 06:48:57 +0000 (06:48 +0000)]
SecurityPkg: Delete empty directory after R17772.

Delete directory
SecurityPkg/VariableAuthenticated/Pei
SecurityPkg/VariableAuthenticated/RuntimeDxe

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

8 years agoBaseTools: Checked return value of malloc for EfiCompress.
Yingke Liu [Wed, 1 Jul 2015 05:16:46 +0000 (05:16 +0000)]
BaseTools: Checked return value of malloc for EfiCompress.

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

8 years agoBaseTools: Do not create an empty file if Rsa2048Sha256Sign was failed.
Yingke Liu [Wed, 1 Jul 2015 05:14:28 +0000 (05:14 +0000)]
BaseTools: Do not create an empty file if Rsa2048Sha256Sign was failed.

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

8 years agoNetworkPkg: Remove unused variables from IpSecDxe to fix GCC build.
Samer El-Haj-Mahmoud [Wed, 1 Jul 2015 03:35:32 +0000 (03:35 +0000)]
NetworkPkg: Remove unused variables from IpSecDxe to fix GCC build.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hp.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17773 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoSecurityPkg: Delete Auth Variable driver
Star Zeng [Wed, 1 Jul 2015 03:13:02 +0000 (03:13 +0000)]
SecurityPkg: Delete Auth Variable driver

1. Delete TpmMeasurementLib LibraryClass from SecurityPkg after it moved to MdeModulePkg.
2. Update DxeTpmMeasurementLib.inf to include MdeModulePkg.dec.
3. Delete authenticated variable definition from AuthenticatedVariableFormat.h after
them moved to VariableFormat.h.
4. Replace VARIABLE_HEADER with AUTHENTICATED_VARIABLE_HEADER in EsalVariableDxeSal.
5. Delete VariableInfo from SecurityPkg after it merged to VariableInfo in MdeModulePkg.
6. Delete VariablePei from SecurityPkg after it merged to VariablePei in MdeModulePkg.
7. Delete Auth Variable driver from SecurityPkg after it merged to Variable driver in
MdeModulePkg.
8. Also update PACKAGE_GUID and PACKAGE_VERSION in SecurityPkg.dec after the deletion
of authenticated variable definition, VariableInfo, VariablePei and Auth Variable
driver from SecurityPkg; update PLATFORM_VERSION in SecurityPkg.dsc.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.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@17772 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoVlv2TbltDevicePkg: Use the merged Variable driver
Star Zeng [Wed, 1 Jul 2015 03:11:45 +0000 (03:11 +0000)]
Vlv2TbltDevicePkg: Use the merged Variable driver

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

8 years agoArmVirtPkg: Use the merged Variable driver
Star Zeng [Wed, 1 Jul 2015 03:11:05 +0000 (03:11 +0000)]
ArmVirtPkg: Use the merged Variable driver

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

8 years agoArmVirtPkg: Cleanup redundant library class resolution of Variable modules
Star Zeng [Wed, 1 Jul 2015 03:10:27 +0000 (03:10 +0000)]
ArmVirtPkg: Cleanup redundant library class resolution of Variable modules

SecurityPkg/VariableAuthenticated/Pei/VariablePei.inf doesn't consume
BaseCryptLib directly or indirectly, cleanup it.
  SecurityPkg/VariableAuthenticated/Pei/VariablePei.inf {
    <LibraryClasses>
      BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
  }

BaseCryptLib has been declared at [LibraryClasses.common.DXE_RUNTIME_DRIVER]
section in ArmVirt.dsc.inc.
OpensslLib has been declared at [LibraryClasses.common]
section in ArmVirt.dsc.inc.
So cleanup them.
  SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableRuntimeDxe.inf {
    <LibraryClasses>
      BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
      OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
  }

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

8 years agoArmPlatformPkg: Use the merged Variable driver
Star Zeng [Wed, 1 Jul 2015 03:10:01 +0000 (03:10 +0000)]
ArmPlatformPkg: Use the merged Variable driver

Remove gVariableAuthenticatedRuntimeDxeFileGuid definition in
ArmPlatformPkg.dec and use gVariableRuntimeDxeFileGuid in
NorFlashAuthenticatedDxe.inf as auth Variable driver in SecurityPkg
and Variable driver in MdeModulePkg have been merged.

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

8 years agoOvmfPkg: Use the merged Variable driver
Star Zeng [Wed, 1 Jul 2015 03:09:30 +0000 (03:09 +0000)]
OvmfPkg: Use the merged Variable driver

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@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@17767 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNt32Pkg: Use the merged Variable driver
Star Zeng [Wed, 1 Jul 2015 03:09:00 +0000 (03:09 +0000)]
Nt32Pkg: Use the merged Variable driver

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

8 years agoMdeModulePkg Variable: Merge from Auth Variable driver in SecurityPkg
Star Zeng [Wed, 1 Jul 2015 03:08:29 +0000 (03:08 +0000)]
MdeModulePkg Variable: Merge from Auth Variable driver in SecurityPkg

What to do:
1. Merge from Auth Variable driver in SecurityPkg to Variable drive in
MdeModulePkg. Then the merged Variable driver in MdeModulePkg will
link to AuthVariableLib and TpmMeasurementLib.
AuthVariableLibNull and TpmMeasurementLibNull in MdeModulePkg
could be used for non auth variable support.
AuthVariableLib and DxeTpmMeasurementLib in SecurityPkg
may be used for auth variable support.

Why to do:
1. Remove code duplication and reduce maintenance effort.
After auth variable service separated from Auth Variable driver in SecurityPkg
to AuthVariableLib. The remaining code logic of Auth Variable driver in SecurityPkg
will be almost same with Variable driver in MdeModulePkg. Now it is to
merge them.

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

8 years agoVlv2TbltDevicePkg: Link AuthVariableLib for following merged variable driver deploy
Star Zeng [Wed, 1 Jul 2015 03:07:27 +0000 (03:07 +0000)]
Vlv2TbltDevicePkg: Link AuthVariableLib for following merged variable driver deploy

AuthVariableLib and TpmMeasurementLib library classes are now linked with
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
to optionally support secure variables.

For Vlv2TbltDevicePkg,
link AuthVariableLib and DxeTpmMeasurementLib in SecurityPkg
when SECURE_BOOT_ENABLE = TRUE,
and link AuthVariableLibNull and TpmMeasurementLibNull in MdeModulePkg
when SECURE_BOOT_ENABLE = FALSE.

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

8 years agoArmVirtPkg: Link AuthVariableLib for following merged variable driver deploy
Star Zeng [Wed, 1 Jul 2015 03:07:02 +0000 (03:07 +0000)]
ArmVirtPkg: Link AuthVariableLib for following merged variable driver deploy

AuthVariableLib and TpmMeasurementLib library classes are now linked with
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
to optionally support secure variables.

For ArmVirtPkg,
link AuthVariableLib and DxeTpmMeasurementLib in SecurityPkg
when SECURE_BOOT_ENABLE = TRUE,
and link AuthVariableLibNull and TpmMeasurementLibNull in MdeModulePkg
when SECURE_BOOT_ENABLE = FALSE.

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

8 years agoArmPlatformPkg: Add TpmMeasurementLib and AuthVariableLib library mapping
Star Zeng [Wed, 1 Jul 2015 03:06:39 +0000 (03:06 +0000)]
ArmPlatformPkg: Add TpmMeasurementLib and AuthVariableLib library mapping

These library classes are now linked with
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
to optionally support secure variables.

For ArmPlatformPkg, secure boot is not currently enabled,
so we map these libraries to the NULL versions that don't support secure variables.

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

8 years agoEmulatorPkg: Add TpmMeasurementLib and AuthVariableLib library mapping
Star Zeng [Wed, 1 Jul 2015 03:06:09 +0000 (03:06 +0000)]
EmulatorPkg: Add TpmMeasurementLib and AuthVariableLib library mapping

These library classes are now linked with
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
to optionally support secure variables.

For EmulatorPkg, secure boot is not currently enabled,
so we map these libraries to the NULL versions that don't support secure variables.

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

8 years agoOvmfPkg: Link AuthVariableLib for following merged variable driver deploy
Star Zeng [Wed, 1 Jul 2015 03:05:47 +0000 (03:05 +0000)]
OvmfPkg: Link AuthVariableLib for following merged variable driver deploy

AuthVariableLib and TpmMeasurementLib library classes are now linked with
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
to optionally support secure variables.

For OvmfPkg,
link AuthVariableLib and DxeTpmMeasurementLib in SecurityPkg
when SECURE_BOOT_ENABLE = TRUE,
and link AuthVariableLibNull and TpmMeasurementLibNull in MdeModulePkg
when SECURE_BOOT_ENABLE = FALSE.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@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@17760 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNt32Pkg: Link AuthVariableLib for following merged variable driver deploy
Star Zeng [Wed, 1 Jul 2015 03:05:22 +0000 (03:05 +0000)]
Nt32Pkg: Link AuthVariableLib for following merged variable driver deploy

AuthVariableLib and TpmMeasurementLib library classes are now linked with
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
to optionally support secure variables.

For Nt32Pkg,
link AuthVariableLib and DxeTpmMeasurementLib in SecurityPkg
when SECURE_BOOT_ENABLE = TRUE,
and link AuthVariableLibNull and TpmMeasurementLibNull in MdeModulePkg
when SECURE_BOOT_ENABLE = FALSE.

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

8 years agoSecurityPkg: Implement AuthVariableLib library instance
Star Zeng [Wed, 1 Jul 2015 03:04:59 +0000 (03:04 +0000)]
SecurityPkg: Implement AuthVariableLib library instance

What to do:
1. Implement AuthVariableLib library instance.
2. Temporarily add VARIABLE_ENTRY_CONSISTENCY and
variable attribute combinations definitions to
AuthenticatedVariableFormat.h for git bisect.

Why to do:
1. Share code.
Separate auth variable service from Auth Variable driver in
SecurityPkg to AuthVariableLib. Then the AuthVariableLib could benefit
and be used by different implementation of Auth Variable drivers.

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

8 years agoMdeModulePkg: Add AuthVariableLib LibraryClass
Star Zeng [Wed, 1 Jul 2015 03:04:18 +0000 (03:04 +0000)]
MdeModulePkg: Add AuthVariableLib LibraryClass

What to do:
1. Add AuthVariableLib LibraryClass definitions.
2. Implement a NULL AuthVariableLib library instance.
3. Add VARIABLE_ENTRY_PROPERTY definition to VarCheck.h.
4. Add VARIABLE_ENTRY_CONSISTENCY and variable attribute
combinations definitions to VariableFormat.h.

Why to do:
1. Share code.
1.1. Separate auth variable service from Auth Variable driver in
SecurityPkg to AuthVariableLib. Then the AuthVariableLib could benefit
and be used by different implementation of Auth Variable drivers.

1.2 The VARIABLE_ENTRY_PROPERTY definition to VarCheck.h,
VARIABLE_ENTRY_CONSISTENCY and variable attribute
combinations definitions to VariableFormat.h will be shared
by merged Variable driver and AuthVariableLib.

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

8 years agoMdeModulePkg VariablePei: Merge from VariablePei in SecurityPkg
Star Zeng [Wed, 1 Jul 2015 03:03:26 +0000 (03:03 +0000)]
MdeModulePkg VariablePei: Merge from VariablePei in SecurityPkg

What to do:
1. Merge from VariablePei in SecurityPkg to VariablePei in MdeModulePkg.

Why to do:
1. Remove code duplication and reduce maintenance effort.
The code logic of VariablePei in SecurityPkg is same with VariablePei
in MdeModulePkg.

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

8 years agoMdeModulePkg VariableInfo: Merge from VariableInfo in SecurityPkg
Star Zeng [Wed, 1 Jul 2015 03:02:45 +0000 (03:02 +0000)]
MdeModulePkg VariableInfo: Merge from VariableInfo in SecurityPkg

What to do:
1. Merge VariableInfo in SecurityPkg to VariableInfo in MdeModulePkg.

Why to do:
1. Remove code duplication and reduce maintenance effort.
The functionality of VariableInfo in SecurityPkg has covered VariableInfo
in MdeModulePkg.

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

8 years agoMdeModulePkg: Move authenticated variable definition from SecurityPkg
Star Zeng [Wed, 1 Jul 2015 03:02:08 +0000 (03:02 +0000)]
MdeModulePkg: Move authenticated variable definition from SecurityPkg

What to do:
1. Move authenticated variable definition from AuthenticatedVariableFormat.h
to VariableFormat.h with gEfiAuthenticatedVariableGuid and
AUTHENTICATED_VARIABLE_HEADER.

Why to do:
1. Share code.
We are moving forward to separate auth variable service from Auth Variable
driver in SecurityPkg to AuthVariableLib. Then the AuthVariableLib could benefit
and be used by different implementation of Auth Variable drivers.
2. Remove code duplication and reduce maintenance effort.
After auth variable service separated from Auth Variable driver in SecurityPkg
to AuthVariableLib. The remaining code logic of Auth Variable driver in SecurityPkg
will be almost same with Variable driver in MdeModulePkg. We are going to
merge them.
3. gEfiAuthenticatedVariableGuid will be used by both merged Variable driver
and AuthVariableLib, AUTHENTICATED_VARIABLE_HEADER will be used by
merged Variable driver.

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

8 years agoMdeModulePkg: Move TpmMeasurementLib LibraryClass from SecurityPkg
Star Zeng [Wed, 1 Jul 2015 03:01:34 +0000 (03:01 +0000)]
MdeModulePkg: Move TpmMeasurementLib LibraryClass from SecurityPkg

What to do:
1. Move TpmMeasurementLib LibraryClass from SecurityPkg to MdeModulePkg.
2. Implement a NULL TpmMeasurementLib library instance.

Why to do:
1. Share code.
We are moving forward to separate auth variable service from Auth Variable
driver in SecurityPkg to AuthVariableLib. Then the AuthVariableLib could benefit
and be used by different implementation of Auth Variable drivers.
2. Remove code duplication and reduce maintenance effort.
After auth variable service separated from Auth Variable driver in SecurityPkg
to AuthVariableLib. The remaining code logic of Auth Variable driver in SecurityPkg
will be almost same with Variable driver in MdeModulePkg. We are going to
merge them.
3. TpmMeasurementLib is consumed by Auth Variable driver in SecurityPkg now,
as Auth Variable driver in SecurityPkg will be merged to Variable driver in
MdeModulePkg, so the library class also needs to be moved to MdeModulePkg.

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

8 years agoMdeModulePkg PlatDriOverrideDxe: Remove unneeded VARIABLE_HEADER reference
Star Zeng [Wed, 1 Jul 2015 02:51:41 +0000 (02:51 +0000)]
MdeModulePkg PlatDriOverrideDxe: Remove unneeded VARIABLE_HEADER reference

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

8 years agoNetworkPkg: Add IPv6 DUID configuration support using platform PCD.
Samer El-Haj-Mahmoud [Wed, 1 Jul 2015 02:17:07 +0000 (02:17 +0000)]
NetworkPkg: Add IPv6 DUID configuration support using platform PCD.

The code today always uses DUID-UUID unless there is an error in reading the UUID,
which results in falling through to DUID-LLT. This change allows the platform to
 control the DUID method (DUID-UUID or DUID-LLT) using a platform dynamic PCD.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hp.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17751 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Refine the code logic of mv.c.
Qiu Shumin [Wed, 1 Jul 2015 01:46:20 +0000 (01:46 +0000)]
ShellPkg: Refine the code logic of mv.c.

When doing the mv we should check whether source is 'above' dest on file path tree. This patch make the check logic more precise.

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

8 years agoThere needs to be a space between the output section name and the colon, i.e.,
Ard Biesheuvel [Wed, 1 Jul 2015 01:04:28 +0000 (01:04 +0000)]
There needs to be a space between the output section name and the colon, i.e.,

  .text : ALIGN(0x1000)
       ^

Fix this for all output sections

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

8 years agoShellPkg: Refine code to make catenae length more precise.
Qiu Shumin [Tue, 30 Jun 2015 20:15:15 +0000 (20:15 +0000)]
ShellPkg: Refine code to make catenae length more precise.

This commit refine the catenae length. A too long catenae length in StrnCat may cause potential buffer overflow while in StrnCatS it may ASSERT.

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

8 years agoPerformancePkg Dp_App: Resolve buffer size mismatch
Hao Wu [Tue, 30 Jun 2015 06:31:28 +0000 (06:31 +0000)]
PerformancePkg Dp_App: Resolve buffer size mismatch

CHAR16 array mGaugeString[DP_GAUGE_STRING_LENGTH + 1] is pass into
function GetShortPdbFileName(). However, in this function it treats the
size of the input buffer as DXE_PERFORMANCE_STRING_SIZE.

Though DXE_PERFORMANCE_STRING_SIZE is smaller than DP_GAUGE_STRING_LENGTH
now, but this manner might introduce a potential risk of buffer overflow.

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

8 years agoPerformancePkg Dp_App: Use safe string functions
Hao Wu [Tue, 30 Jun 2015 06:31:05 +0000 (06:31 +0000)]
PerformancePkg Dp_App: Use safe string functions

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

8 years agoUefiCpuPkg S3Resume2Pei: Use safe string functions
Hao Wu [Tue, 30 Jun 2015 06:30:44 +0000 (06:30 +0000)]
UefiCpuPkg S3Resume2Pei: Use safe string functions

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

8 years agoIntelFspPkg BaseFspDebugLibSerialPort: Use safe string functions
Hao Wu [Tue, 30 Jun 2015 06:30:20 +0000 (06:30 +0000)]
IntelFspPkg BaseFspDebugLibSerialPort: Use safe string functions

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

8 years agoMdePkg UefiLib: Use safe string functions
Hao Wu [Tue, 30 Jun 2015 06:29:51 +0000 (06:29 +0000)]
MdePkg UefiLib: Use safe string functions

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>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17742 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdePkg UefiDevicePathLib: Remove unsafe string functions
Hao Wu [Tue, 30 Jun 2015 06:29:24 +0000 (06:29 +0000)]
MdePkg UefiDevicePathLib: Remove unsafe string functions

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>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17741 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoIntelFrameworkPkg FrameworkUefiLib: Use safe string functions
Hao Wu [Tue, 30 Jun 2015 06:28:57 +0000 (06:28 +0000)]
IntelFrameworkPkg FrameworkUefiLib: Use safe string functions

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>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17740 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoIntelFrameworkModulePkg UpdateDriverDxe: Use safe string functions
Hao Wu [Tue, 30 Jun 2015 06:28:33 +0000 (06:28 +0000)]
IntelFrameworkModulePkg UpdateDriverDxe: Use safe string functions

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>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17739 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoIntelFrameworkModulePkg DeviceMngr: Use safe string functions
Hao Wu [Tue, 30 Jun 2015 06:28:08 +0000 (06:28 +0000)]
IntelFrameworkModulePkg DeviceMngr: Use safe string functions

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>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17738 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoIntelFrameworkModulePkg BootMngr: Use safe string functions
Hao Wu [Tue, 30 Jun 2015 06:27:44 +0000 (06:27 +0000)]
IntelFrameworkModulePkg BootMngr: Use safe string functions

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>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17737 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoIntelFrameworkModulePkg BootMaint: Use safe string functions
Hao Wu [Tue, 30 Jun 2015 06:27:18 +0000 (06:27 +0000)]
IntelFrameworkModulePkg BootMaint: Use safe string functions

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>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17736 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoIntelFrameworkModulePkg BdsDxe: Use safe string functions
Hao Wu [Tue, 30 Jun 2015 06:26:47 +0000 (06:26 +0000)]
IntelFrameworkModulePkg BdsDxe: Use safe string functions

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>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17735 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoIntelFrameworkModulePkg PeiDxeDebugLib: Use safe string functions
Hao Wu [Tue, 30 Jun 2015 06:26:20 +0000 (06:26 +0000)]
IntelFrameworkModulePkg PeiDxeDebugLib: Use safe string functions

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>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17734 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoIntelFrameworkModulePkg GenericBdsLib: Use safe string functions
Hao Wu [Tue, 30 Jun 2015 06:25:54 +0000 (06:25 +0000)]
IntelFrameworkModulePkg GenericBdsLib: Use safe string functions

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>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17733 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoIntelFrameworkModulePkg IsaFloppyDxe: Use safe string functions
Hao Wu [Tue, 30 Jun 2015 06:25:29 +0000 (06:25 +0000)]
IntelFrameworkModulePkg IsaFloppyDxe: Use safe string functions

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>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17732 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCryptoPkg: Fix the dereferenced pointer issue
Qin Long [Tue, 30 Jun 2015 03:27:23 +0000 (03:27 +0000)]
CryptoPkg: Fix the dereferenced pointer issue

This patch is to fix one dereferenced pointer issue in new
Pkcs7GetAttachedContent API, and add the memory allocation
failure check.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qin Long <qin.long@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17731 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Use safe string functions to refine code.
Qiu Shumin [Tue, 30 Jun 2015 03:18:31 +0000 (03:18 +0000)]
ShellPkg: Use safe string functions to refine code.

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

8 years agoSecurityPkg: Add MD5 support to Hash2DxeCrypto
Jonathan Doman [Mon, 29 Jun 2015 05:31:44 +0000 (05:31 +0000)]
SecurityPkg: Add MD5 support to Hash2DxeCrypto

MD5 is part of the HASH2 protocol and it's trivial to support.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jonathan Doman <jonathan.doman@hp.com>
Reviewed-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hp.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17729 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools: Added GCC ld script to support 4K alignment.
Yingke Liu [Mon, 29 Jun 2015 03:20:25 +0000 (03:20 +0000)]
BaseTools: Added GCC ld script to support 4K alignment.

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

8 years agoBaseTools: Update GenFw to support 4K alignment.
Ard Biesheuvel [Mon, 29 Jun 2015 03:17:34 +0000 (03:17 +0000)]
BaseTools: Update GenFw to support 4K alignment.

Get maximum section alignment from each ELF section, and this alignment is used to create PE header.

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

8 years agoBaseTools: Updated tool_def to support 4K alignment.
Yingke Liu [Mon, 29 Jun 2015 03:14:33 +0000 (03:14 +0000)]
BaseTools: Updated tool_def to support 4K alignment.

Replace '/MERGE:.data=.text /MERGE:.rdata=.text' with /MERGE:.rdata=.data

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

8 years agoBaseTools: Update IASL download link and remove specific version info.
Yingke Liu [Mon, 29 Jun 2015 03:10:25 +0000 (03:10 +0000)]
BaseTools: Update IASL download link and remove specific version info.

The version of IASL compiler in the tools_def.template file no longer exists on the acpica.org site.
Update download link and remove the specific version info from the tools_def.template file.

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

8 years agoMdeModulePkg:Use safe string functions
Dandan Bi [Mon, 29 Jun 2015 02:36:31 +0000 (02:36 +0000)]
MdeModulePkg:Use safe string functions

Replace unsafe String functions with new added safe string functions

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

8 years agoNetworkPkg: Check whether the iSCSI initiator name is null.
Zhang Lubo [Mon, 29 Jun 2015 02:21:54 +0000 (02:21 +0000)]
NetworkPkg: Check whether the iSCSI initiator name is null.

Popup a warning if iSCSI initiator name is null before attempt configure.

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

8 years agoOvmfPkg: PlatformPei: invert MTRR setup in QemuInitializeRam()
Laszlo Ersek [Fri, 26 Jun 2015 16:09:52 +0000 (16:09 +0000)]
OvmfPkg: PlatformPei: invert MTRR setup in QemuInitializeRam()

At the moment we work with a UC default MTRR type, and set three memory
ranges to WB:
- [0, 640 KB),
- [1 MB, LowerMemorySize),
- [4 GB, 4 GB + UpperMemorySize).

Unfortunately, coverage for the third range can fail with a high
likelihood. If the alignment of the base (ie. 4 GB) and the alignment of
the size (UpperMemorySize) differ, then MtrrLib creates a series of
variable MTRR entries, with power-of-two sized MTRR masks. And, it's
really easy to run out of variable MTRR entries, dependent on the
alignment difference.

This is a problem because a Linux guest will loudly reject any high memory
that is not covered my MTRR.

So, let's follow the inverse pattern (loosely inspired by SeaBIOS):
- flip the MTRR default type to WB,
- set [0, 640 KB) to WB -- fixed MTRRs have precedence over the default
  type and variable MTRRs, so we can't avoid this,
- set [640 KB, 1 MB) to UC -- implemented with fixed MTRRs,
- set [LowerMemorySize, 4 GB) to UC -- should succeed with variable MTRRs
  more likely than the other scheme (due to less chaotic alignment
  differences).

Effects of this patch can be observed by setting DEBUG_CACHE (0x00200000)
in PcdDebugPrintErrorLevel.

Cc: Maoming <maoming.maoming@huawei.com>
Cc: Huangpeng (Peter) <peter.huangpeng@huawei.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Maoming <maoming.maoming@huawei.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17722 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: PlatformPei: beautify memory HOB order in QemuInitializeRam()
Laszlo Ersek [Fri, 26 Jun 2015 16:09:48 +0000 (16:09 +0000)]
OvmfPkg: PlatformPei: beautify memory HOB order in QemuInitializeRam()

Build the memory HOBs in a tight block, in increasing base address order.

Cc: Maoming <maoming.maoming@huawei.com>
Cc: Huangpeng (Peter) <peter.huangpeng@huawei.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Maoming <maoming.maoming@huawei.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17721 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: PlatformPei: create the CPU HOB with dynamic memory space width
Laszlo Ersek [Fri, 26 Jun 2015 16:09:43 +0000 (16:09 +0000)]
OvmfPkg: PlatformPei: create the CPU HOB with dynamic memory space width

Maoming reported that guest memory sizes equal to or larger than 64GB
were not correctly handled by OVMF.

Enabling the DEBUG_GCD (0x00100000) bit in PcdDebugPrintErrorLevel, and
starting QEMU with 64GB guest RAM size, I found the following error in the
OVMF debug log:

> GCD:AddMemorySpace(Base=0000000100000000,Length=0000000F40000000)
>   GcdMemoryType   = Reserved
>   Capabilities    = 030000000000000F
>   Status = Unsupported

This message is emitted when the DXE core is initializing the memory space
map, processing the "above 4GB" memory resource descriptor HOB that was
created by OVMF's QemuInitializeRam() function (see "UpperMemorySize").

The DXE core's call chain fails in:

CoreInternalAddMemorySpace() [MdeModulePkg/Core/Dxe/Gcd/Gcd.c]
  CoreConvertSpace()
    //
    // Search for the list of descriptors that cover the range BaseAddress
    // to BaseAddress+Length
    //
    CoreSearchGcdMapEntry()

CoreSearchGcdMapEntry() fails because the one entry (with type
"nonexistent") in the initial GCD memory space map is too small, and
cannot be split to cover the memory space range being added:

> GCD:Initial GCD Memory Space Map
> GCDMemType Range                             Capabilities     Attributes
> ========== ================================= ================ ================
> NonExist   0000000000000000-0000000FFFFFFFFF 0000000000000000 0000000000000000

The size of this initial entry is determined from the CPU HOB
(CoreInitializeGcdServices()).

Set the SizeOfMemorySpace field in the CPU HOB to mPhysMemAddressWidth,
which is the narrowest valid value to cover the entire guest RAM.

Reported-by: Maoming <maoming.maoming@huawei.com>
Cc: Maoming <maoming.maoming@huawei.com>
Cc: Huangpeng (Peter) <peter.huangpeng@huawei.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Wei Liu <wei.liu2@citrix.com>
Tested-by: Maoming <maoming.maoming@huawei.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17720 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: PlatformPei: enable larger permanent PEI RAM
Laszlo Ersek [Fri, 26 Jun 2015 16:09:39 +0000 (16:09 +0000)]
OvmfPkg: PlatformPei: enable larger permanent PEI RAM

We'll soon increase the maximum guest-physical RAM size supported by OVMF.
For more RAM, the DXE IPL is going to build more page tables, and for that
it's going to need a bigger chunk from the permanent PEI RAM.

Otherwise CreateIdentityMappingPageTables() would fail with:

> DXE IPL Entry
> Loading PEIM at 0x000BFF61000 EntryPoint=0x000BFF61260 DxeCore.efi
> Loading DXE CORE at 0x000BFF61000 EntryPoint=0x000BFF61260
> AllocatePages failed: No 0x40201 Pages is available.
> There is only left 0x3F1F pages memory resource to be allocated.
> ASSERT .../MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c(123):
> BigPageAddress != 0

(The above example belongs to the artificially high, maximal address width
of 52, clamped by the DXE core to 48. The address width of 48 bits
corresponds to 256 TB or RAM, and requires a bit more than 1GB for paging
structures.)

Cc: Maoming <maoming.maoming@huawei.com>
Cc: Huangpeng (Peter) <peter.huangpeng@huawei.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Brian J. Johnson <bjohnson@sgi.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Brian J. Johnson <bjohnson@sgi.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17719 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoSecurityPkg/TcgMor: move TPer Reset operation to this module
Tian Feng [Fri, 26 Jun 2015 08:42:46 +0000 (08:42 +0000)]
SecurityPkg/TcgMor: move TPer Reset operation to this module

The TPer Reset operation is a common logic. So it's added into
SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.inf module and
would be triggered at EndOfDxe.

By this way, all encrypted drives which produce EFI_STORAGE_SECURITY_
RPOTOCOL interface would be force reset when MOR is set.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tian Feng <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@17718 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg/AtaBus: remove TPer Reset operation in DriverBindingStart
Tian Feng [Fri, 26 Jun 2015 08:42:17 +0000 (08:42 +0000)]
MdeModulePkg/AtaBus: remove TPer Reset operation in DriverBindingStart

The TPer Reset operation would be moved into SecurityPkg/Tcg/
MemoryOverwriteControl/TcgMor.inf module and be triggered at EndOfDxe.

By this way, all encrypted drives which produce EFI_STORAGE_SECURITY_
RPOTOCOL interface would be force reset when MOR is set.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tian Feng <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@17717 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoSourceLevelDebugPkg/DebugAgent: Add typecast to fix sign extension
Jeff Fan [Fri, 26 Jun 2015 03:06:50 +0000 (03:06 +0000)]
SourceLevelDebugPkg/DebugAgent: Add typecast to fix sign extension

OffsetHigh is 16bit value and its type is UINT32 and defined in structure.
It will be 32bit int type after do 16-bit left-shift operation. Then it will
sign extension if cast it to UINT64 if its high bit is 1.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Scott Duplichan <scott@notabs.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17716 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCorebootPayloadPkg: Fix "reset -s" issue.
Guo Dong [Thu, 25 Jun 2015 16:02:16 +0000 (16:02 +0000)]
CorebootPayloadPkg: Fix "reset -s" issue.

Fix reboot issue after issuing shell command "reset -s" from UEFI payload.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Guo Dong <guo.dong@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17715 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCorebootModulePkg: Get power management register addresses.
Guo Dong [Thu, 25 Jun 2015 16:00:29 +0000 (16:00 +0000)]
CorebootModulePkg: Get power management register addresses.

This patch will get power management event register address and power management GPE enable register address.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Guo Dong <guo.dong@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17714 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg: signal EndOxDxe event in PlatformBsdInit
Ard Biesheuvel [Thu, 25 Jun 2015 14:49:06 +0000 (14:49 +0000)]
ArmVirtPkg: signal EndOxDxe event in PlatformBsdInit

Currently, the ArmVirtPkg platforms built with the Intel BDS fail
to signal the end-of-DXE event 'gEfiEndOfDxeEventGroupGuid' when
entering the BDS phase, which results in some loss of functionality,
i.e., variable reclaim in the VariableDxe drivers, and the splitting
of the memory regions that is part of the recently added UEFI 2.5
properties table feature.

As discussed on the edk2-devel mailing list here:

http://thread.gmane.org/gmane.comp.bios.tianocore.devel/16088/focus=16109

it is up to the platform BDS to signal that event, since there may be
platform specific ordering constraints with respect to the signalling
of the event that are difficult to honor at the generic level.

So add the SignalEvent () call to PlatformBdsInit () of ArmVirtPkg's
PlatformBdsLib implementation for the Intel BDS.

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

8 years agoBaseTools/Ecc: Fix a bug of determining boolean variable incorrectly
Hess Chen [Thu, 25 Jun 2015 08:10:51 +0000 (08:10 +0000)]
BaseTools/Ecc: Fix a bug of determining boolean variable incorrectly

Fix a bug of determining boolean variable incorrectly in C parser

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: YangX Li <yangx.li@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17711 6f19259b-4bc3-4df7-8a09-765794883524