]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
8 years agoMdeModulePkg: Add Bm prefix for internal functions
Ruiyu Ni [Tue, 17 Nov 2015 10:07:43 +0000 (10:07 +0000)]
MdeModulePkg: Add Bm prefix for internal functions

Change VARIABLE_VISITOR to BM_VARIABLE_VISITOR
Change ForEachVariable to BmForEachVariable

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

8 years agoMdePkg: Add Platform Recovery definitions.
Ruiyu Ni [Tue, 17 Nov 2015 10:06:44 +0000 (10:06 +0000)]
MdePkg: Add Platform Recovery definitions.

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

8 years agoBaseTools/toolsetup.bat: fixed the error when the path contains space
Yonghong Zhu [Tue, 17 Nov 2015 07:45:04 +0000 (07:45 +0000)]
BaseTools/toolsetup.bat: fixed the error when the path contains space

when the path contains space, it will report error for PATH Environment
update.

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

8 years agoBaseTools: Fix two warning reported in the make phase.
Yonghong Zhu [Tue, 17 Nov 2015 07:40:00 +0000 (07:40 +0000)]
BaseTools: Fix two warning reported in the make phase.

when we make BaseTools, it report warnings about VfrError.cpp and VolInfo,
so this patch fix this warning.

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

8 years agoMdeModulePkg: SmmLockBoxPeiLib: work without EFI_PEI_SMM_COMMUNICATION_PPI
Laszlo Ersek [Mon, 16 Nov 2015 18:29:14 +0000 (18:29 +0000)]
MdeModulePkg: SmmLockBoxPeiLib: work without EFI_PEI_SMM_COMMUNICATION_PPI

The RestoreLockBox() and RestoreAllLockBoxInPlace() functions handle the
case when EFI_PEI_SMM_COMMUNICATION_PPI.Communicate() returns
EFI_NOT_STARTED: they access the SMRAM directly, for restoring LockBox
data.

This occurs if a PEIM needs to restore LockBox data *before* the SMBASE is
relocated and the SMI handler is installed for all processors.

One such PEIM is UefiCpuPkg/Universal/Acpi/S3Resume2Pei. On the S3 resume
path, in function S3RestoreConfig2(), LockBox data are restored *before*
the SmmRestoreCpu() function of UefiCpuPkg/PiSmmCpuDxeSmm is called via
SmmS3ResumeState->SmmS3ResumeEntryPoint. (The latter SmmRestoreCpu()
function is responsible for the SMBASE relocation.)

If a platform knows that its PEIMs restore LockBox data *only* before
SMBASE relocation -- e.g., due to S3Resume2Pei being the platform's only
SmmLockBoxPeiLib client --, then the platform might not want to include
"UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.inf" at all (hence
not provide EFI_PEI_SMM_COMMUNICATION_PPI) -- because all of those
restores would be serviced by direct SMRAM access anyway.

Currently the absence of EFI_PEI_SMM_COMMUNICATION_PPI is not supported by
SmmLockBoxPeiLib, but it's not hard to implement. Handle it the same as
when EFI_PEI_SMM_COMMUNICATION_PPI.Communicate() returns EFI_NOT_STARTED:
restore LockBox data directly from SMRAM.

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

8 years agoNetworkPkg: Httpboot will fail the 2nd time result by wrong TCP state.
Zhang Lubo [Fri, 13 Nov 2015 09:35:54 +0000 (09:35 +0000)]
NetworkPkg: Httpboot will fail the 2nd time result by wrong TCP state.

If the 2nd boot quickly after the first succeed boot, it will function well.
But if you wait for some time after 1nd succeed boot and boot again, the
TCP state may change from established to closed wait as the http server send
fin flag, then boot fail occurred.

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

8 years agoUpdate SPCR table definition per SPCR specification v1.03.
Heyi Guo [Fri, 13 Nov 2015 03:27:54 +0000 (03:27 +0000)]
Update SPCR table definition per SPCR specification v1.03.

Document link:
http://msdn.microsoft.com/en-us/library/windows/hardware/dn639132(v=vs.85).aspx

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Heyi Guo" <heyi.guo@linaro.org>
Reviewed-by: "Jiewen Yao" <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18782 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg PeiCore: PEI dispatcher need retry to process NOT_DISPATCHED FV
Star Zeng [Fri, 13 Nov 2015 02:43:37 +0000 (02:43 +0000)]
MdeModulePkg PeiCore: PEI dispatcher need retry to process NOT_DISPATCHED FV

A corner case like below will cause a NOT_DISPATCHED FV has no opportunity to
be dispatched.
  1. FV_RECOVERY has SecCore, PeiCore and some other PEI modules, a module will
    report FVMAIN_COMPACT and FV_RECOVERY2 in sequence.
  2. FVMAIN_COMPACT has a FV image file with GUIDED FV image section in it.
  3. FV_RECOVERY2 has DxeIpl and other PEI modules, the DxeIpl will install
     SectionExtractionPpi
  If ALL the PEIMs in FV_RECOVERY and FV_RECOVERY2 have DEPEX satisfied and
  executed in one loop, PeimNeedingDispatch will be always FALSE, FVMAIN_COMPACT
  will have no opportunity to be decompressed and dispatched as DxeIpl executes
  after the first processing to FVMAIN_COMPACT.

The patch is to set PeimNeedingDispatch to TRUE when ProcessFvFile() not successfully,
then the NOT_DISPATCHED FV could have another opportunity to be processed.

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

8 years agoVlv2TbltDevicePkg: Sync the branch changes to Trunk,
Shifei Lu [Fri, 13 Nov 2015 02:38:08 +0000 (02:38 +0000)]
Vlv2TbltDevicePkg: Sync the branch changes to Trunk,

Add Microcode, and Change Flash size from 3M to 4M.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Shifei Lu <shifeix.a.lu@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18780 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/ArmLib: mark all cached mappings as (inner) shareable
Ard Biesheuvel [Thu, 12 Nov 2015 11:40:57 +0000 (11:40 +0000)]
ArmPkg/ArmLib: mark all cached mappings as (inner) shareable

Mark all cached memory mappings as shareable (or inner shareable on
AArch64) so that our view of memory is kept coherent by the hardware.

This is relevant for things like coherent DMA and virtualization (where
a guest may migrate to another core) but in general, since UEFI on ARM
is mostly used in a context where the secure firmware and possibly a
secure OS are already up and running, it is best to refrain from using
any non-shareable mappings.

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

8 years agoVlv2TbltDevicePkg: Sync the branch changes to Trunk,
Tim He [Thu, 12 Nov 2015 08:33:12 +0000 (08:33 +0000)]
Vlv2TbltDevicePkg: Sync the branch changes to Trunk,

Add 'yL' build option to enable SPI lock for MinnowBoard Max.

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

8 years agoArmPlatformPkg: bring DS-5 scripts in line with linker script changes
Ard Biesheuvel [Thu, 12 Nov 2015 07:29:21 +0000 (07:29 +0000)]
ArmPlatformPkg: bring DS-5 scripts in line with linker script changes

The ARM and AARCH64 linker scripts have recently been updated so that
the memory layouts of the ELF and PE/COFF versions of each module are
identical. In particular, this means that the ELF images now have a
hole before the first section rather than starting at offset 0x0, which
means we no longer have to correct for this difference when loading the
ELF image into the debugger.

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

8 years agoMdeModulePkg/BmpImageDecoderLib: Support ImageFormatUnknown type
Ruiyu Ni [Thu, 12 Nov 2015 07:14:40 +0000 (07:14 +0000)]
MdeModulePkg/BmpImageDecoderLib: Support ImageFormatUnknown type

Enhance the library to handle unknown image format.

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

8 years agoNt32Pkg: Use BootLogoLib for logo and progress bar drawing.
Ruiyu Ni [Thu, 12 Nov 2015 05:39:39 +0000 (05:39 +0000)]
Nt32Pkg: Use BootLogoLib for logo and progress bar drawing.

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

8 years agoMdeModulePkg: Add BootLogoLib to provide interfaces about logo display.
Ruiyu Ni [Thu, 12 Nov 2015 05:23:25 +0000 (05:23 +0000)]
MdeModulePkg: Add BootLogoLib to provide interfaces about logo display.

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

8 years agoMdeModulePkg: Add BmpImageDecoderLib to provide BMP decoding capability
Ruiyu Ni [Thu, 12 Nov 2015 05:22:21 +0000 (05:22 +0000)]
MdeModulePkg: Add BmpImageDecoderLib to provide BMP decoding capability

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

8 years agoMdeModulePkg: Add ImageDecoderLib to provide image decoding service.
Ruiyu Ni [Thu, 12 Nov 2015 05:21:38 +0000 (05:21 +0000)]
MdeModulePkg: Add ImageDecoderLib to provide image decoding service.

The library itself doesn't provide any image decoding capabilities but
manages the different image decoders.

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

8 years agoMdeModulePkg: Add PlatformLogo protocol definition.
Ruiyu Ni [Thu, 12 Nov 2015 05:19:22 +0000 (05:19 +0000)]
MdeModulePkg: Add PlatformLogo protocol definition.

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

8 years agoMdeModulePkg:Modify the pointer type.
Dandan Bi [Wed, 11 Nov 2015 08:34:04 +0000 (08:34 +0000)]
MdeModulePkg:Modify the pointer type.

Previously the pointer type is EFI_IFR_FORM_SET, it is incorrect when
do pointer addition without conversion.Now change it to UINT8 type.

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

8 years agoBaseTools/GenFw: add new option to not zero PE/COFF optional header fields
Yonghong Zhu [Wed, 11 Nov 2015 06:30:42 +0000 (06:30 +0000)]
BaseTools/GenFw: add new option to not zero PE/COFF optional header fields

Add new option --keepoptionalheader and that flag does not zero PE/COFF
optional header fields including the version fields. It can support the
case that the PE/COFF optional header would be kept.

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

8 years agoMdePkg: BaseLib don't require NASM with Xcode
Andrew Fish [Wed, 11 Nov 2015 02:28:51 +0000 (02:28 +0000)]
MdePkg: BaseLib don't require NASM with Xcode

Don't require NASM for simple edk2 Xcode projects.

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

8 years agoMdePkg: Add more DataBits support to Port80 output
Liming Gao [Wed, 11 Nov 2015 02:16:35 +0000 (02:16 +0000)]
MdePkg: Add more DataBits support to Port80 output

The BasePostCodeLibPort80 instance just prints UINT8 to IoPort 80. Some boards
may support 16bit or 32bit. To support them, new PCD PcdPort80DataWidth is
introduced to specify the width of data bits to Port80.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-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@18765 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg PeiCore: Fix issue AuthenticationStatus is not propagated correctly
Eugene Cohen [Tue, 10 Nov 2015 10:02:24 +0000 (10:02 +0000)]
MdeModulePkg PeiCore: Fix issue AuthenticationStatus is not propagated correctly

This patch fixes an issue in PEI with encapsulated FV images where the
AuthenticationStatus is not correctly propagated down to child FV
handles.  The PEI core registers for callbacks for both FvInfo and
FvInfo2 PPIs.  These callbacks process the FVs which will recurse as
necessary to find more encapsulated FVs.  (FvInfo2 is an updated PPI
that includes an AuthenticationStatus field - the original FvInfo did
not include this.)

When encapsulated FV processing occurs the PEI core installs both
FvInfo and FvInfo2 PPIs.  The original implementation installs FvInfo
first and FvInfo2 second.  As soon as the FvInfo PPI is installed the
notification callback handler immediately fires causing recursive FV
processing to occur.  Since there is no AuthenticationStatus provided
for the original FvInfo the callback assumes AuthenticationStatus is
zero (unsigned / unverified) even though the parent FV may have been
verified.

This changes the order of FvInfo and FvInfo2 installs to ensure that
the notification callback occurs for FvInfo2 first and appropriate
AuthenticationStatus data can be propagated from parent FV to child
FV.

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

8 years agoVlv2TbltDevicePkg/Vlv2DeviceRefCodePkg:
Lu Shifei [Tue, 10 Nov 2015 07:47:29 +0000 (07:47 +0000)]
Vlv2TbltDevicePkg/Vlv2DeviceRefCodePkg:

Sync the branch changes to Trunk,

Add "RTC Battery Present" item in setup page.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lu Shifei <shifeix.a.lu@intel.com>
Reviewed-by: Tim He <tim.he@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18763 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoPerformancePkg/Dp_App: Support dumping cumulative data
Cinnamon Shia [Tue, 10 Nov 2015 04:57:14 +0000 (04:57 +0000)]
PerformancePkg/Dp_App: 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: 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@18762 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg: Report Http Errors to screen when http layer occurs an error
Zhang Lubo [Tue, 10 Nov 2015 02:18:31 +0000 (02:18 +0000)]
NetworkPkg: Report Http Errors to screen when http layer occurs an error

Http server will return error status in http header when http connection
cannot be established,so the http boot driver should print the error code
code to the screen and the users can know what happened.

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

8 years agoAdd error handling for TPM in S3 resume failure.
Yao, Jiewen [Tue, 10 Nov 2015 02:03:40 +0000 (02:03 +0000)]
Add error handling for TPM in S3 resume failure.

If TPM2_Startup(TPM_SU_STATE) to return an error, the system
 firmware that resumes from S3 MUST deal with a TPM2_Startup
 error appropriately.
For example, issuing a TPM2_Startup(TPM_SU_CLEAR) command and
 configuring the device securely by taking actions like extending
 a separator with an error digest (0x01) into PCRs 0 through 7.

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

8 years agoArmPkg/ArmDmaLib: use the cache writeback granularity for alignment
Ard Biesheuvel [Mon, 9 Nov 2015 13:28:33 +0000 (13:28 +0000)]
ArmPkg/ArmDmaLib: use the cache writeback granularity for alignment

When allocating memory to perform non-coherent DMA, use the cache
writeback granule rather than the data cache linesize for alignment.
This prevents the explicit cache maintenance from corrupting
unrelated adjacent data if the cache writeback granule exceeds
the cache linesize.

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

8 years agoArmPkg/ArmLib: add accessor function for Cache Writeback Granule
Ard Biesheuvel [Mon, 9 Nov 2015 13:28:17 +0000 (13:28 +0000)]
ArmPkg/ArmLib: add accessor function for Cache Writeback Granule

Add a function to ArmLib that provides access to the Cache Writeback
Granule (CWG) field in CTR_EL0. This information is required when
performing non-coherent DMA.

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

8 years agoArmVirtPkg/PrePi: do not invalidate the entire data cache at startup
Ard Biesheuvel [Mon, 9 Nov 2015 13:27:56 +0000 (13:27 +0000)]
ArmVirtPkg/PrePi: do not invalidate the entire data cache at startup

Drop the call to ArmInvalidateDataCache () from the PrePi startup
sequence. This kind of data cache maintenance should not be performed
when running under virtualization.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18757 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmCacheMaintenanceLib: disallow whole D-cache maintenance operations
Ard Biesheuvel [Mon, 9 Nov 2015 13:27:36 +0000 (13:27 +0000)]
ArmCacheMaintenanceLib: disallow whole D-cache maintenance operations

The ARM architecture provides no reliable way to clean or invalidate
the entire data cache at runtime. The reason is that such maintenance
requires the use of set/way maintenance operations, which are suitable
only for the kind of maintenance that is carried out when the cache is
taken offline entirely.

So ASSERT () when any of the CacheMaintenanceLib whole data cache routines
are invoked rather than pretending we can do anything meaningful here.

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

8 years agoArmPkg/ArmLib: move cache maintenance sync barriers out of loop
Ard Biesheuvel [Mon, 9 Nov 2015 13:27:15 +0000 (13:27 +0000)]
ArmPkg/ArmLib: move cache maintenance sync barriers out of loop

There is no need to issue a full data synchronization barrier and an
instruction synchronization barrier after each and every set/way or
MVA cache maintenance operation. For the set/way case, we can simply
remove them, since the set/way outer loop already issues the required
barriers after completing its traversal over all the cache levels.

For the MVA case, move the data synchronization barrier out of the
loop, and add the instruction synchronization barrier to the I-cache
invalidation by MVA routine.

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

8 years agoArmPkg/ArmLib: retrieve cache line length from CTR not CCSIDR
Ard Biesheuvel [Mon, 9 Nov 2015 13:26:52 +0000 (13:26 +0000)]
ArmPkg/ArmLib: retrieve cache line length from CTR not CCSIDR

The stride used by the cache maintenance by MVA instructions should
be retrieved from CTR_EL0.DminLine and CTR_EL0.IminLine, whose values
reflect the actual geometry of the caches. Using CCSIDR for this purpose
violates the architecture.

Also, move the line length accessors to common code, since there is no
need to keep them separate between ARMv7 and AArch64.

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

8 years agoArmPkg/ArmLib: remove CCSIDR based cache info routines
Ard Biesheuvel [Mon, 9 Nov 2015 13:26:32 +0000 (13:26 +0000)]
ArmPkg/ArmLib: remove CCSIDR based cache info routines

The ARM architecture does not allow the actual geometries of the caches
to be inferred from the CCSIDR cache info system register, since the
geometry it reports is intended for performing cache maintenance by
set/way and nothing else. Since the ArmLib cache info routines are
based solely on CCSIDR contents, they should not be used.

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

8 years agoArmPkg/ArmLib: remove unused ArmCleanDataCacheToPoU()
Ard Biesheuvel [Mon, 9 Nov 2015 13:26:11 +0000 (13:26 +0000)]
ArmPkg/ArmLib: remove unused ArmCleanDataCacheToPoU()

The function ArmCleanDataCacheToPoU() has no users, and its purpose
is unclear, since it uses cache maintenance by set/way to perform
the clean to PoU, which is a dubious practice to begin with. So
remove the declaration and all definitions.

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

8 years agoArmPkg BeagleBoardPkg Omap35xxPkg: fix typo 'ArmDataSyncronizationBarrier'
Ard Biesheuvel [Mon, 9 Nov 2015 13:25:50 +0000 (13:25 +0000)]
ArmPkg BeagleBoardPkg Omap35xxPkg: fix typo 'ArmDataSyncronizationBarrier'

Replace all instances of ArmDataSyncronizationBarrier with
ArmDataSynchronizationBarrier.

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

8 years agoArmPkg/ArmLib: remove unused ARM9 support
Ard Biesheuvel [Mon, 9 Nov 2015 13:25:31 +0000 (13:25 +0000)]
ArmPkg/ArmLib: remove unused ARM9 support

The ARM9 ArmLib implementation is not referenced anywhere in the
tree, and unlikely to be useful going forward, considering that
ARM9 outdates even ARMv6. So remove it.

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

8 years agoArmPkg/ArmLib: fix barriers in AArch64 ArmEnableMmu
Mark Rutland [Mon, 9 Nov 2015 13:25:12 +0000 (13:25 +0000)]
ArmPkg/ArmLib: fix barriers in AArch64 ArmEnableMmu

The ARM architecture requires a DSB to complete TLB maintenance, with a
subsequent ISB being required to synchronize subsequent items in the
current instruction stream against the completed TLB maintenance.

The ArmEnableMmu function is currently missing the DSB, and hence the
TLB maintenance is not guaranteed to have completed at the point the MMU
is enabled. This may result in unpredictable behaviour.

The DSB subsequent to the write to SCTLR_EL1 is unnecessary; the ISB
alone is sufficient to complete all prior instructions and to
synchronise the new context with any subsequent instructions.

This patch adds missing DSBs to complete TLB maintenance, and removes
the unnecessary trailing DSB.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
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@18749 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/BdsLib: Increase fallback tftp buffer size
Ashutosh Singh [Mon, 9 Nov 2015 13:13:37 +0000 (13:13 +0000)]
ArmPkg/BdsLib: Increase fallback tftp buffer size

When performing a tftp download from a server which does not support
rfc2349 transfer size option (such as netkit-tftpd), the existing code
falls back to allocating an 8MB buffer. Since this is insufficient for
an uncompressed AArch64 Linux kernel image, double the size to 16MB.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ashutosh Singh <ashutosh.singh@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18748 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools GCC: move PECOFF_HEADER_SIZE definition before LD script
Ard Biesheuvel [Mon, 9 Nov 2015 08:39:28 +0000 (08:39 +0000)]
BaseTools GCC: move PECOFF_HEADER_SIZE definition before LD script

Older versions of binutils need all symbols to be defined when consuming
the linker script passed via the command line. So move the definition
'--defsym=PECOFF_HEADER_SIZE=...' before the '--script=...' command line
argument.

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

8 years agoBaseTools: Allow decimal values in the EDK II meta-data file
Yonghong Zhu [Mon, 9 Nov 2015 07:43:07 +0000 (07:43 +0000)]
BaseTools: Allow decimal values in the EDK II meta-data file

Because the EDK II meta-data specifications already allow using decimal
values in the EDK II Meta-data file [Defines] section, this patch update
code to allow this usage.

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

8 years agoNetworkPkg:Fix the issue that cannot parse ipv6 address correctly.
Zhang Lubo [Mon, 9 Nov 2015 07:00:20 +0000 (07:00 +0000)]
NetworkPkg:Fix the issue that cannot parse ipv6 address correctly.

If there is a ipv6 expressed url, the NetLibAsciiStrToIp6 cannot get the Ipv6
address from the host name, because the host name contains left and right
bracket which cannot be used to configure the Tcp6 connection.

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

8 years agoMdeModulePkg:Fix a bug that HttpLib can not parse Ipv6 address correctly.
Zhang Lubo [Mon, 9 Nov 2015 03:45:23 +0000 (03:45 +0000)]
MdeModulePkg:Fix a bug that HttpLib can not parse Ipv6 address correctly.

When parsing the authority component of the input URL, it can not distinguish
the ":" is the flag that indicates the port or the separator between
the ipv6 address.

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

8 years agoNetworkPkg:Enable Http Boot over Ipv6 stack
Zhang Lubo [Mon, 9 Nov 2015 03:30:42 +0000 (03:30 +0000)]
NetworkPkg:Enable Http Boot over Ipv6 stack

Add new features to support Http boot over ipv6 stack.

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

8 years agoShellPkg: Don't strip positional parameters of quotation marks.
Qiu Shumin [Mon, 9 Nov 2015 02:29:31 +0000 (02:29 +0000)]
ShellPkg: Don't strip positional parameters of quotation marks.

Per Shell SPEC 2.1 'Double-quotation marks that surround arguments are not stripped in positional parameters'. This patch makes Shell implementation to follow SPEC.

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

8 years agoAppPkg/Applications/Python/Python-2.7.10: Initial Checkin part 5/5.
Daryl McDaniel [Sat, 7 Nov 2015 19:43:57 +0000 (19:43 +0000)]
AppPkg/Applications/Python/Python-2.7.10: Initial Checkin part 5/5.

These files are candidates for modification during the port to EDK II.
The following files were copied, unchanged, from the Python 2.7.2 port.
  Ia32/pyconfig.h
  X64/pyconfig.h
  PyMod-2.7.10/Modules/config.c
  PyMod-2.7.10/Modules/edk2module.c
  Py2710ReadMe.txt    // Copied from PythonReadMe.txt
  Python2710.inf      // Copied from PythonCore.inf

The remaining files were copied, unchanged, from the cPython 2.7.10 distribution.
These files are unchanged and set the baseline for subsequent commits.

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

8 years agoAppPkg/Applications/Python/Python-2.7.10: Initial Checkin part 4/5.
Daryl McDaniel [Sat, 7 Nov 2015 19:33:58 +0000 (19:33 +0000)]
AppPkg/Applications/Python/Python-2.7.10: Initial Checkin part 4/5.

The Lib directory from the cPython 2.7.10 distribution.
These files are unchanged and set the baseline for subsequent commits.

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

8 years agoAppPkg/Applications/Python/Python-2.7.10: Initial Checkin part 3/5.
Daryl McDaniel [Sat, 7 Nov 2015 19:29:24 +0000 (19:29 +0000)]
AppPkg/Applications/Python/Python-2.7.10: Initial Checkin part 3/5.

The Objects directory from the cPython 2.7.10 distribution, along with the LICENSE and README files.  These files are unchanged and set the baseline for subsequent commits.

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

8 years agoAppPkg/Applications/Python/Python-2.7.10: Initial Checkin part 2/5.
Daryl McDaniel [Sat, 7 Nov 2015 19:25:02 +0000 (19:25 +0000)]
AppPkg/Applications/Python/Python-2.7.10: Initial Checkin part 2/5.

The Modules directory from the cPython 2.7.10 distribution.
These files are unchanged and set the baseline for subsequent commits.

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

8 years agoAppPkg/Applications/Python/Python-2.7.10: Initial Checkin part 1/5.
Daryl McDaniel [Sat, 7 Nov 2015 19:19:19 +0000 (19:19 +0000)]
AppPkg/Applications/Python/Python-2.7.10: Initial Checkin part 1/5.

The Include, Parser, and Python directories from the cPython 2.7.10 distribution.
These files are unchanged and set the baseline for subsequent commits.

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

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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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