]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
7 years agoShellPkg/Hexedit: Fix FreePool() ASSERT() when writing disk
Michael Kinney [Thu, 29 Sep 2016 00:33:43 +0000 (17:33 -0700)]
ShellPkg/Hexedit: Fix FreePool() ASSERT() when writing disk

The HDiskImageSave() function copies a device path using
DuplicateDevicePath() and passes that device path to
gBS->LocateDevicePath() that changes the value of the
device path pointer.  When FreePool() is called with the
modified device path pointer, the FreePool() service
generates an ASSERT() because the signature for the pool
head can not be found.

The function HDiskImageRead() immediately above
HDiskImageSave() has the correct algorithm that uses an
additional local variable called DupDevicePathForFree to
preserve the pointer to the allocated buffer so it can
be used in the call to FreePool().

Bug: <https://bugzilla.tianocore.org/show_bug.cgi?id=131>

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>
7 years agoShellPkg/Shell: Update CRC32 in the EFI System Table header
Cinnamon Shia [Mon, 3 Oct 2016 16:37:17 +0000 (09:37 -0700)]
ShellPkg/Shell: Update CRC32 in the EFI System Table header

Update CRC32 in the EFI System Table header after shell changes the
value of gST->ConsoleOutHandle and gST->ConOut

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-By: Tapan Shah <tapandshah@hpe.com>
Reviewed-By: Jaben Carsey <Jaben.carsey@intel.com>
7 years agoBaseTools Build: Fix build break for clean target in Linux
Hao Wu [Thu, 29 Sep 2016 14:47:38 +0000 (22:47 +0800)]
BaseTools Build: Fix build break for clean target in Linux

In Linux, Command needs to be String instead of list when Command run
as shell with True.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoBaseTools VS Makefile: Don't include ms.common in ms.app
Liming Gao [Thu, 29 Sep 2016 14:00:42 +0000 (22:00 +0800)]
BaseTools VS Makefile: Don't include ms.common in ms.app

ms.common is included by every tool Makefile. it is not necessary to be placed
in ms.app again.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoBaseTools Makefile: Missing LFAGS in app.makefile
Liming Gao [Thu, 29 Sep 2016 14:00:22 +0000 (22:00 +0800)]
BaseTools Makefile: Missing LFAGS in app.makefile

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoCryptoPkg/OpensslLib: Upgrade OpenSSL version to 1.0.2j
Qin Long [Tue, 27 Sep 2016 08:54:04 +0000 (16:54 +0800)]
CryptoPkg/OpensslLib: Upgrade OpenSSL version to 1.0.2j

Two official releases (OpenSSL 1.0.2i and 1.0.2j) were available
with several severity fixes at 22-Sep-2016 and 26-Sep-2016.
Refer to
https://www.openssl.org/news/secadv/20160922.txt and
https://www.openssl.org/news/secadv/20160926.txt.
This patch is to upgrade the supported OpenSSL version in
CryptoPkg/OpensslLib to catch the latest release 1.0.2j.

Cc: Ting Ye <ting.ye@intel.com>
Cc: David Woodhouse <David.Woodhouse@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qin Long <qin.long@intel.com>
Reviewed-by: Ting Ye <ting.ye@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
7 years agoMdeModulePkg/ImageDecoderLib: Retire it due to new BootLogoLib
Ruiyu Ni [Thu, 29 Sep 2016 02:37:44 +0000 (10:37 +0800)]
MdeModulePkg/ImageDecoderLib: Retire it due to new BootLogoLib

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdeModulePkg/BmpImageDecoderLib: Retire it due to new BootLogoLib
Ruiyu Ni [Thu, 29 Sep 2016 02:38:35 +0000 (10:38 +0800)]
MdeModulePkg/BmpImageDecoderLib: Retire it due to new BootLogoLib

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdeModulePkg: Remove ImageDecoderLib and BmpImageDecoderLib
Ruiyu Ni [Thu, 29 Sep 2016 02:40:28 +0000 (10:40 +0800)]
MdeModulePkg: Remove ImageDecoderLib and BmpImageDecoderLib

The two libraries are created to support old BootLogoLib to
decode the images. Due to the new BootLogoLib starts using
HiiImageEx interfaces, the two libraries are not needed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoSecurityPkg: Tcg2: Fix TCG2 PP issues
Zhang, Chao B [Tue, 27 Sep 2016 01:46:40 +0000 (09:46 +0800)]
SecurityPkg: Tcg2: Fix TCG2 PP issues

Several issues exist in TCG2 PP
1. TCG2 PP use NVS PPRQ/PPRM as PP parameter as well as current
PP state cache. But it doesn't handle PP set failure case
2. TCG2 PP Submit TPM Operation Request to Pre-OS Environment forgets
to clean PPRM
3. Potential alignment issue

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Qin Long <qin.long@intel.com>
7 years agoOvmfPkg: Use the new LogoDxe driver
Ruiyu Ni [Mon, 26 Sep 2016 06:45:06 +0000 (14:45 +0800)]
OvmfPkg: Use the new LogoDxe driver

Contributed-under: TianoCore Contribution Agreement 1.0
Cc: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoArmVirtPkg: Use the new LogoDxe driver
Ruiyu Ni [Mon, 26 Sep 2016 06:49:40 +0000 (14:49 +0800)]
ArmVirtPkg: Use the new LogoDxe driver

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoNt32Pkg: Use the new LogoDxe driver
Ruiyu Ni [Fri, 23 Sep 2016 08:07:58 +0000 (16:07 +0800)]
Nt32Pkg: Use the new LogoDxe driver

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoMdeModulePkg/Logo: Add LogoDxe module
Ruiyu Ni [Fri, 23 Sep 2016 08:03:47 +0000 (16:03 +0800)]
MdeModulePkg/Logo: Add LogoDxe module

LogoDxe embeds the image resource in the PE resource section, then
it produces Platform Logo protocol which can return the images
in pixel format.
HiiImageEx protocol is responsible to decode the JPEG/PNG images
to pixel format. LogoDxe driver uses HiiImageEx protocol.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoMdeModulePkg/BootLogoLib&PlatformLogo: Use HII data types in parameters
Ruiyu Ni [Fri, 23 Sep 2016 07:54:01 +0000 (15:54 +0800)]
MdeModulePkg/BootLogoLib&PlatformLogo: Use HII data types in parameters

1. Change PlatformLogo protocol to return EFI_IMAGE_INPUT instead of
   RAW image data. PlatformLogo implementation can use HiiImageEx to
   decode the image if it's JPEG or PNG format.
2. Change BootLogoLib to consume the new PlatformLogo protocol.
3. Change BootLogoEnableLogo() to only use images returned from
   PlatformLogo protocol.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoOvmfPkg/PlatformBds: Do not call BootLogoEnableLogo
Ruiyu Ni [Mon, 26 Sep 2016 06:40:32 +0000 (14:40 +0800)]
OvmfPkg/PlatformBds: Do not call BootLogoEnableLogo

Prototype of BootLogoEnableLogo will change in following patches, so
do not call BootLogoEnableLogo to avoid build failure.

Contributed-under: TianoCore Contribution Agreement 1.0
Cc: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoArmVirtPkg/PlatformBds: Do not call BootLogoEnableLogo
Ruiyu Ni [Mon, 26 Sep 2016 06:39:04 +0000 (14:39 +0800)]
ArmVirtPkg/PlatformBds: Do not call BootLogoEnableLogo

Prototype of BootLogoEnableLogo will change in following patches, so
do not call BootLogoEnableLogo to avoid build failure.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoNt32Pkg/PlatformBds: Do not call BootLogoEnableLogo
Ruiyu Ni [Fri, 23 Sep 2016 07:21:47 +0000 (15:21 +0800)]
Nt32Pkg/PlatformBds: Do not call BootLogoEnableLogo

Prototype of BootLogoEnableLogo will change in following patches, so
do not call BootLogoEnableLogo to avoid build failure.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoMdeModulePkg/HiiDatabase: Add HiiImageEx implementation.
Ruiyu Ni [Wed, 21 Sep 2016 09:48:13 +0000 (17:48 +0800)]
MdeModulePkg/HiiDatabase: Add HiiImageEx implementation.

According to UEFI spec, NewImageEx()/SetImageEx()/DrawImageEx()
implicitly call the non-Ex version interface
of HiiImage protocol.
GetImageEx()/DrawImageIdEx() are the enhanced version of
GetImage()/DrawImageId(), which can support decoding JPEG/PNG
through the help of HiiImageDecoder protocol.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoMdeModulePkg/HiiDatabase: Update HiiImage to support PNG/JPEG
Ruiyu Ni [Wed, 21 Sep 2016 04:55:00 +0000 (12:55 +0800)]
MdeModulePkg/HiiDatabase: Update HiiImage to support PNG/JPEG

1. Update GetImageIdOrAddress() to recognize PNG/JPEG image block.
   A offset calculation bug was fixed.
2. Update HiiGetImage() comments to say PNG/JPEG support is provided
   by HiiImageEx
3. Update HiiSetImage() to support replacing a PNG/JPEG image block
   with a new image

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoMdePkg/HiiImage.h: Include GraphicsOutput.h
Ruiyu Ni [Mon, 26 Sep 2016 07:39:54 +0000 (15:39 +0800)]
MdePkg/HiiImage.h: Include GraphicsOutput.h

HiiImage.h uses EFI_GRAPHICS_OUTPUT_BLT_PIXEL which is defined in
GraphicsOutput.h. Include GraphicsOutput.h to avoid build failure
from consumer of HiiImage protocol.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Liming Gao <liming.gao@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoMdemodulePkg/HiiDatabase: Correct typo in comments.
Ruiyu Ni [Wed, 21 Sep 2016 04:48:10 +0000 (12:48 +0800)]
MdemodulePkg/HiiDatabase: Correct typo in comments.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoMdeModulePkg/HiiDatabase: Refine HiiDrawImage()
Ruiyu Ni [Wed, 21 Sep 2016 03:31:49 +0000 (11:31 +0800)]
MdeModulePkg/HiiDatabase: Refine HiiDrawImage()

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoMdeModulePkg/HiiDatabase: Refine HiiSetImage()
Ruiyu Ni [Wed, 21 Sep 2016 03:29:08 +0000 (11:29 +0800)]
MdeModulePkg/HiiDatabase: Refine HiiSetImage()

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoMdeModulePkg/HiiDatabase: Refine HiiGetImage()
Ruiyu Ni [Wed, 21 Sep 2016 03:27:05 +0000 (11:27 +0800)]
MdeModulePkg/HiiDatabase: Refine HiiGetImage()

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoMdeModulePkg/HiiDatabase: Refine HiiNewImage()
Ruiyu Ni [Wed, 21 Sep 2016 03:18:15 +0000 (11:18 +0800)]
MdeModulePkg/HiiDatabase: Refine HiiNewImage()

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoMdeModulePkg/HiiDatabase: Move common code to LocatePackageList()
Ruiyu Ni [Wed, 21 Sep 2016 03:14:01 +0000 (11:14 +0800)]
MdeModulePkg/HiiDatabase: Move common code to LocatePackageList()

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoMdeModulePkg/HiiDatabase: Refine GetImageIdOrAddress
Ruiyu Ni [Wed, 21 Sep 2016 03:10:38 +0000 (11:10 +0800)]
MdeModulePkg/HiiDatabase: Refine GetImageIdOrAddress

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoMdePkg/HiiImageDecoder.h: Add missing EFI_HII_IMAGE_DECODER_OTHER_INFO
Ruiyu Ni [Tue, 27 Sep 2016 02:09:05 +0000 (10:09 +0800)]
MdePkg/HiiImageDecoder.h: Add missing EFI_HII_IMAGE_DECODER_OTHER_INFO

Besides adding the missing structure
EFI_HII_IMAGE_DECODER_OTHER_INFO, the patch also correct some typo.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdePkg/HiiImageDecoder.h: Rename from ImageDecoder.h
Ruiyu Ni [Tue, 27 Sep 2016 01:56:34 +0000 (09:56 +0800)]
MdePkg/HiiImageDecoder.h: Rename from ImageDecoder.h

Rename the protocol header file to follow EDKII file
name rule before the HiiImageDecoder protocol is used
by anyone.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdeModulePkg/PciSioSerialDxe: Remove unused global variables
Ruiyu Ni [Tue, 27 Sep 2016 07:41:39 +0000 (15:41 +0800)]
MdeModulePkg/PciSioSerialDxe: Remove unused global variables

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdePkg/BaseMemoryLibOptDxe: replace deprecated uses of IT blocks
Ard Biesheuvel [Mon, 26 Sep 2016 22:55:05 +0000 (15:55 -0700)]
MdePkg/BaseMemoryLibOptDxe: replace deprecated uses of IT blocks

The ARM architecture version 8 deprecates all uses of the IT instruction
except cases where it is followed by a single narrow instruction. So
replace any occurrences with equivalent sequences that adhere to the
new rules.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdePkg/BaseMemoryLibOptDxe ARM: fix Thumb-2 bug in ScanMem()
Ard Biesheuvel [Mon, 26 Sep 2016 22:51:45 +0000 (15:51 -0700)]
MdePkg/BaseMemoryLibOptDxe ARM: fix Thumb-2 bug in ScanMem()

The ARM ScanMem() in BaseMemoryLibOptDxe contains code from the open
source cortex-strings library, and inherited a bug from it where the
conditional execution of a sequence of instructions is erroneously
made dependent on the same condition. Since the final 'addeq' is
supposed to be dependent on the preceding 'tsteq' instruction, they
cannot be part of the same IT block.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoBaseTools: List missing source python files for Ecc tool in Makefile
Hao Wu [Tue, 27 Sep 2016 02:07:18 +0000 (10:07 +0800)]
BaseTools: List missing source python files for Ecc tool in Makefile

Add missing python sources files that are dependent for Ecc tool in
Makefile.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoBaseTools: Add some posixlike files for Linux
Yonghong Zhu [Sun, 25 Sep 2016 02:47:08 +0000 (10:47 +0800)]
BaseTools: Add some posixlike files for Linux

Add the posixlike files for Rsa2048Sha256Sign, Rsa2048Sha256GenerateKeys
and Pkcs7Sign.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdePkg: Add SMM PciExpressLib Instance
Gao, Liming [Tue, 20 Sep 2016 14:02:28 +0000 (22:02 +0800)]
MdePkg: Add SMM PciExpressLib Instance

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Felix Polyudov <felixp@ami.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoBaseTools: support generating image package from BMP/JPEG/PNG files
Yonghong Zhu [Wed, 21 Sep 2016 02:39:11 +0000 (10:39 +0800)]
BaseTools: support generating image package from BMP/JPEG/PNG files

BaseTools add support to generating image package from BMP/JPEG/PNG
files.
1) New file type *.idf Image definition file to describe HII image
resource. It is the ASCII text file, and includes one or more "#image
IMAGE_ID [TRANSPARENT] ImageFileName".
2) New IMAGE_TOKEN macro is used to refer to IMAGE_ID.
3) New AutoGen header file $(MODULE_NAME)ImgDefs.h to include the
generated ImageId definition.
4) New $(MODULE_NAME)Idf.hpk or $(MODULE_NAME)Images are generated
as the output binary HII image package.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdePkg UefiHii: Add IMAGE_TOKEN macro to access image resource in C and VFR
Liming Gao [Wed, 21 Sep 2016 02:39:09 +0000 (10:39 +0800)]
MdePkg UefiHii: Add IMAGE_TOKEN macro to access image resource in C and VFR

Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
7 years agoMdeModulePkg FormBrowserEx: Change its structure name with EDKII_ prefix
Liming Gao [Thu, 22 Sep 2016 02:03:42 +0000 (10:03 +0800)]
MdeModulePkg FormBrowserEx: Change its structure name with EDKII_ prefix

EDKII implementation protocol should be with EDKII_ prefix.

V2: add gEdkiiFormBrowserExProtocolGuid to align its structure name.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoSecurityPkg: Tcg: New field for User Confirmation Status
Zhang, Chao B [Mon, 26 Sep 2016 02:31:15 +0000 (10:31 +0800)]
SecurityPkg: Tcg: New field for User Confirmation Status

Add a new field in TcgNVS for PP operation user confirmation status,
instead of previous logic overriding Request. Previous logic causes
Get Pending TPM Operation Requested sub function return wrong value.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
7 years agoArmPkg/CpuDxe: Fix MMU initialization problem
Kurt Kennett [Mon, 26 Sep 2016 22:45:02 +0000 (22:45 +0000)]
ArmPkg/CpuDxe: Fix MMU initialization problem

During Mmu initialization in the CpuDxe, for a page table any bits set
in the 'NextSectionAttributes' are garbage and were set from bits that
are actually part of the pagetable address.  We clear it out to zero
so that the SyncCacheConfigPage will use the page attributes instead
of trying to convert the (bogus) section attributes into page
attributes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Kurt Kennett <kurt.kennett@microsoft.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoShellPkg: Enhance 'cls' command to change the background and foreground colors
Tapan Shah [Fri, 23 Sep 2016 16:03:16 +0000 (09:03 -0700)]
ShellPkg: Enhance 'cls' command to change the background and foreground colors

As per ECR 1416 change in UEFI Shell Specification 2.2,
enhancing 'cls' command to change the background color as well as
foreground color. Also add support to display current settings
using 'cls -sfo' command.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tapan Shah <tapandshah@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoNetworkPkg: Clean the previous address since the policy changed
Jiaxin Wu [Wed, 21 Sep 2016 07:13:37 +0000 (15:13 +0800)]
NetworkPkg: Clean the previous address since the policy changed

The previous DNS server data will be retained after the policy
changes from Auto to Manual. This patch is used to clean the
previous dhcp configuration data.

Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Cc: Subramanian Sriram <sriram-s@hpe.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Tested-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
7 years agoMdeModulePkg: Clean the previous address since the policy changed
Jiaxin Wu [Wed, 21 Sep 2016 07:12:21 +0000 (15:12 +0800)]
MdeModulePkg: Clean the previous address since the policy changed

The previous DNS server data will be retained after the policy
changes from Dhcp to Static. This patch is used to clean the
previous dhcp configuration data.

Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Cc: Subramanian Sriram <sriram-s@hpe.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Tested-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
7 years agoMdeModulePkg/PciBusDxe: make OPROM BAR degradation configurable
Ard Biesheuvel [Mon, 19 Sep 2016 08:36:13 +0000 (09:36 +0100)]
MdeModulePkg/PciBusDxe: make OPROM BAR degradation configurable

The 'universal' PCI bus driver in MdeModulePkg contains a quirk to
degrade 64-bit PCI MMIO BARs to 32-bit in the presence of an option
ROM on the same PCI controller.

This quirk is highly specific to not just the X64 architecture in general,
but to the PC platform in particular, given that only X64 platforms that
require legacy PC BIOS compatibility require it. However, making the
quirk dependent on the presence of the legacy BIOS protocol met with
resistance, due to the fact that it introduces a dependency on the
IntelFrameworkModulePkg package.

So instead, make the quirk configurable, by introducing a feature flag PCD
'PcdPciDegradeResourceForOptionRom' which defaults to TRUE only for X64.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoBaseTools: handling the case that map file is not exist
Yonghong Zhu [Thu, 22 Sep 2016 01:48:46 +0000 (09:48 +0800)]
BaseTools: handling the case that map file is not exist

We meet a case that add the library inf file which has the uni file in
the [Sources] section, for this case there will no map file exist, it
cause build tools report Traceback  error.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoShellPkg: Update help output for disconnect command
Tapan Shah [Fri, 23 Sep 2016 16:10:28 +0000 (09:10 -0700)]
ShellPkg: Update help output for disconnect command

Minor changes to match help output notes for disconnect command
with UEFI Shell 2.2 specification document.

Few other formatting changes to fit the help output in 80x25 screen size.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tapan Shah <tapandshah@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoMdePkg/BaseMemoryLibOptDxe ARM AARCH64: fix thinko in SetMem##
Ard Biesheuvel [Thu, 22 Sep 2016 08:52:00 +0000 (09:52 +0100)]
MdePkg/BaseMemoryLibOptDxe ARM AARCH64: fix thinko in SetMem##

The new InternalMemSetMem##() implementations for ARM and AARCH64 in
BaseMemoryLibOptDxe fail to take into account that the 'length' argument
is not in bytes, but in number of items to be copied. So multiply by the
item size before proceeding.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
7 years agoSecurityPkg Tcg2Pei: Fix GCC build failure caused by 5919a9600e07
Star Zeng [Fri, 23 Sep 2016 02:04:05 +0000 (10:04 +0800)]
SecurityPkg Tcg2Pei: Fix GCC build failure caused by 5919a9600e07

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Chao B Zhang <chao.b.zhang@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>
7 years agoShellPkg: Remove current working dir path ".;" from 'path' variable
Tapan Shah [Wed, 21 Sep 2016 21:30:15 +0000 (14:30 -0700)]
ShellPkg: Remove current working dir path ".;" from 'path' variable

As per ECR 1349, latest UEFI Shell 2.2 specification has removed current working directory
path ".;" from a default 'path' environment variable as current working directory always
search first in system.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tapan Shah <tapandshah@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoShellPkg: Expand special output file to include "NULL" and case insensitive
Tapan Shah [Thu, 22 Sep 2016 19:12:47 +0000 (12:12 -0700)]
ShellPkg: Expand special output file to include "NULL" and case insensitive

As per ECR 1349 change in UEFI Shell Specification 2.2, expanding
a special output file name to include "NULL". Previously it only
supported "NUL" as a special output file and it was case sensitive.
With this change both "NUL" and "NULL" are special output file and
checked as case insensitive.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tapan Shah <tapandshah@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoShellPkg: Add Persistent Memory support in 'memmap' command
Tapan Shah [Thu, 22 Sep 2016 20:16:18 +0000 (13:16 -0700)]
ShellPkg: Add Persistent Memory support in 'memmap' command

As per ECR 1416, latest UEFI Shell 2.2 Specification has added Persistent
Memory support in 'memmap' command.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tapan Shah <tapandshah@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoShellPkg: Add '-nc' flag support in 'disconnect' command
Tapan Shah [Thu, 22 Sep 2016 19:49:12 +0000 (12:49 -0700)]
ShellPkg: Add '-nc' flag support in 'disconnect' command

As per ECR 1416, latest UEFI Shell 2.2 specification:
Define a behavior where 'disconnect -r' will disconnect drivers
from all devices but it will reconnect all consoles.
If -nc flag is used (e.g. 'disconnect -r -nc') then disconnect drivers
from all devices and don't reconnect consoles.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tapan Shah <tapandshah@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoOvmfPkg/VirtioGpuDxe: Fix VS toolchain build failure
Dandan Bi [Thu, 22 Sep 2016 01:21:38 +0000 (09:21 +0800)]
OvmfPkg/VirtioGpuDxe: Fix VS toolchain build failure

V2: add the assert codes.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
[lersek@redhat.com: fix up subject line]
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
7 years agoSecurityPkg/TPM2: Sync PcrAllocations and PcrMask
Jiewen Yao [Wed, 14 Sep 2016 08:54:50 +0000 (16:54 +0800)]
SecurityPkg/TPM2: Sync PcrAllocations and PcrMask

Current TCG2 implementation will set Tpm2HashMask PCD value according to TPM2
PCR bank. However, there might be misconfiguration in BIOS build phase.
The enhanced logic makes sure that the current PCR allocations, the TPM
supported PCRs, and the PcdTpm2HashMask are all in agreement.

Cc: Chao B Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoSecurityPkg/TPM2: Extract GetSupportedAndActivePcrs to Tpm2CommandLib
Jiewen Yao [Wed, 14 Sep 2016 08:28:12 +0000 (16:28 +0800)]
SecurityPkg/TPM2: Extract GetSupportedAndActivePcrs to Tpm2CommandLib

This patch extracts function Tpm2GetCapabilitySupportedAndActivePcrs()
from drivers and also update Tcg2ExecutePhysicalPresence() to call
Tpm2GetCapabilitySupportedAndActivePcrs() instead of
Tcg2Protocol->GetCapability to query the TPM to determine which
hashing algorithms are supported.

Cc: Chao B Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoSecurityPkg/TPM2: Move CopyDigestListToBuffer() to Tpm2CommandLib
Jiewen Yao [Wed, 14 Sep 2016 02:45:19 +0000 (10:45 +0800)]
SecurityPkg/TPM2: Move CopyDigestListToBuffer() to Tpm2CommandLib

This patch just moves function CopyDigestListToBuffer() from
drivers to library with HashAlgorithmMask parameter added to
make the interface more applicable.

The related function IsHashAlgSupportedInHashAlgorithmMask()
is also moved from drivers to library as internal function.

Cc: Chao B Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoSecurityPkg/TPM2: Move GetDigestListSize() to Tpm2CommandLib
Jiewen Yao [Wed, 14 Sep 2016 02:07:45 +0000 (10:07 +0800)]
SecurityPkg/TPM2: Move GetDigestListSize() to Tpm2CommandLib

This patch just moves function GetDigestListSize() from
drivers to library and no functionality change.

Cc: Chao B Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoSecurityPkg/TPM2: Update function header of GetDigestFromDigestList()
Star Zeng [Tue, 13 Sep 2016 11:12:07 +0000 (19:12 +0800)]
SecurityPkg/TPM2: Update function header of GetDigestFromDigestList()

Update the return status description and use OUT identifier instead of
IN for Digest parameter, no functionality change.

Cc: Chao B Zhang <chao.b.zhang@intel.com>
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>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoSecurityPkg/TPM2: Move GetDigestFromDigestList() to Tpm2CommandLib
Jiewen Yao [Tue, 13 Sep 2016 11:05:08 +0000 (19:05 +0800)]
SecurityPkg/TPM2: Move GetDigestFromDigestList() to Tpm2CommandLib

This patch just moves function Tpm2GetDigestFromDigestList() from
drivers to library as GetDigestFromDigestList() and no functionality change.

Cc: Chao B Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoSecurityPkg/TPM2: Move Tpm2PcrAllocateBanks() to Tpm2CommandLib
Jiewen Yao [Tue, 13 Sep 2016 10:43:30 +0000 (18:43 +0800)]
SecurityPkg/TPM2: Move Tpm2PcrAllocateBanks() to Tpm2CommandLib

This patch just moves function Tpm2CommandAllocPcr() from
DxeTcg2PhysicalPresenceLib.c to Tpm2CommandLib as Tpm2PcrAllocateBanks()
and no functionality change.

Cc: Chao B Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoCryptoPkg: Clean up unreferenced symbol in Cryptest utility.
Qin Long [Wed, 21 Sep 2016 02:17:01 +0000 (10:17 +0800)]
CryptoPkg: Clean up unreferenced symbol in Cryptest utility.

Remove "TSCounterSignature" from TSVerify.c, which is not being
used by anyone.

Cc: Ting Ye <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qin Long <qin.long@intel.com>
Reviewed-by: Ting Ye <ting.ye@intel.com>
7 years agoArmPkg/AsmMacroIoLib: force word alignment for functions
Ard Biesheuvel [Tue, 13 Sep 2016 17:25:14 +0000 (18:25 +0100)]
ArmPkg/AsmMacroIoLib: force word alignment for functions

Without an explicit .align directive, the Clang assembler defaults to
no alignment, which may result in instructions appearing misaligned in
the final executable. So use word alignment in all cases.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoArmVirtPkg: move all platforms to MdePkg/ BaseMemoryLib implementations
Ard Biesheuvel [Tue, 13 Sep 2016 15:36:23 +0000 (16:36 +0100)]
ArmVirtPkg: move all platforms to MdePkg/ BaseMemoryLib implementations

The BaseMemoryLibStm implementation under ArmPkg/ is being deprecated,
in favor of the generic versions under MdePkg, now that ARM and AARCH64
support has been added to both the generic C version (BaseMemoryLib) and
the accelerated version (BaseMemoryLibOptDxe). The latter uses unaligned
accesses and special cache maintenance instructions, and can therefore
not be used when the MMU is off.

So move to BaseMemoryLibOptDxe for the DXE phase and later, and to the
generic BaseMemoryLib before that.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoMdePkg/BaseMemoryLibOptDxe ARM|AARCH64: implement accelerated GUID functions
Ard Biesheuvel [Fri, 16 Sep 2016 10:25:52 +0000 (11:25 +0100)]
MdePkg/BaseMemoryLibOptDxe ARM|AARCH64: implement accelerated GUID functions

As reported by Vishal, CompareGuid() is a hotspot, and switching from
BaseMemoryLibStm in ArmPkg/ to BaseMemoryLibOptDxe causes a noticeable
performance regression due to the fact that BaseMemoryLibOptDxe uses
unaligned accessors explicitly to implement CompareGuid() and the related
functions.

Since BaseMemoryLibOptDxe on ARM and AARCH64 can only be used in contexts
where unaligned accesses are allowed, reimplement these functions for ARM
and AARCH64 specifically, using wide accessors that can tolerate any
misalignment.

Reported-by: "Oliyil Kunnil, Vishal" <vishalo@qti.qualcomm.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdePkg/BaseMemoryLibOptDxe ARM: fix arithmetic bugs in CompareMem()
Ard Biesheuvel [Tue, 13 Sep 2016 17:22:33 +0000 (18:22 +0100)]
MdePkg/BaseMemoryLibOptDxe ARM: fix arithmetic bugs in CompareMem()

Fix two bugs:
- Erroneous shift of 2 in a bytes to bits conversion.
- Use reverse subtract rather than negate for value that is subsequently
  used as operand #2 in a shift operation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoUefiCpuPkg/SecCore: SecPlatformInformation(2) are optional PPIs
Jeff Fan [Tue, 20 Sep 2016 08:17:26 +0000 (16:17 +0800)]
UefiCpuPkg/SecCore: SecPlatformInformation(2) are optional PPIs

Currently, this is ASSERT() if neither SecPlatformInformation2 nor
SecPlatformInformation PPIs are found. This is not correct. Per PI specification
both of them are optional PPI. Platform may not install them.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoUefiCpuPkg/SecCore: Fix comment typo
Jeff Fan [Tue, 20 Sep 2016 08:08:28 +0000 (16:08 +0800)]
UefiCpuPkg/SecCore: Fix comment typo

Revert SecPlatformInformation2 and SecPlatformInformation in two comment blocks.
And correct the words.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoQuarkPlatformPkg/PlatformSecLib: Fix stack pointer issue in Flat32.S
Jeff Fan [Tue, 20 Sep 2016 08:03:18 +0000 (16:03 +0800)]
QuarkPlatformPkg/PlatformSecLib: Fix stack pointer issue in Flat32.S

ESP should be set to top of eSRAM range that aligns with Flat32.asm. Because CPU
BIST data will be located at top of STACK, this issue leads Platform Sec Lib
cannot get the correct CPU BIST information.

This fix is to address below issue:
  https://tianocore.acgmultimedia.com/show_bug.cgi?id=123

Cc: Steven Shi <Steven.shi@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoMdeModulePkg/XhciPei:1ms delay before access MMIO reg during reset
Feng Tian [Wed, 14 Sep 2016 01:48:40 +0000 (09:48 +0800)]
MdeModulePkg/XhciPei:1ms delay before access MMIO reg during reset

Some XHCI host controllers require to have extra 1ms delay before
accessing any MMIO register during HC reset.

As this delay is not defined by XHCI spec, we use this workaround
to fix the issue.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoMdeModulePkg/XhciDxe:1ms delay before access MMIO reg during reset
Feng Tian [Wed, 14 Sep 2016 01:36:11 +0000 (09:36 +0800)]
MdeModulePkg/XhciDxe:1ms delay before access MMIO reg during reset

Some XHCI host controllers require to have extra 1ms delay before
accessing any MMIO register during HC reset.

As this delay is not defined by XHCI spec, we use this workaround
to fix the issue.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoBaseTools: Update toolsetup.bat to set PYTHONPATH env to run python source
Liming Gao [Mon, 12 Sep 2016 07:28:47 +0000 (15:28 +0800)]
BaseTools: Update toolsetup.bat to set PYTHONPATH env to run python source

When python tool exe doesn't exist, toolsetup.bat will set up PYTHONPATH,
and set python tool dos script directory into system PATH.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
7 years agoBaseTools: Update Python Makefile not to depend on PYTHON_FREEZER_PATH
Liming Gao [Mon, 12 Sep 2016 07:25:07 +0000 (15:25 +0800)]
BaseTools: Update Python Makefile not to depend on PYTHON_FREEZER_PATH

If PYTHON_FREEZER_PATH is not set, Python tools will not be freeze.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
7 years agoBaseTools: Update python tool to call external tools with shell true mode
Liming Gao [Mon, 12 Sep 2016 07:22:49 +0000 (15:22 +0800)]
BaseTools: Update python tool to call external tools with shell true mode

Python tool may run from source as the dos batch files. So, update python
code to call external tools with shell true mode.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
7 years agoBaseTools: Add Windows batch files to run python tool from Source
Liming Gao [Mon, 12 Sep 2016 07:19:37 +0000 (15:19 +0800)]
BaseTools: Add Windows batch files to run python tool from Source

Add 13 windows batch files for every python tool.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
7 years agoMdeModulePkg PCD: Update PCD database structure definition to match BaseTools
Star Zeng [Wed, 31 Aug 2016 06:47:36 +0000 (14:47 +0800)]
MdeModulePkg PCD: Update PCD database structure definition to match BaseTools

To follow PI1.4a, BaseTools has be updated to fix artificial limitation of
SkuId range.

This patch is to update PCD database structure definition to match BaseTools.

Note: The source code and BaseTools need to be upgraded at the same time,
and if they are not upgraded at the same time, build error like below will
be triggered to help user identify the problem.

"Please make sure the version of PCD PEIM Service and the generated
PCD PEI Database match."

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@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>
7 years agoBaseTools: Follow PI1.4a to fix artificial limitation of PCD SkuId range
Yonghong Zhu [Thu, 1 Sep 2016 06:36:24 +0000 (14:36 +0800)]
BaseTools: Follow PI1.4a to fix artificial limitation of PCD SkuId range

Current BaseTools follow previous PI spec to use UINT8 for SkuId, to
follow PI1.4a, BaseTools need to be updated to fix artificial limitation
of PCD SkuId range.

This patch is to update BaseTools to use UINT64 for SkuId, since the
PCD database structure needs to be naturally aligned, the PCD database
structure layout is adjusted to keep the natural alignment and version
is updated to 6.

Note: As the PCD database structure layout is adjusted, the structure
definition in MdeModulePkg/Include/Guid/PcdDataBaseSignatureGuid.h and
PCD drivers also need to be updated. That means the source code and
BaseTools need to be upgraded at the same time, and if they are not
upgraded at the same time, build error like below will be triggered
to help user identify the problem.

"Please make sure the version of PCD PEIM Service and the generated
PCD PEI Database match."

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoIntelFsp2Pkg: Align #Pragma in UPD header files to rest of EDK2 Pkgs
Satya Yarlagadda [Sat, 17 Sep 2016 03:24:49 +0000 (11:24 +0800)]
IntelFsp2Pkg: Align #Pragma in UPD header files to rest of EDK2 Pkgs

Changed the GenCfgOpt.py script to insert pragma pack(1) instead of
pragma pack (push, 1) in the upd header files generated during fsp build.
This is to align with rest of the EDKII pkgs pragma pack usage.

Also, this scripts generates UnusedUpdSpace for UPD address gaps.
Currently it uses UIN16/UINT32/UINT64 for 2/4/8 bytes instead of UINT8[],
thus causing upd space waste to have Natural Alignment. Hence changed the
script to use UINT8[] for any unusedUpd fields above 1 byte.

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Satya Yarlagadda <satya.p.yarlagadda@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
7 years agoNetworkPkg: Correct the DNS token return status by RCODE
Jiaxin Wu [Wed, 14 Sep 2016 06:43:45 +0000 (14:43 +0800)]
NetworkPkg: Correct the DNS token return status by RCODE

When HostNameToIp() and GeneralLookUp() are called with a invalid
host name, RCODE (4 bit field is set as part of responses) error
will returned in packet to identify the domain name referenced in
the query does not exist. So, EFI_NOT_FOUND should be returned
directly.

Current implementation only check the RCODE in successful condition.
Need update the code for more error check according to RFC 1035 4.1.1
section.

Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Tested-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
7 years agoArmVirtPkg/HighMemDxe: move to FDT client protocol
Ard Biesheuvel [Thu, 15 Sep 2016 13:23:11 +0000 (14:23 +0100)]
ArmVirtPkg/HighMemDxe: move to FDT client protocol

Use the FDT client protocol rather than parsing the DT directly using
fdtlib. While we're at it, update the code so it deals correctly with
memory nodes that describe multiple disjoint regions in their "reg"
properties, and make the code work with #address-cells/#size-cells
properties of <1> as well as <2>.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoArmVirtPkg/FdtClientDxe: add methods to iterate over memory nodes
Ard Biesheuvel [Thu, 15 Sep 2016 12:33:23 +0000 (13:33 +0100)]
ArmVirtPkg/FdtClientDxe: add methods to iterate over memory nodes

Add high level methods to iterate over all 'reg' properties of all DT
nodes whose device_type properties have the value "memory". Since we are
modifying the FdtClient protocol, update the protocol and the only existing
implementation at the same time.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoArmVirtPkg/FdtClientDxe: report address and size cell count directly
Ard Biesheuvel [Thu, 15 Sep 2016 13:15:14 +0000 (14:15 +0100)]
ArmVirtPkg/FdtClientDxe: report address and size cell count directly

The FDT client protocol methods dealing with "reg" properties return
the size of a "reg" element. Currently, we have hardcoded this as '8',
since #address-cells == #size-cells == 2 in most cases. However, for
different values, have a single 'reg' element size is not unambiguous,
since - however unlikely - if #address-cells != #size-cells, we do not
know which is which.

So before adding more methods to the protocol, fix up this oversight.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoArmVirtPkg/FdtClientDxe: fix check for size of "reg" properties
Ard Biesheuvel [Thu, 15 Sep 2016 12:48:15 +0000 (13:48 +0100)]
ArmVirtPkg/FdtClientDxe: fix check for size of "reg" properties

Currently, the code in FdtClientDxe assumes #address-cells/#size-cells
values of <2>. Since DT "reg" properties always consist of <base, size>
tuples, this means the size of the entire property should always be a
multiple of 16 bytes (i.e, 4 * sizeof(UINT32), not 8. So fix this.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoBaseTools: Fix the bug to handle the read-only file
Yonghong Zhu [Wed, 14 Sep 2016 05:59:01 +0000 (13:59 +0800)]
BaseTools: Fix the bug to handle the read-only file

change the 'r+b' to 'rb' for some file's open, since these files we only
read it and no need to write. It can fix the bug that the file's attribute
had been set to read-only.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoIntelFrameworkPkg/FrameworkSpecConformance.txt: Update the URL
Yonghong Zhu [Wed, 14 Sep 2016 05:36:07 +0000 (13:36 +0800)]
IntelFrameworkPkg/FrameworkSpecConformance.txt: Update the URL

Update the URL since http://edk2.tianocore.org is not valid

Cc: Liming Gao <liming.gao@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
7 years agoedksetup.sh: update the URL in edksetup.sh
Yonghong Zhu [Wed, 14 Sep 2016 05:27:06 +0000 (13:27 +0800)]
edksetup.sh: update the URL in edksetup.sh

Update the URL since http://edk2.tianocore.org is not valid

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoArmPkg/DefaultExceptionHandlerLib: improve formatting of backtrace
Ard Biesheuvel [Fri, 9 Sep 2016 17:58:56 +0000 (18:58 +0100)]
ArmPkg/DefaultExceptionHandlerLib: improve formatting of backtrace

Implement the backtrace formattting suggested by Andrew, i.e.,

  IRQ Exception at 0x000000005BE182B0
  PC 0x00005BE182B0 (0x00005BE14000+0x000042B0) [ 0] ArmCpuDxe.dll
  PC 0x00005BE15770 (0x00005BE14000+0x00001770) [ 0] ArmCpuDxe.dll
  PC 0x00005EF08CC8 (0x00005EEEB000+0x0001DCC8) [ 1] DxeCore.dll
  PC 0x00005EF09008 (0x00005EEEB000+0x0001E008) [ 1] DxeCore.dll
  PC 0x00005EEF6ACC (0x00005EEEB000+0x0000BACC) [ 1] DxeCore.dll
  PC 0x00005EF0963C (0x00005EEEB000+0x0001E63C) [ 1] DxeCore.dll
  PC 0x00005EF09A38 (0x00005EEEB000+0x0001EA38) [ 1] DxeCore.dll
  PC 0x00005EF01560 (0x00005EEEB000+0x00016560) [ 1] DxeCore.dll
  PC 0x00005EF02FB4 (0x00005EEEB000+0x00017FB4) [ 1] DxeCore.dll
  PC 0x00005EF03098 (0x00005EEEB000+0x00018098) [ 1] DxeCore.dll
  PC 0x00005EF0460C (0x00005EEEB000+0x0001960C) [ 1] DxeCore.dll
  PC 0x00005EF005C4 (0x00005EEEB000+0x000155C4) [ 1] DxeCore.dll
  PC 0x00005EF00360 (0x00005EEEB000+0x00015360) [ 1] DxeCore.dll
  PC 0x00005EF003C8 (0x00005EEEB000+0x000153C8) [ 1] DxeCore.dll
  PC 0x00005EF128D0 (0x00005EEEB000+0x000278D0) [ 1] DxeCore.dll
  PC 0x00005EF12930 (0x00005EEEB000+0x00027930) [ 1] DxeCore.dll
  PC 0x00005EEEF594 (0x00005EEEB000+0x00004594) [ 1] DxeCore.dll
  PC 0x00005EF0CF18 (0x00005EEEB000+0x00021F18) [ 1] DxeCore.dll
  PC 0x00005EF1A310 (0x00005EEEB000+0x0002F310) [ 1] DxeCore.dll
  PC 0x00005EEF1808 (0x00005EEEB000+0x00006808) [ 1] DxeCore.dll
  PC 0x00005EEF1E48 (0x00005EEEB000+0x00006E48) [ 1] DxeCore.dll
  PC 0x00005EF0A838 (0x00005EEEB000+0x0001F838) [ 1] DxeCore.dll
  PC 0x00005EEED70C (0x00005EEEB000+0x0000270C) [ 1] DxeCore.dll
  PC 0x00005EEEC93C (0x00005EEEB000+0x0000193C) [ 1] DxeCore.dll
  PC 0x00005EEEC024 (0x00005EEEB000+0x00001024) [ 1] DxeCore.dll

  [ 0] /home/ard/build/edk2/Build/ArmVirtQemu-AARCH64/DEBUG_GCC5/AARCH64/ArmPkg/Drivers/CpuDxe/CpuDxe/DEBUG/ArmCpuDxe.dll
  [ 1] /home/ard/build/edk2/Build/ArmVirtQemu-AARCH64/DEBUG_GCC5/AARCH64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoVlv2TbltDevicePkg:Signal End of Dxe Event.
lushifex [Thu, 1 Sep 2016 05:02:55 +0000 (13:02 +0800)]
Vlv2TbltDevicePkg:Signal End of Dxe Event.

According to PI spec,DxeSmmReadyToLock protocol is published immediately after signaling of the End of Dxe Event.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex <shifeix.a.lu@intel.com>
7 years agoUefiCpuPkg/SecCore: Re-install SEC platform information(2) PPI
Jeff Fan [Fri, 9 Sep 2016 07:14:32 +0000 (15:14 +0800)]
UefiCpuPkg/SecCore: Re-install SEC platform information(2) PPI

In SecTemporaryRamDone(), we will build one privated GUIDed-HOB to save CPU BIST
Data and re-install SEC platform information(2) PPI. Then other PEI drivers
could get CPU BIST data from the private GUIDed-HOB by new installed PPI.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
7 years agoUefiCpuPkg/SecCore: Abstract worker function GetBistFromHob()
Jeff Fan [Fri, 9 Sep 2016 07:08:56 +0000 (15:08 +0800)]
UefiCpuPkg/SecCore: Abstract worker function GetBistFromHob()

Abstract one worker function to get CPU BIST from the GUIDed-HOB. Add
SecPlatformInformationBist() and SecPlatformInformation2Bist() to invoke
GetBistFromHob(). Add in/out for parameter in function header.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
7 years agoUefiCpuPkg/SecCore: Add SecBist.c
Jeff Fan [Fri, 9 Sep 2016 07:00:30 +0000 (15:00 +0800)]
UefiCpuPkg/SecCore: Add SecBist.c

Add SecBist.c and copy GetBistInfoFromPpi() and SecPlatformInformation2() from
UefiCpuPkg/CpuMpPei/CpuBist.c. And update SecMain.c, SecMain.inf and
UefiCpuPkg.dsc accordinlgy to pass build.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
7 years agoUefiCpuPkg/CpuMpPei: Build GUIDed-HOB to store all CPU BIST Data
Jeff Fan [Fri, 9 Sep 2016 06:36:39 +0000 (14:36 +0800)]
UefiCpuPkg/CpuMpPei: Build GUIDed-HOB to store all CPU BIST Data

Build gEfiSecPlatformInformation2PpiGuid GUIDed-HOB to store all CPU BIST data
that could be used not only by SecPlatformInformation2(), but also by CPU MP Dxe
driver to get CPU BIST data.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
7 years agoUefiCpuPkg/CpuMpPei: Fix BistData ouput error
Jeff Fan [Fri, 9 Sep 2016 06:17:57 +0000 (14:17 +0800)]
UefiCpuPkg/CpuMpPei: Fix BistData ouput error

ProcessorInfo.ProcessorId is UINT64 type even it's valid value is UINT32. Use %x
only output the low 4 bytes and keep the high 4 bytes in stack that will be
output as the second parameter BistData. Typecast ProcessorInfo.ProcessorId to
UINT32 could make BistData output correctly.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
7 years agoUefiCpuPkg/CpuMpPei: Add parameter BistInformationSize
Jeff Fan [Fri, 9 Sep 2016 06:08:33 +0000 (14:08 +0800)]
UefiCpuPkg/CpuMpPei: Add parameter BistInformationSize

Add one OPTIONAL parameter BistInformationSize for GetBistInfoFromPpi().

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
7 years agoUefiCpuPkg/CpuDxe: Fix duplicated status code report
Jeff Fan [Fri, 9 Sep 2016 05:39:50 +0000 (13:39 +0800)]
UefiCpuPkg/CpuDxe: Fix duplicated status code report

If CPU Bist data is not zero, we will report Status code. But there is one bug
that will report each processor's status code duplicated with NumberOfData
times. This fix is to exchange the loop order on NumberOfData and
mNumberOfProcessors. It could make sure the report status code only once for
each processor.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
7 years agoMdePkg/BaseMemoryLibOptDxe ARM|AARCH64: disallow use in SEC & PEI phases
Ard Biesheuvel [Fri, 9 Sep 2016 12:55:34 +0000 (13:55 +0100)]
MdePkg/BaseMemoryLibOptDxe ARM|AARCH64: disallow use in SEC & PEI phases

The new accelerated ARM and AARCH64 implementations take advantage of
features that are only available when the MMU and Dcache are on. So
restrict the use of this library to the DXE phase or later.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdePkg/BaseMemoryLibOptDxe: add accelerated AARCH64 routines
Ard Biesheuvel [Fri, 2 Sep 2016 11:34:22 +0000 (12:34 +0100)]
MdePkg/BaseMemoryLibOptDxe: add accelerated AARCH64 routines

This adds AARCH64 support to BaseMemoryLibOptDxe, based on the cortex-strings
library. All string routines are accelerated except ScanMem16, ScanMem32,
ScanMem64 and IsZeroBuffer, which can wait for another day. (Very few
occurrences exist in the codebase)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdePkg/BaseMemoryLibOptDxe: add accelerated ARM routines
Ard Biesheuvel [Tue, 6 Sep 2016 14:06:38 +0000 (15:06 +0100)]
MdePkg/BaseMemoryLibOptDxe: add accelerated ARM routines

This adds ARM support to BaseMemoryLibOptDxe, partially based on the
cortex-strings library (ScanMem) and the existing CopyMem() implementation
from BaseMemoryLibStm in ArmPkg.

All string routines are accelerated except ScanMem16, ScanMem32,
ScanMem64 and IsZeroBuffer, which can wait for another day. (Very few
occurrences exist in the codebase)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdePkg/BaseMemoryLib: widen aligned accesses to 32 or 64 bits
Ard Biesheuvel [Fri, 2 Sep 2016 07:26:23 +0000 (08:26 +0100)]
MdePkg/BaseMemoryLib: widen aligned accesses to 32 or 64 bits

Since the default BaseMemoryLib should be callable from any context,
including ones where unaligned accesses are not allowed, it implements
InternalCopyMem() and InternalSetMem() using byte accesses only.
However, especially in a context where the MMU is off, such narrow
accesses may be disproportionately costly, and so if the size and
alignment of the access allow it, use 32-bit or even 64-bit loads and
stores (the latter may be beneficial even on a 32-bit architectures like
ARM, which has load pair/store pair instructions)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoArmVirtPkg/FdtParser: avoid unaligned accesses with the MMU off
Ard Biesheuvel [Tue, 13 Sep 2016 14:13:31 +0000 (15:13 +0100)]
ArmVirtPkg/FdtParser: avoid unaligned accesses with the MMU off

When parsing the device tree to find the memory node, we are still running
with the MMU off, which means unaligned memory accesses are not allowed.
Since the FDT only mandates 32-bit alignment, 64-bit quantities are not
guaranteed to appear naturally aligned, and so should be accessed using
32-bit accesses instead.

Reported-by: Julien Grall <julien.grall@arm.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>