]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
8 years agoArmPkg: Purge unused/unneeded CPU-specific header files
Leif Lindholm [Fri, 6 Nov 2015 17:19:56 +0000 (17:19 +0000)]
ArmPkg: Purge unused/unneeded CPU-specific header files

In ArmPkg/Include/Chipset, several CPU-specific header files reside.
Most of these provide no actual, or very little, use.
ARM1176JZ-S.h   is not used at all (and unusable since SVN r18237).
ArmAemV8.h      simply includes AArch64.h.
ArmCortexA15.h  defines one processor-specific configuration bit and
                then includes ArmV7.h.

Delete these include files, and update their sole users to function
without them.

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

8 years agoNetworkPkg:Missing CloseEvent() in HttpResponseWorker
Nagaraj Hegde [Fri, 6 Nov 2015 09:35:09 +0000 (09:35 +0000)]
NetworkPkg:Missing CloseEvent() in HttpResponseWorker

Two additional scenarios in which CloseEvent() needs to be called:
When sending a request to http server using HTTP Head method, if the process
is success, we did a response call, and then go to exit without close the
event in Rxtoken in wrap structure and in httpinstance struceure, so
another call() to response using http get method to receive http header,
those events are not closed either..

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Nagaraj Hegde <nagaraj-p.hegde@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18735 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools: Print PACKAGES_PATH build environment if it is set.
Liming Gao [Fri, 6 Nov 2015 02:57:07 +0000 (02:57 +0000)]
BaseTools: Print PACKAGES_PATH build environment if it is set.

Print the optional build environment PACKAGES_PATH and EDK_TOOLS_BIN.

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

8 years agoSecurityPkg: Remove temp return solution in PeiRsa2048Sha256 Section Lib
Zhang Chao [Fri, 6 Nov 2015 01:56:51 +0000 (01:56 +0000)]
SecurityPkg: Remove temp return solution in PeiRsa2048Sha256 Section Lib

PeiCore supports EFI_PEI_SECURITY_PPI to handle section extraction failure. The wrong returning status is no longer needed.

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

8 years agoBaseTools: Don't require ECP pkg in WORKSPACE when PACKAGES_PATH is set
Liming Gao [Fri, 6 Nov 2015 01:10:25 +0000 (01:10 +0000)]
BaseTools: Don't require ECP pkg in WORKSPACE when PACKAGES_PATH is set

When PACKAGES_PATH is set, ECP pkg may be in another directory, not exist
in WORKSPACE. So, keep this check in single WORKSPACE.

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

8 years agoCryptoPkg: fix AARCH64 build under CLANG35
Ard Biesheuvel [Thu, 5 Nov 2015 14:41:43 +0000 (14:41 +0000)]
CryptoPkg: fix AARCH64 build under CLANG35

The OpenSSL function sk_X509_delete_ptr() resolves through preprocessor
substitution to '(X509 *)sk_delete_ptr()', in which the cast causes the
call to be interpreted as an expression (whose value is not used) rather
than a statement, resulting in the following error under Clang:

  ...: error: expression result unused [-Werror,-Wunused-value]

Add (VOID) casts to silence the error.

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

8 years agoCryptoPkg: Add one new API (Pkcs7GetCertificatesList) for certs retrieving.
Qin Long [Thu, 5 Nov 2015 08:50:39 +0000 (08:50 +0000)]
CryptoPkg: Add one new API (Pkcs7GetCertificatesList) for certs retrieving.

Adding one new API (Pkcs7GetCertificatesList) to retrieve and sort all
embedded certificates from Pkcs7 signedData. This new API will provide
the support for UEFI 2.5 Secure-Boot AuditMode feature.

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

8 years agoShellPkg/UefiDpLib: Support dumping cumulative data
Cinnamon Shia [Thu, 5 Nov 2015 01:59:24 +0000 (01:59 +0000)]
ShellPkg/UefiDpLib: Support dumping cumulative data

Add a new option -c to dump cumulative data.
For example:
shell> dp -c
==[ Cumulative ]========
(Times in microsec.)     Cumulative   Average     Shortest    Longest
   Name          Count    Duration    Duration    Duration    Duration
LoadImage:         200     1000000        7000           0      100000
StartImage:        200    20000000       90000           0     7000000
  DB:Start:        200    20000000      100000           0     9000000
DB:Support:     200000      100000           0           0        7000

shell> dp -c DXE
==[ Cumulative ]========
(Times in microsec.)     Cumulative   Average     Shortest    Longest
   Name          Count    Duration    Duration    Duration    Duration
LoadImage:         200     1000000        7000           0      100000
StartImage:        200    20000000       90000           0     7000000
  DB:Start:        200    20000000      100000           0     9000000
DB:Support:     200000      100000           0           0        7000
        DXE          1    30000000    30000000           0    30000000

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18728 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg/UefiDpLib: Fix a DP cumulative data issue
Cinnamon Shia [Thu, 5 Nov 2015 01:03:14 +0000 (01:03 +0000)]
ShellPkg/UefiDpLib: Fix a DP cumulative data issue

The value of PERF_CUM_DATA.Count and PERF_CUM_DATA.Duration field
keep cumulating on every execution of dp.
Initialize the CumData at dp's entry point.

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

8 years agoUefiCpuPkg: PiSmmCpuDxeSmm: Remove Framework compatibility
Michael Kinney [Thu, 5 Nov 2015 00:01:45 +0000 (00:01 +0000)]
UefiCpuPkg: PiSmmCpuDxeSmm: Remove Framework compatibility

The PiSmmCpuDxeSmm module is using PcdFrameworkCompatibilitySupport to
provide compatibility with the SMM support in the IntelFrameworkPkg.
This change removes the Framework compatibility and requires all SMM
modules that provide SMI handlers to follow the PI Specification.

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

8 years agoShellPkg UefiDpLib: Use correct string length for the input UnicodeBuffer
Star Zeng [Wed, 4 Nov 2015 01:56:29 +0000 (01:56 +0000)]
ShellPkg UefiDpLib: Use correct string length for the input UnicodeBuffer

Same as the beginning of function to use DP_GAUGE_STRING_LENGTH, but not
DXE_PERFORMANCE_STRING_LENGTH.

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

8 years agoAppPkg: Replace all occurrences of ` within comments with '.
Daryl McDaniel [Tue, 3 Nov 2015 18:58:06 +0000 (18:58 +0000)]
AppPkg: Replace all occurrences of ` within comments with '.

Within the Ia32 and X64 pyconfig.h files, there are 178 occurrences
of an accent character, `, being used instead of a regular single quote, ',
within comments.

Example:
    OLD:  `foobar'
    NEW: 'foobar'

The same changes are applied to both
AppPkg/Applications/Python/Ia32/pyconfig.h and
AppPkg/Applications/Python/X64/pyconfig.h.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <edk2-lists@mc2research.org>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18724 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg: Juno - add correct SPI interrupt numbers for MSI
Jeremy Linton [Tue, 3 Nov 2015 11:11:22 +0000 (11:11 +0000)]
ArmPlatformPkg: Juno - add correct SPI interrupt numbers for MSI

The JunoR1 has a GICv2m which is a GICv2 with a little piece of hardware
that has some memory mapped locations that can trigger traditional SPI
interrupts. This allows some basic PCIe MSI capabilities.

Setup the SPI range that is mapped by the MSI window. This range is
described in the JunoR1 SoC TRM, table 3-3. Under Interrupt ID 244-351 is
described as "GICv2m PCI Express MSI". In the future when these tables
are generated programmatically the information may be found in the
MSI_TYPER register as well.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18723 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: Fix memory leak issues
Sunny Wang [Tue, 3 Nov 2015 02:58:30 +0000 (02:58 +0000)]
MdeModulePkg: Fix memory leak issues

Fix memory leak issues

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

8 years agoMdeModulePkg/RegularExpressionDxe: Add missing PrintLib
Cinnamon Shia [Tue, 3 Nov 2015 02:44:48 +0000 (02:44 +0000)]
MdeModulePkg/RegularExpressionDxe: Add missing PrintLib

AsciiVSPrint is used in RegularExpressionDxe/Oniguruma/OnigurumaUefiPort.c.
But PrintLib is missing in RegularExpressionDxe.inf.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18721 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg/RegularExpressionDxe: Correct copyright
Cinnamon Shia [Tue, 3 Nov 2015 02:43:03 +0000 (02:43 +0000)]
MdeModulePkg/RegularExpressionDxe: Correct copyright

Correct copyrights in RegularExpressionDxe

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18720 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: Fix a PciBusDxe hot plug bug
Ruiyu Ni [Tue, 3 Nov 2015 02:34:21 +0000 (02:34 +0000)]
MdeModulePkg: Fix a PciBusDxe hot plug bug

For a hot plug bridge with device attached, PciBusDxe driver reserves
the resources which equal to the total amount of padding resource
returned from HotPlug->GetResourcePadding() and the actual occupied
resource by the attached device. The behavior is incorrect.
Correct behavior is to reserve the bigger one between the padding
resource and the actual occupied resource.

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

8 years agoMdeModulePkg: Fix a PCI resource dumping bug in PciBusDxe driver
Ruiyu Ni [Tue, 3 Nov 2015 02:33:41 +0000 (02:33 +0000)]
MdeModulePkg: Fix a PCI resource dumping bug in PciBusDxe driver

The resource dumping logic contains a bug which cannot dump the
resource for hot plug controller correctly. The patch fixes this
bug.

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

8 years agoRevert "MdeModulePkg: Fix a PciBusDxe hot plug bug"
Ruiyu Ni [Tue, 3 Nov 2015 02:33:05 +0000 (02:33 +0000)]
Revert "MdeModulePkg: Fix a PciBusDxe hot plug bug"
Leif suggested to split the big patch to smaller ones.

This reverts commit 73b7f115c653c807b9d0be97bf516871d8aff7ba.

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

8 years agoMdeModulePkg: PiSmmCore: Remove confusing CopyMem() of SMM_ENTRY_CONTEXT
Michael Kinney [Tue, 3 Nov 2015 02:06:57 +0000 (02:06 +0000)]
MdeModulePkg: PiSmmCore: Remove confusing CopyMem() of SMM_ENTRY_CONTEXT

A subset of fields in the EFI_SMM_SYSTEM_TABLE2 structure are identical
to the fields in the SMM_ENTRY_CONTEXT structure.  CopyMem() is used to
transfer the contents of the SMM_ENTRY_CONTEXT structure into the
EFI_SMM_SYSTEM_TABLE2.  This is confusing because SMM_ENTRY_CONTEXT is
not used in the declaration of EFI_SMM_SYSTEM_TABLE2 and field contents
are transferred without any reference to individual field names (e.g.
CurrentlyExecutingCpu).  In order to make the code easier to maintain
and understand, the CopyMem() is replaced with statements that transfer
each field of SMM_ENTRY_CONTEXT into EFI_SMM_SYSTEM_TABLE2.

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

8 years agoUefiCpuPkg/PiSmmCpuDxeSmm: Shouldn't use gSmst->CurrentlyExecutingCpu
Jeff Fan [Mon, 2 Nov 2015 03:04:19 +0000 (03:04 +0000)]
UefiCpuPkg/PiSmmCpuDxeSmm: Shouldn't use gSmst->CurrentlyExecutingCpu

In ConfigSmmCodeAccessCheck(), we used gSmst->CurrentlyExecutingCpu to get the
current SMM BSP. But ConfigSmmCodeAccessCheck() maybe invoked before executing
SmmCoreEntry() and gSmst->CurrentlyExecutingCpu hasn't been updated to the
latest value. The code flow is as below:

  BSPHandler()
    gSmmCpuPrivate->SmmCoreEntryContext.CurrentlyExecutingCpu = CpuIndex;
    //
    // when mRestoreSmmConfigurationInS3 is set:
    //
    ConfigSmmCodeAccessCheck()
      //
      // reads gSmst->CurrentlyExecutingCpu to early
      //
    gSmmCpuPrivate->SmmCoreEntry (&gSmmCpuPrivate->SmmCoreEntryContext)
      //
      // sets gSmst->CurrentlyExecutingCpu with CopyMem() too late
      //
      CopyMem (&gSmmCoreSmst.SmmStartupThisAp,
        SmmEntryContext, sizeof (EFI_SMM_ENTRY_CONTEXT));

Instead, we should use
gSmmCpuPrivate->SmmCoreEntryContext.CurrentlyExecutingCpu directly.

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

8 years agoMdeModulePkg: Add DEBUG statement when reaching max perf log entries
Samer El-Haj-Mahmoud [Mon, 2 Nov 2015 02:38:24 +0000 (02:38 +0000)]
MdeModulePkg: Add DEBUG statement when reaching max perf log entries

Add a DEBUG statement when the number of PEI perf log entries
exceeds PcdMaxPeiPerformanceLogEntries

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18714 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg SmbiosMeasurementDxe: NULL check to String from GetSmbiosStringById
Star Zeng [Mon, 2 Nov 2015 01:42:51 +0000 (01:42 +0000)]
MdeModulePkg SmbiosMeasurementDxe: NULL check to String from GetSmbiosStringById

When StringId is not 0, String returned from GetSmbiosStringById is expected to non-NULL.
Add ASSERT (String != NULL); to ensure this.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Shumin Qiu <shumin.qiu@intel.com>
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: Shumin Qiu <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18713 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoSourceLevelDebugPkg: DebugAgent: Set Local APIC SoftwareEnable
Michael Kinney [Fri, 30 Oct 2015 17:53:53 +0000 (17:53 +0000)]
SourceLevelDebugPkg: DebugAgent: Set Local APIC SoftwareEnable

Update DebugAgent to make sure the Local APIC SoftwareEnable bit is set
before using the Local APIC Timer.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-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@18712 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg: LocalApicLib: Add API to set SoftwareEnable bit
Michael Kinney [Fri, 30 Oct 2015 17:53:31 +0000 (17:53 +0000)]
UefiCpuPkg: LocalApicLib: Add API to set SoftwareEnable bit

The LocalApicLib does not provide a function to manage the state of the
Local APIC SoftwareEnable bit in the Spurious Vector register.  There
are cases where this bit needs to be managed without side effects to.
other Local APIC registers.  One use case is in the DebugAgent in the
SourceLevelDebugPkg.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-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@18711 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg: CpuDxe: Update GDT to be consistent with DxeIplPeim
Michael Kinney [Fri, 30 Oct 2015 17:32:27 +0000 (17:32 +0000)]
UefiCpuPkg: CpuDxe: Update GDT to be consistent with DxeIplPeim

The PiSmmCpuDxeSmm module makes some assumptions about GDT selectors
that are based on the GDT layout from the DxeIplPeim.  For example,
the protected mode entry code and (where appropriate) the long mode
entry code in the UefiCpuPkg/PiSmmCpuDxeSmm/*/MpFuncs.* assembly
files, which are used during S3 resume, open-code segment selector
values that depend on DxeIplPeim's GDT layout.

This updates the CpuDxe module to use the same GDT layout as the
DxeIplPeim.  This enables modules that are dispatched after
CpuDxe to find, and potentially save and restore, a GDT layout that
matches that of DxeIplPeim.  The DxeIplPeim has a 2 GDT entries for
data selectors that are identical.  These are LINEAR_SEL (GDT Offset
0x08)and LINEAR_DATA64_SEL (GDT offset 0x30).  LINEAL_SEL is used for
for IA32 DXE and the LINEAR_DATA64_SEL is used for X64 DXE. This
duplicate data selector was added to the CpuDxe module to keep the
GDT and all selectors consistent.

Using a consistent GDT also improves debug experience.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Analyzed-by: Laszlo Ersek <lersek@redhat.com>
Link: http://article.gmane.org/gmane.comp.bios.edk2.devel/3568
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@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@18710 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg: HttpDxe sometimes free a pointer twice
Nagaraj Hegde [Fri, 30 Oct 2015 06:47:54 +0000 (06:47 +0000)]
NetworkPkg: HttpDxe sometimes free a pointer twice

In EfiHttpRequest, HostName was getting freed twice whenever
HttpTransmitTcp4 failed. Moved FreePool (HostName) after
HttpTransmitTcp4 call to avoid a double free.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Nagaraj Hegde <nagaraj-p.hegde@hpe.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18709 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCryptoPkg/OpensslLib: Move OPENSSL_NO_xxx defines into opensslconf.h
David Woodhouse [Thu, 29 Oct 2015 14:17:31 +0000 (14:17 +0000)]
CryptoPkg/OpensslLib: Move OPENSSL_NO_xxx defines into opensslconf.h

Putting these on the command line as we do at the moment means that they
are *only* visible when actually building the OpenSSL code itself. When
building other things like BaseCryptLib, they were missing. Which could
lead to discrepancies in structures defined by the header files, between
the OpenSSL code and the EDK II code which calls it.

Move the definitions into opensslconf.h where they would normally live
in a standard build of OpenSSL.

Note: Do *not* set OPENSSL_NO_LHASH or OPENSSL_NO_OCSP since those weren't
effectively disabled before; the directories was still being included in
the build. If we actually disable then, the build breaks. We can hopefully
fix at least OCSP upstream later, but one thing at a time...

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

8 years agoCryptoPkg/OpensslLib: Eliminate GETPID_IS_MEANINGLESS definition
David Woodhouse [Thu, 29 Oct 2015 14:17:23 +0000 (14:17 +0000)]
CryptoPkg/OpensslLib: Eliminate GETPID_IS_MEANINGLESS definition

OpenSSL ought to work this out for itself when OPENSSL_SYS_UEFI is set.

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

8 years agoCryptoPkg: Fix OpenSSL BN wordsize and OPENSSL_SYS_UEFI handling
David Woodhouse [Thu, 29 Oct 2015 14:17:15 +0000 (14:17 +0000)]
CryptoPkg: Fix OpenSSL BN wordsize and OPENSSL_SYS_UEFI handling

We were manually setting -DSIXTY_FOUR_BIT_LONG or -DTHIRTY_TWO_BIT on
the compiler command line when building OpensslLib itself, but not when
building BaseCryptLib.

But when building BaseCryptLib, we weren't setting OPENSSL_SYS_UEFI
*either*. This meant that *that* build was picking up the definition
from <openssl/opensslconf.h>, and was thus *different* to the version
the library was built with, in some cases.

So set OPENSSL_SYS_UEFI consistently in OpensslSupport.h and *also*
define either SIXTY_FOUR_BIT or THIRTY_TWO_BIT there too.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18706 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCryptoPkg/OpensslLib: Undefine NO_BUILTIN_VA_FUNCS to fix varargs breakage
David Woodhouse [Thu, 29 Oct 2015 14:17:02 +0000 (14:17 +0000)]
CryptoPkg/OpensslLib: Undefine NO_BUILTIN_VA_FUNCS to fix varargs breakage

Instead of patching OpenSSL to add EFIAPI to the one varargs function we
actually *noticed* breakage in, let's fix the problem in a more coherent
way by undefining NO_BUILTIN_VA_FUNCS.

That way, the VA_START and similar macros will actually do the right
thing for non-EFIAPI functions, which is to use the GCC builtins.

It's still fairly broken elsewhere in the tree, with the VA_START macro
being used from both EFIAPI and non-EFIAPI functions â€” and being broken
in the latter case. We probably ought to make EFIAPI a no-op everywhere
and add -mabi=ms to the GCC builds. But that's a project for another day.
For now, just fix the OpenSSL build in a cleaner fashion.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18705 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCryptoPkg/BaseCryptLib: Use X509_V_FLAG_NO_CHECK_TIME
David Woodhouse [Thu, 29 Oct 2015 14:16:54 +0000 (14:16 +0000)]
CryptoPkg/BaseCryptLib: Use X509_V_FLAG_NO_CHECK_TIME

OpenSSL HEAD is in the process of adding this flag to disable the validity
time checking. Backport it to 1.0.2 and use it too, for consistency.

https://rt.openssl.org/Ticket/Display.html?id=3951&user=guest&pass=guest

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

8 years agoCryptoPkg/BaseCryptLib: Use X509_V_FLAG_PARTIAL_CHAIN
David Woodhouse [Thu, 29 Oct 2015 14:16:45 +0000 (14:16 +0000)]
CryptoPkg/BaseCryptLib: Use X509_V_FLAG_PARTIAL_CHAIN

Since OpenSSL 1.0.2 we can set this flag on the X509_STORE to instruct
OpenSSL to accept non-self-signed certificates as trusted. So we don't
need two entirely identical copies of a verify_cb() function which makes
it ignore the resulting errors.

We also *didn't* use that verify_cb() function for X509VerifyCert(), but
probably should have done. So that can get X509_V_FLAG_PARTIAL_CHAIN for
consistency, too.

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

8 years agoCryptoPkg/BaseCryptLib: Clean up checking of PKCS#7 contents type
David Woodhouse [Thu, 29 Oct 2015 14:16:37 +0000 (14:16 +0000)]
CryptoPkg/BaseCryptLib: Clean up checking of PKCS#7 contents type

Use the new OBJ_get0_data() accessor to compare the data, and actually
check the length of the object too.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18702 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCryptoPkg/BaseCryptLib: Use accessor functions for ASN1_OBJECT
David Woodhouse [Thu, 29 Oct 2015 14:16:30 +0000 (14:16 +0000)]
CryptoPkg/BaseCryptLib: Use accessor functions for ASN1_OBJECT

OpenSSL 1.1 introduces new OBJ_get0_data() and OBJ_length() accessor
functions and makes ASN1_OBJECT an opaque type.

Unlike the accessors in previous commits which *did* actually exist
already but just weren't mandatory, these don't exist in older versions
of OpenSSL. So introduce macros which do the right thing, for
compatibility.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18701 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCryptoPkg/BaseCryptLib: Use accessor functions for X509_ATTRIBUTE
David Woodhouse [Thu, 29 Oct 2015 14:16:22 +0000 (14:16 +0000)]
CryptoPkg/BaseCryptLib: Use accessor functions for X509_ATTRIBUTE

In OpenSSL 1.1, the X509_ATTRIBUTE becomes an opaque structure and we will
no longer get away with accessing its members directly. Use the accessor
functions X509_ATTRIBUTE_get0_object0() and X509_ATTRIBUTE_get0_type()
instead.

Also be slightly more defensive about unlikely failure modes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18700 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCryptoPkg/BaseCryptLib: Use i2d_X509_NAME() instead of abusing X509_NAME
David Woodhouse [Thu, 29 Oct 2015 14:16:15 +0000 (14:16 +0000)]
CryptoPkg/BaseCryptLib: Use i2d_X509_NAME() instead of abusing X509_NAME

In OpenSSL 1.1, the X509_NAME becomes an opaque structure and we will no
longer get away with accessing its members directly. Use i2d_X509_NAME()
instead.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18699 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCryptoPkg/BaseCryptLib: Add missing OpenSSL includes
David Woodhouse [Thu, 29 Oct 2015 14:15:53 +0000 (14:15 +0000)]
CryptoPkg/BaseCryptLib: Add missing OpenSSL includes

OpenSSL 1.1 has cleaned up its include files a little, and it will now
be necessary to directly include things like <openssl/bn.h> if we want
to use them, rather than assuming they are included indirectly from
other headers.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18698 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoEmbeddedPkg: Add EFIAPI to several Ebl functions
Thomas Palmer [Thu, 29 Oct 2015 12:59:06 +0000 (12:59 +0000)]
EmbeddedPkg: Add EFIAPI to several Ebl functions

The EFIAPI function declaration is missing for several functions in the
EmbeddedPkg/Ebl directory. A few function pointer struct members expect
EFIAPI though and GCC46/X64 will fail to compile the directory without
them.

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

8 years agoMdeModulePkg: Do not dump NULL padding resource descriptor
Ruiyu Ni [Thu, 29 Oct 2015 03:26:00 +0000 (03:26 +0000)]
MdeModulePkg: Do not dump NULL padding resource descriptor

Add a check for ResourcePaddingDescriptors being a valid pointer in
DumpPpbPaddingResource() to prevent looping on memory not owned by
PciBusDxe.  The ResourcePaddingDescriptors is initialized to NULL
when the PCI_IO_DEVICE structure is allocated and remains NULL if
no PCI hot plug controllers are present.  This issue is only
observed when DEBUG_CODE() macros are enabled and was introduced
by the following patch:

  [edk2] [Patch] MdeModulePkg: Fix a PciBusDxe hot plug bug
  SVN revsion 18658

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

8 years agoMdeModulePkg SmbiosMeasurementDxe: Correct the comments
Star Zeng [Thu, 29 Oct 2015 01:13:59 +0000 (01:13 +0000)]
MdeModulePkg SmbiosMeasurementDxe: Correct the comments

1. Correct the return comments of entrypoint function.
2. Add parameters' comments for MeasureSmbiosTable().
3. Correct the Protocols and Guids usage comments in SmbiosMeasurementDxe.inf.

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: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18695 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg SmbiosMeasurementDxe: Remove the tailing whitespace
Star Zeng [Thu, 29 Oct 2015 01:13:32 +0000 (01:13 +0000)]
MdeModulePkg SmbiosMeasurementDxe: Remove the tailing whitespace

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: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18694 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg SmbiosMeasurementDxe: Use EFI_D_VERBOSE for internal dump functions
Star Zeng [Thu, 29 Oct 2015 01:13:07 +0000 (01:13 +0000)]
MdeModulePkg SmbiosMeasurementDxe: Use EFI_D_VERBOSE for internal dump functions

Use EFI_D_VERBOSE instead of EFI_D_INFO in InternalDumpData() and InternalDumpHex().
And also add DEBUG_CODE wrapper to InternalDumpHex() call.
It is to avoid the bother from the internal verbose debug information.

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: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18693 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg SmbiosMeasurementDxe: Add (VOID **) typecast for GCC build failure
Star Zeng [Thu, 29 Oct 2015 01:12:43 +0000 (01:12 +0000)]
MdeModulePkg SmbiosMeasurementDxe: Add (VOID **) typecast for GCC build failure

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: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18692 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg SmbiosMeasurementDxe: Use SMBIOS table and GUID correctly
Star Zeng [Thu, 29 Oct 2015 01:10:18 +0000 (01:10 +0000)]
MdeModulePkg SmbiosMeasurementDxe: Use SMBIOS table and GUID correctly

1. Smbios3Table used as SmbiosTable wrongly after SmbiosTable got from configuration table.
2. Use correct VendorGuid and VendorTable to measure.

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: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18691 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg: SmmCpuFeaturesLib: Add MSR_SMM_FEATURE_CONTROL support
Michael Kinney [Wed, 28 Oct 2015 07:16:38 +0000 (07:16 +0000)]
UefiCpuPkg: SmmCpuFeaturesLib: Add MSR_SMM_FEATURE_CONTROL support

Add support for the reading and writing MSR_SMM_FEATURE_CONTROL
through the SmmCpuFeaturesIsSmmRegisterSupported(),
SmmCpuFeaturesGetSmmRegister(), and SmmCpuFeaturesSetSmmRegister()
functions.  This MSR is supported if the Family/Model is 06_3C,
06_45, or 06_46.

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

8 years agoShellPkg: Refine code by initializing local variable and adding ASSERT statement.
Qiu Shumin [Wed, 28 Oct 2015 01:14:34 +0000 (01:14 +0000)]
ShellPkg: Refine code by initializing local variable and adding ASSERT statement.

Add ASSERT statement and initialize local variable to make code more readable.

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

8 years agoMdeModulePkg Variable: Move CacheVariable->InDeletedTransitionPtr NULL pointer check
Star Zeng [Wed, 28 Oct 2015 00:48:43 +0000 (00:48 +0000)]
MdeModulePkg Variable: Move CacheVariable->InDeletedTransitionPtr NULL pointer check

This change is triggered by R18654 "Enhance variable performance by reading from existed memory cache"
that changed the code to use CacheVariable to improve performance.
So the CacheVariable->InDeletedTransitionPtr NULL pointer check needs to be moved to the place before
it is been used.

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

8 years agoPublish FspHob to PEI Hob by default.
Yao, Jiewen [Tue, 27 Oct 2015 23:10:49 +0000 (23:10 +0000)]
Publish FspHob to PEI Hob by default.

because most platforms use such logic.
PcdDataBaseHobGuid GuidHob is excluded because PCD database in FSP is different with the one in PEI.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Ma, Maurice" <maurice.ma@intel.com>
Reviewed-by: "Rangarajan, Ravi P" <ravi.p.rangarajan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18687 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg: PiSmmCpuDxeSmm: Replace PcdSet## with PcdSet##S
Michael Kinney [Tue, 27 Oct 2015 16:15:03 +0000 (16:15 +0000)]
UefiCpuPkg: PiSmmCpuDxeSmm: Replace PcdSet## with PcdSet##S

PcdSet## has no error status returned, then the caller has no idea about
whether the set operation is successful or not.  PcdSet##S were added to
return error status and PcdSet## APIs were put in ifndef
DISABLE_NEW_DEPRECATED_INTERFACES condition.  To adopt PcdSet##S and
further code development with DISABLE_NEW_DEPRECATED_INTERFACES defined,
we need to Replace PcdSet## usage with PcdSet##S.

Normally, DynamicDefault PCD set is expected to be success, but DynamicHii
PCD set failure is a legal case.  So for DynamicDefault, we add assert
when set failure. For DynamicHii, we add logic to handle it.

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

8 years agoMdePkg/BaseSynchronizationLib: fix AArch64 return values
Haojian Zhuang [Tue, 27 Oct 2015 11:56:57 +0000 (11:56 +0000)]
MdePkg/BaseSynchronizationLib: fix AArch64 return values

Fix the wrong return value of both InternalSyncIncrement()
and InternalSyncDecrement(). The return value shouldn't
be the address of input parameter. It should be the updated
value of input parameter instead.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Reviewed-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@18685 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg:Add new API HiiGetFormSetFromHiiHandle into UefiHiiLib
Dandan Bi [Tue, 27 Oct 2015 10:19:29 +0000 (10:19 +0000)]
MdeModulePkg:Add new API HiiGetFormSetFromHiiHandle into UefiHiiLib

This function is mainly through the Hii handle to get the formset opcode.

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

8 years agoVlv2TbltDevicePkg: Sync the branch changes to trunk.
Tim He [Tue, 27 Oct 2015 07:44:24 +0000 (07:44 +0000)]
Vlv2TbltDevicePkg: Sync the branch changes to trunk.

update some smbios string and macro name for MinnowBoard
Turbot board.

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

8 years agoMdeModulePkg SetupBrowserDxe: Save global variable values before nest function called.
Eric Dong [Tue, 27 Oct 2015 07:37:56 +0000 (07:37 +0000)]
MdeModulePkg SetupBrowserDxe: Save global variable values before nest function called.

The SendForm function can be called nest in it. This function also uses some global variables. So we must save global variable values before it been called again.

Checked in the missing change for gBrowserFormSetList.

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

8 years agoMove Smbios measurement from TCG driver to Smbios driver.
Yao, Jiewen [Tue, 27 Oct 2015 04:46:50 +0000 (04:46 +0000)]
Move Smbios measurement from TCG driver to Smbios driver.

This is patch to add smbios measurement.

The problem of current SMBIOS measurement is:
1) TCG drivers do not support SMBIOS3.0 table.
2) TCG drivers do not follow TCG platform spec on: "Platform configuration information that is automatically updated,
 such as clock registers, and system unique information, such as asset numbers or serial numbers,
 MUST NOT be measured into PCR [1], or any other PCR."

So we decide to move Smbios measurement from TCG drivers to Smbios driver.

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

8 years agoFix issue that calling GetS3MemoryInfo() with wrong order.
Yao, Jiewen [Tue, 27 Oct 2015 04:15:39 +0000 (04:15 +0000)]
Fix issue that calling GetS3MemoryInfo() with wrong order.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Ma, Maurice" <maurice.ma@intel.com>
Reviewed-by: "Rangarajan, Ravi P" <ravi.p.rangarajan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18679 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoDo not deadloop if Microcode not found in FspTempRamInit.
Yao, Jiewen [Tue, 27 Oct 2015 04:00:08 +0000 (04:00 +0000)]
Do not deadloop if Microcode not found in FspTempRamInit.

We do not consider microcode not found as critical error, because Microcode might be applied later.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Ma, Maurice" <maurice.ma@intel.com>
Reviewed-by: "Rangarajan, Ravi P" <ravi.p.rangarajan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18678 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMove Smbios measurement from TCG driver to Smbios driver.
Yao, Jiewen [Tue, 27 Oct 2015 03:54:08 +0000 (03:54 +0000)]
Move Smbios measurement from TCG driver to Smbios driver.

This is patch to remove smbios measurement in TCG driver. There will be other patch to add it in Smbios driver.

The problem of current SMBIOS measurement is:
1) TCG drivers do not support SMBIOS3.0 table.
2) TCG drivers do not follow TCG platform spec on: "Platform configuration information that is automatically updated,
 such as clock registers, and system unique information, such as asset numbers or serial numbers,
 MUST NOT be measured into PCR [1], or any other PCR."

So we decide to move Smbios measurement from TCG drivers to Smbios driver.

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

8 years agoAdd suppressif around TCG hash seleciton checkbox in TCG2
Yao, Jiewen [Tue, 27 Oct 2015 03:49:31 +0000 (03:49 +0000)]
Add suppressif around TCG hash seleciton checkbox in TCG2

Previous TCG2 configuration UI always add all TCG defined hash algorithm to let user select which one need be used.
This brings risk that user might select unsupported hash, and selection is rejected later.
So we enhance to UI to hide unsupported hash algorithm.

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

8 years agoBaseTools:remove the redundant directories for '-f' with absolute path.
Yonghong Zhu [Tue, 27 Oct 2015 03:29:50 +0000 (03:29 +0000)]
BaseTools:remove the redundant directories for '-f' with absolute path.

when the absolute path is given to '-f', it would create some redundant
empty directories.

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

8 years agoMove Smbios table MAX length definition to Mde header filer.
Yao, Jiewen [Tue, 27 Oct 2015 02:43:39 +0000 (02:43 +0000)]
Move Smbios table MAX length definition to Mde header filer.

So that other module can also refer to them.

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

8 years agoUefiCpuPkg: PiSmmCpuDxeSmm: Remove unused references to SmmLib
Michael Kinney [Mon, 26 Oct 2015 16:40:52 +0000 (16:40 +0000)]
UefiCpuPkg: PiSmmCpuDxeSmm: Remove unused references to SmmLib

The PiSmmCpuDxeSmm module does not use any services from the SmmLib.
This change removes the SmmLib from PiSmmCpuDxeSmm module and also
removes the lib mapping in the UefiCpuPkg DSC file because no other
modules in the UefiCpuPkg use the SmmLib.

Removal of SmmLib is now possible because the only API call to it,
ClearSmi(), was ultimately removed from PiSmmCpuDxeSmm -- see the
"BUGBUG" comment in git commit 529a5a86.

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

8 years agoOvmfPkg: QemuFlashFvbServicesRuntimeDxe: clean up includes and libraries
Laszlo Ersek [Mon, 26 Oct 2015 14:58:46 +0000 (14:58 +0000)]
OvmfPkg: QemuFlashFvbServicesRuntimeDxe: clean up includes and libraries

Before introducing the SMM driver interface, clean up #include directives
and [LibraryClasses] by:
- removing what's not directly used (HobLib and UefiLib),
- adding what's used but not spelled out (DevicePathLib),
- sorting the result.

This helps with seeing each source file's dependencies and with
determining the library classes for the SMM driver.

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

8 years agoOvmfPkg: QemuFlashFvbServicesRuntimeDxe: split out runtime DXE specifics
Laszlo Ersek [Mon, 26 Oct 2015 14:58:39 +0000 (14:58 +0000)]
OvmfPkg: QemuFlashFvbServicesRuntimeDxe: split out runtime DXE specifics

In preparation for introducing an SMM interface to this driver, move the
following traits to separate files, so that we can replace them in the new
SMM INF file:

- Protocol installations. The SMM driver will install protocol interfaces
  in the SMM protocol database, using SMM services.

- Virtual address change handler and pointer conversions. SMM drivers run
  with physical mappings and pointers must not be converted.

There are further restrictions and changes for an SMM driver, but the rest
of the code either complies with those already, or will handle the changes
transparently. For example:

- SMM drivers have access to both UEFI and SMM protocols in their entry
  points (see the PI spec 1.4, "1.7 SMM Driver Initialization"),

- MemoryAllocationLib has an SMM instance that serves allocation requests
  with the gSmst->SmmAllocatePool() service transparently, allocating
  runtime-marked SMRAM.

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

8 years agoOvmfPkg: QemuFlashFvbServicesRuntimeDxe: no dual addressing needed
Laszlo Ersek [Mon, 26 Oct 2015 14:58:33 +0000 (14:58 +0000)]
OvmfPkg: QemuFlashFvbServicesRuntimeDxe: no dual addressing needed

Currently the EFI_FW_VOL_INSTANCE and ESAL_FWB_GLOBAL structures declare
the following entries as arrays, with two entries each:

- EFI_FW_VOL_INSTANCE.FvBase[2]
- ESAL_FWB_GLOBAL.FvInstance[2]

In every case, the entry at subscript zero is meant as "physical address",
while the entry at subscript one is meant as "virtual address" -- a
pointer to the same object. The virtual address entry is originally
initialized to the physical address, and then it is converted to the
virtual mapping in FvbVirtualddressChangeEvent().

Functions that (a) read the listed fields and (b) run both before and
after the virtual address change event -- since this is a runtime DXE
driver -- derive the correct array subscript by calling the
EfiGoneVirtual() function from UefiRuntimeLib.

The problem with the above infrastructure is that it's entirely
superfluous.

EfiGoneVirtual() "knows" whether EFI has gone virtual only because the
UefiRuntimeLib constructor registers the exact same kind of virtual
address change callback, and the callback flips a static variabe to TRUE,
and EfiGoneVirtual() queries that static variable.

In effect this means for QemuFlashFvbServicesRuntimeDxe: "when there is a
virtual address change, convert the entries with subscript one from
physical to virtual, and from then on use the entries with subscript one".

This would only make sense if QemuFlashFvbServicesRuntimeDxe ever needed
the original (physical) addresses (ie. the entries with subscript zero)
after the virtual address change, but that is not the case.

Replace the arrays with single elements. The subscript zero elements
simply disappear, and the single elements take the role of the prior
subscript one elements.

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

8 years agoOvmfPkg: QemuFlashFvbServicesRuntimeDxe: remove FvbScratchSpace field
Laszlo Ersek [Mon, 26 Oct 2015 14:58:26 +0000 (14:58 +0000)]
OvmfPkg: QemuFlashFvbServicesRuntimeDxe: remove FvbScratchSpace field

The ESAL_FWB_GLOBAL.FvbScratchSpace array is never initialized (it
contains garbage from AllocateRuntimePool()). Its element at subscript one
(=FVB_VIRTUAL), containing garbage as well, is converted to virtual
mapping. Then the array is never used again.

Remove it.

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

8 years agoOvmfPkg: QemuFlashFvbServicesRuntimeDxe: remove FvbDevLock field
Laszlo Ersek [Mon, 26 Oct 2015 14:58:20 +0000 (14:58 +0000)]
OvmfPkg: QemuFlashFvbServicesRuntimeDxe: remove FvbDevLock field

The EFI_FW_VOL_INSTANCE.FvbDevLock member is initialized and then never
used. Remove it.

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

8 years agoOvmfPkg: QemuFlashFvbServicesRuntimeDxe: fix VALID_ARCHITECTURES in INF
Laszlo Ersek [Mon, 26 Oct 2015 14:58:14 +0000 (14:58 +0000)]
OvmfPkg: QemuFlashFvbServicesRuntimeDxe: fix VALID_ARCHITECTURES in INF

We build this driver for X64 as well -- the comment isn't overly
important, but it shouldn't be misleading.

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

8 years agoOvmfPkg: QemuFlashFvbServicesRuntimeDxe: rewrap source code to 79 chars
Laszlo Ersek [Mon, 26 Oct 2015 14:58:08 +0000 (14:58 +0000)]
OvmfPkg: QemuFlashFvbServicesRuntimeDxe: rewrap source code to 79 chars

Some of the line lengths in this driver are atrocious. While we have to
put up with the status quo outside of OvmfPkg, we can at least rewrap this
driver before refactoring it.

In the FvbInitialize() function there's no way around introducing two
local variables, just for the sake of sensibly rewrapping the code.

Furthermore, in "FwBlockService.c" the function comment blocks are now
indented; their original position causes diff to print bogus function
names at the top of hunks.

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

8 years agoOvmfPkg: QemuFlashFvbServicesRuntimeDxe: strip trailing whitespace
Laszlo Ersek [Mon, 26 Oct 2015 14:58:01 +0000 (14:58 +0000)]
OvmfPkg: QemuFlashFvbServicesRuntimeDxe: strip trailing whitespace

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

8 years agoShellPkg: Fix 'EfiShellExecute' doesn't get command status correctly.
Qiu Shumin [Mon, 26 Oct 2015 13:28:01 +0000 (13:28 +0000)]
ShellPkg: Fix 'EfiShellExecute' doesn't get command status correctly.

1. Add a new  function 'RunShellCommand' to return command status, thus 'EfiShellExecute' can get the command return status of 'CommandLine'.
2. Refine the code logic of 'EfiShellExecute' to make the new image of shell be loaded only if  'Environment' isn't NULL.

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

8 years agoBaseTools: Add MultipleWorkspace.py in the common dependency.
Liming Gao [Mon, 26 Oct 2015 08:48:39 +0000 (08:48 +0000)]
BaseTools: Add MultipleWorkspace.py in the common dependency.

Add new added MultipleWorkspace.py in the common dependency to freeze
python tools for Windows.

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

8 years agoMdeModulePkg: Make the BmFindLoadOption function public
Sunny Wang [Mon, 26 Oct 2015 04:49:08 +0000 (04:49 +0000)]
MdeModulePkg: Make the BmFindLoadOption function public

Make the BmFindLoadOption function public

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Sunny Wang <sunnywang@hpe.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18662 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools:added extern protocol/PPI/GUID definition in AutoGen for Library
Yonghong Zhu [Mon, 26 Oct 2015 03:26:55 +0000 (03:26 +0000)]
BaseTools:added extern protocol/PPI/GUID definition in AutoGen for Library

We already added the extern declaration for protocols/PPI/GUID in AutoGen.h
file for driver, but missing this feature for the Library. so this patch
add it.

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

8 years agoMdePkg BaseExtractGuidedSectionLib: R15917 removed useful information wrongly
Star Zeng [Mon, 26 Oct 2015 02:00:58 +0000 (02:00 +0000)]
MdePkg BaseExtractGuidedSectionLib: R15917 removed useful information wrongly

As the title, this patch is to add back the useful information.

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

8 years agoShellPkg: Update 'tftp' command help output and error messages
Tapan Shah [Fri, 23 Oct 2015 20:13:44 +0000 (20:13 +0000)]
ShellPkg: Update 'tftp' command help output and error messages

Changing 'tftp' command's help output .uni file to match other EDK2 Shell commands as well as adjusting error messages text.

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

8 years agoMdeModulePkg: Fix a PciBusDxe hot plug bug
Ruiyu Ni [Fri, 23 Oct 2015 08:29:38 +0000 (08:29 +0000)]
MdeModulePkg: Fix a PciBusDxe hot plug bug

For a hot plug bridge with device attached, PciBusDxe driver reserves
the resources which equal to the total amount of padding resource
returned from HotPlug->GetResourcePadding() and the actual occupied
resource by the attached device. The behavior is incorrect.
Correct behavior is to reserve the bigger one between the padding
resource and the actual occupied resource.

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

8 years agoMdeModulePkg: Update UiApp to not display itself
Ruiyu Ni [Fri, 23 Oct 2015 07:28:18 +0000 (07:28 +0000)]
MdeModulePkg: Update UiApp to not display itself

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

8 years agoMdeModulePkg: Update BootManagerMenuApp to not display itself
Ruiyu Ni [Fri, 23 Oct 2015 07:26:58 +0000 (07:26 +0000)]
MdeModulePkg: Update BootManagerMenuApp to not display itself

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

8 years agoMdePkg: Add a new DxeServicesLib GetFileDevicePathFromAnyFv () function
Shia Cinnamon [Fri, 23 Oct 2015 05:53:08 +0000 (05:53 +0000)]
MdePkg: Add a new DxeServicesLib GetFileDevicePathFromAnyFv () function

Contributed-under: TianoCore Contribution Agreement 1.0
From: Shia Cinnamon <cinnamon.shia@hpe.com>
Signed-off-by: Wang Nickle <nickle.wang@hpe.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18655 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg Variable: Enhance variable performance by reading from existed memory...
Derek Lin [Fri, 23 Oct 2015 05:28:38 +0000 (05:28 +0000)]
MdeModulePkg Variable: Enhance variable performance by reading from existed memory cache.

Current variable driver already have memory cache to improve performance.
Change the code which read from physical MMIO address to read from memory cache.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Derek Lin <derek.lin2@hpe.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18654 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Follow spec to remove the last '\' char in return name of GetCurDir().
Qiu Shumin [Fri, 23 Oct 2015 02:03:20 +0000 (02:03 +0000)]
ShellPkg: Follow spec to remove the last '\' char in return name of GetCurDir().

In Shell spec 2.1 the return name of EFI_SHELL_PROTOCOL.GetCurDir() is defined as 'fs0:\current-dir' while in current implementation it's 'fs0:\current-dir\'.
To follow spec the patch removed the redundant '\' char.

Since it has been broken for a long time, some codes may depend on the broken behavior.
After this change 'EFI_SHELL_PROTOCOL.GetCurDir()' and 'UefiShellLib.ShellGetCurrentDir()'
will return a current directory string without tailing '\' (fs0:\current-dir), the value of Shell environment variable 'cwd' will become 'fs0:\current-dir' as well.

This patch has updated all the code in EDKII to make them depend on the new behavior.
Developers should check whether 'GetCurDir()' and 'ShellGetCurrentDir' are used in their source 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>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18653 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools/Scripts: Add PatchCheck.py script
Jordan Justen [Thu, 22 Oct 2015 06:01:02 +0000 (06:01 +0000)]
BaseTools/Scripts: Add PatchCheck.py script

This script can be used to check some expected rules for EDK II
patches. It only works on git formatted patches.

It checks both the commit message and the lines that are added in the
patch diff.

In the commit message it verifies line lengths, signature formats, and
the Contributed-under tag.

In the patch, it checks that line endings are CRLF for all files that
don't have a .sh extension. It verifies that no trailing whitespace is
present and that tab characters are not used.

Patch contributors should use this script prior to submitting their
patches. Package maintainers can also use it to verify incoming
patches.

It can also be run by specifying a git revision list, so actual patch
files are not always required.

For example, to checkout this last 5 patches in your git branch you
can run:

  python PatchCheck.py HEAD~5..

Or, a shortcut (like git log):

  python PatchCheck.py -5

The --oneline option works similar to git log --oneline.

The --silent option enables silent operation.

The script supports python 2.7 and python 3.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18652 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg: XenPvBlkDxe: handle empty cdrom drives
Stefano Stabellini [Wed, 21 Oct 2015 12:44:12 +0000 (12:44 +0000)]
OvmfPkg: XenPvBlkDxe: handle empty cdrom drives

Empty cdroms are not going to connect, avoid waiting for the backend to
switch to state 4, which is never going to happen, and return
error instead from XenPvBlockFrontInitialization(). Detect an
empty cdrom by looking at the "params" node on xenstore, which is set to
"" or "aio:" for empty drives by libxl.

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

8 years agoMdeModulePkg SetupBrowserDxe: Save global variable values before nest function called.
Eric Dong [Wed, 21 Oct 2015 06:10:57 +0000 (06:10 +0000)]
MdeModulePkg SetupBrowserDxe: Save global variable values before nest function called.

The SendForm function can be called nest in it. This function also uses some global variables. So we must save global variable values before it been called again.

Old implementation miss to save some global variables, this patch fixed it.

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

8 years agoAppPkg: Add switch to cause stderr to be aliased to stdout.
Daryl McDaniel [Mon, 19 Oct 2015 21:39:46 +0000 (21:39 +0000)]
AppPkg: Add switch to cause stderr to be aliased to stdout.

Python, as distributed, sends its prompts and other interactive output
to stderr, which uses the platforms STDERR device for output.  If STDERR output
is not visible, it may appear that Python has hung.  Several people have
reported problems on platforms that don't enable STDERR.  These include
platforms without a Setup utility and those without Setup options for STDERR.

This patch adds a command-line switch, -#, to Python.  If this switch
is present, stderr will be aliased to stdout.

AppPkg/Applications/Python/PyMod-2.7.2/Modules/main.c:  New file, modified
version of AppPkg/Applications/Python/Python-2.7.2/Modules/main.c.  Add the -#
option which causes stderr to be aliased to stdout.  Add a description of this
switch to the Help output.

AppPkg/Applications/Python/PythonCore.inf:  Reference main.c from PyMod-2.7.2
instead of from Python-2.7.2 so that the modified version is used.

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

8 years agoUefiCpuPkg: Add PiSmmCpuDxeSmm module to DSC file
Michael Kinney [Mon, 19 Oct 2015 19:13:45 +0000 (19:13 +0000)]
UefiCpuPkg: Add PiSmmCpuDxeSmm module to DSC file

Add the PiSmmCpuDxeSmm module to the UefiCpuPkg DSC file along
with this modules dependent libraries.

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

8 years agoUefiCpuPkg: Add PiSmmCpuDxeSmm module X64 files
Michael Kinney [Mon, 19 Oct 2015 19:13:31 +0000 (19:13 +0000)]
UefiCpuPkg: Add PiSmmCpuDxeSmm module X64 files

Add module that initializes a CPU for the SMM environment and
installs the first level SMI handler.  This module along with the
SMM IPL and SMM Core provide the services required for
DXE_SMM_DRIVERS to register hardware and software SMI handlers.

CPU specific features are abstracted through the SmmCpuFeaturesLib

Platform specific features are abstracted through the
SmmCpuPlatformHookLib

Several PCDs are added to enable/disable features and configure
settings for the PiSmmCpuDxeSmm module

[jeff.fan@intel.com: Fix code style issues reported by ECC]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18647 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg: Add PiSmmCpuDxeSmm module IA32 files
Michael Kinney [Mon, 19 Oct 2015 19:13:13 +0000 (19:13 +0000)]
UefiCpuPkg: Add PiSmmCpuDxeSmm module IA32 files

Add module that initializes a CPU for the SMM environment and
installs the first level SMI handler.  This module along with the
SMM IPL and SMM Core provide the services required for
DXE_SMM_DRIVERS to register hardware and software SMI handlers.

CPU specific features are abstracted through the SmmCpuFeaturesLib

Platform specific features are abstracted through the
SmmCpuPlatformHookLib

Several PCDs are added to enable/disable features and configure
settings for the PiSmmCpuDxeSmm module

[jeff.fan@intel.com: Fix code style issues reported by ECC]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18646 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg: Add PiSmmCpuDxeSmm module no IA32/X64 files
Michael Kinney [Mon, 19 Oct 2015 19:12:53 +0000 (19:12 +0000)]
UefiCpuPkg: Add PiSmmCpuDxeSmm module no IA32/X64 files

Add module that initializes a CPU for the SMM environment and
installs the first level SMI handler.  This module along with the
SMM IPL and SMM Core provide the services required for
DXE_SMM_DRIVERS to register hardware and software SMI handlers.

CPU specific features are abstracted through the SmmCpuFeaturesLib

Platform specific features are abstracted through the
SmmCpuPlatformHookLib

Several PCDs are added to enable/disable features and configure
settings for the PiSmmCpuDxeSmm module

Changes between [PATCH v1] and [PATCH v2]:
1) Swap PTE init order for QEMU compatibility.
   Current PTE initialization algorithm works on HW but breaks QEMU
   emulator.  Update the PTE initialization order to be compatible
   with both.
2) Update comment block that describes 32KB SMBASE alignment requirement
   to match contents of Intel(R) 64 and IA-32 Architectures Software
   Developer's Manual
3) Remove BUGBUG comment and call to ClearSmi() that is not required.
   SMI should be cleared by root SMI handler.

[jeff.fan@intel.com: Fix code style issues reported by ECC]

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
[pbonzini@redhat.com: InitPaging: prepare PT before filling in PDE]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18645 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg: Update DEC/DSC files for new includes and libraries
Michael Kinney [Mon, 19 Oct 2015 19:12:32 +0000 (19:12 +0000)]
UefiCpuPkg: Update DEC/DSC files for new includes and libraries

Add SmmCpuPlatformHookLib library class declaration
Add SmmCpuFeaturesLib library class declaration
Add gEfiSmmCpuServiceProtocolGuid protocol declaration
Build SmmCpuPlatformHookLibNull library instance
Build SmmCpuFeaturesLib library instance

Changes between [PATCH v1] and [PATCH v2]:
1) Use module type specific CpuExceptionHandlerLib in DSC file
   instead of Null library instance

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

8 years agoUefiCpuPkg: Add CPU Hot Plug Data include file
Michael Kinney [Mon, 19 Oct 2015 19:12:18 +0000 (19:12 +0000)]
UefiCpuPkg: Add CPU Hot Plug Data include file

Add CpuHotPlugData.h that defines a data structure that is shared between
modules and is required for to support hot plug CPUs.

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

8 years agoUefiCpuPkg: Add ACPI CPU Data include file
Michael Kinney [Mon, 19 Oct 2015 19:12:04 +0000 (19:12 +0000)]
UefiCpuPkg: Add ACPI CPU Data include file

Add AcpuCpuData.h that defines a data structure that is shared between
modules and is required for ACPI S3 support.
APState field removed between V1 and V2 patch.

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

8 years agoUefiCpuPkg: Add SMRAM Save State include file
Michael Kinney [Mon, 19 Oct 2015 19:11:49 +0000 (19:11 +0000)]
UefiCpuPkg: Add SMRAM Save State include file

Add SmramSaveStateMap.h file that defines the 32-bit and 64-bit CPU
SMRAM Save State Map.

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

8 years agoUefiCpuPkg: Add SMM CPU Service Protocol
Michael Kinney [Mon, 19 Oct 2015 19:11:32 +0000 (19:11 +0000)]
UefiCpuPkg: Add SMM CPU Service Protocol

Add definition of the SMM CPU Service Protocol that is produced by
the PiSmmCpuDxeSmm module.

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

8 years agoUefiCpuPkg: Add SmmCpuPlatformHookLib
Michael Kinney [Mon, 19 Oct 2015 19:11:15 +0000 (19:11 +0000)]
UefiCpuPkg: Add SmmCpuPlatformHookLib

Add SmmCpuPlatformHookLib that provides platform specific functions
that are used to initialize SMM and process SMIs.  A Null instance
of this library is provided that should work for most platforms.

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

8 years agoUefiCpuPkg: Add SmmCpuFeaturesLib
Michael Kinney [Mon, 19 Oct 2015 19:10:53 +0000 (19:10 +0000)]
UefiCpuPkg: Add SmmCpuFeaturesLib

Add SmmCpuFeaturesLib that provides CPU specific functions that are
used to initialize SMM and process SMIs.  A functional implementation
of this library class is provided that is based on the
Intel(R) 64 and IA-32 Architectures Software Developer's Manual

[jeff.fan@intel.com: Fix code style issues reported by ECC]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18638 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg: Add SecCore module and supporting library class and PCD
Michael Kinney [Mon, 19 Oct 2015 19:10:32 +0000 (19:10 +0000)]
UefiCpuPkg: Add SecCore module and supporting library class and PCD

Add declaration of PlatformSecLib library class to DEC file
Add declaration of PcdPeiTemporaryRamStackSize PCD to DEC/UNI file
Add build of PlatformSecLibNull to DSC file
Add build of SecCore to DSC file

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

8 years agoUefiCpuPkg: Add SecCore module
Michael Kinney [Mon, 19 Oct 2015 19:10:14 +0000 (19:10 +0000)]
UefiCpuPkg: Add SecCore module

Add SecCore module that uses the PlatformSecLib class for platform
specific actions.  The SecCore module also uses a new PCD to
configure the size of the stack used in the SEC phase.  If the
stack size PCD is set to 0, the stack is configured to use half
of the available temporary RAM.

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

8 years agoUefiCpuPkg: Add PlatformSecLib
Michael Kinney [Mon, 19 Oct 2015 19:09:56 +0000 (19:09 +0000)]
UefiCpuPkg: Add PlatformSecLib

Add PlatformSecLib class and PlatformSecLibNull instance
that is used by the SecCore.  PlatformSecLibNull should
not be used in a platform build.  Instead, it should be
used as a template for implementing a platform specific
instance of the PlatformSecLib library class.

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