]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
6 years agoShellPkg UefiDpLib: Init CustomCumulativeData.MinDur
Star Zeng [Mon, 7 Aug 2017 07:28:46 +0000 (15:28 +0800)]
ShellPkg UefiDpLib: Init CustomCumulativeData.MinDur

Init CustomCumulativeData.MinDur to PERF_MAXDUR, otherwise the
MinDur displayed for custom cumulative data will be always 0,
but not the real shortest duration.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Cinnamon Shia <cinnamon.shia@hpe.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>
6 years agoPerformancePkg DP: Init CustomCumulativeData.MinDur
Star Zeng [Mon, 7 Aug 2017 07:28:21 +0000 (15:28 +0800)]
PerformancePkg DP: Init CustomCumulativeData.MinDur

Init CustomCumulativeData.MinDur to PERF_MAXDUR, otherwise the
MinDur displayed for custom cumulative data will be always 0,
but not the real shortest duration.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Cinnamon Shia <cinnamon.shia@hpe.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>
6 years agoMdeModulePkg DxeCore: Enhance "ConvertPages: Incompatible memory types"
Star Zeng [Thu, 10 Aug 2017 01:30:42 +0000 (09:30 +0800)]
MdeModulePkg DxeCore: Enhance "ConvertPages: Incompatible memory types"

When double free pages by FreePages() or allocate allocated pages by
AllocatePages() with AllocateAddress type, the code will print debug
message "ConvertPages: Incompatible memory types", but the debug
message is not very obvious for the error paths by FreePages() or
AllocatePages().

Refer https://lists.01.org/pipermail/edk2-devel/2017-August/013075.html
for the discussion.

This patch is to enhance the debug message for the error paths by
FreePages() or AllocatePages.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Andrew Fish <afish@apple.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>
6 years agoMdeModulePkg DxeCore: Fix double free pages on LoadImage failure path
Star Zeng [Fri, 11 Aug 2017 03:02:39 +0000 (11:02 +0800)]
MdeModulePkg DxeCore: Fix double free pages on LoadImage failure path

https://bugzilla.tianocore.org/show_bug.cgi?id=667
reported there is double free pages on LoadImage failure path.

CoreLoadPeImage()
...
  return EFI_SUCCESS;

Done:

  //
  // Free memory.
  //
  if (DstBufAlocated) {
    CoreFreePages (Image->ImageContext.ImageAddress, Image->NumberOfPages);
  }
...

CoreUnloadAndCloseImage()
...
  if ((Image->ImageBasePage != 0) && FreePage) {
    CoreFreePages (Image->ImageBasePage, Image->NumberOfPages);
  }
...

This patch is to follow the suggestion at
https://lists.01.org/pipermail/edk2-devel/2017-August/013112.html
to set Image->ImageContext.ImageAddress and Image->ImageBasePage to 0
after the free in CoreLoadPeImage().

Cc: Liming Gao <liming.gao@intel.com>
Cc: Andrew Fish <afish@apple.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>
6 years agoBaseTools: Fix Segmentation fault: 11 when build AppPkg with XCODE5
Andrew Fish [Mon, 7 Aug 2017 03:26:05 +0000 (11:26 +0800)]
BaseTools: Fix Segmentation fault: 11 when build AppPkg with XCODE5

it is a bug in mtoc setting the size of the debug directory entry to
the size of the .debug section, not the size of the
EFI_IMAGE_DEBUG_DIRECTORY_ENTRY. It was causing a loop to iterate and
get bogus EFI_IMAGE_DEBUG_DIRECTORY_ENTRY data and pass that to
memset() and boom.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Andrew Fish <afish@apple.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoNetworkPkg/HttpBootDxe: Update device path node to include DNS information
Jiaxin Wu [Mon, 23 Jan 2017 02:18:30 +0000 (10:18 +0800)]
NetworkPkg/HttpBootDxe: Update device path node to include DNS information

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoMdeModulePkg/UefiBootManagerLib: Support DNS device path description
Jiaxin Wu [Tue, 24 Jan 2017 03:51:01 +0000 (11:51 +0800)]
MdeModulePkg/UefiBootManagerLib: Support DNS device path description

This patch is to update UEFI Boot manager to support DNS device path
for HTTP(S) network boot.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoMdePkg/UefiDevicePathLib: Add DevPathFromTextDns and DevPathToTextDns libraries
Jiaxin Wu [Tue, 25 Jul 2017 03:08:16 +0000 (11:08 +0800)]
MdePkg/UefiDevicePathLib: Add DevPathFromTextDns and DevPathToTextDns libraries

V3:
* Fix the bug in DevPathFromTextDns()

V2:
* Add no IP instance case check.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoMdePkg/DevicePath.h: Add DNS Device Path definition
Jiaxin Wu [Mon, 23 Jan 2017 02:17:58 +0000 (10:17 +0800)]
MdePkg/DevicePath.h: Add DNS Device Path definition

This patch adds the DNS device path node definition.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoMdeModulePkg/EmmcDxe: Make sure no extra data is erased by EraseBlocks
Hao Wu [Tue, 8 Aug 2017 08:34:43 +0000 (16:34 +0800)]
MdeModulePkg/EmmcDxe: Make sure no extra data is erased by EraseBlocks

V3 changes:
Add debug messages for new return path when successfully erase the
specified blocks. Refine logic for calculating the size for writing
zeros to device.

V2 changes:

The Trim command is not supported on all eMMC devices. For those devices
that do not support such command, add codes to handle the scenario.

Commit message:

The current implementation of the Erase Block Protocol service
EraseBlocks() uses the erase command. According to spec eMMC Electrical
Standard 5.1, Section 6.6.9:

The erasable unit of the eMMC is the "Erase Group"; Erase group is
measured in write blocks that are the basic writable units of the Device.
...
When the Erase is executed it will apply to all write blocks within an
erase group.

However, code logic in function EmmcEraseBlocks() does not check whether
the blocks to be erased form complete erase groups. Missing such checks
will lead to erasing extra data on the device.

This commit will:
a. If the device support the Trim command, use the Trim command to
perform the erase operations for eMMC devices.

According to the spec:
Unlike the Erase command, the Trim function applies the erase operation to
write blocks instead of erase groups.

b. If the device does not support the Trim command, use the Erase command
to erase the data in the erase groups. And write zeros to those blocks
that cannot form a complete erase group.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoNetworkPkg/HttpDxe: Handle the HttpVersionUnsupported in the HttpConfigData
Jiaxin Wu [Wed, 9 Aug 2017 02:30:20 +0000 (10:30 +0800)]
NetworkPkg/HttpDxe: Handle the HttpVersionUnsupported in the HttpConfigData

v2:
* Refine the patch by changing the '==' to '>='.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Jin Eric <eric.jin@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoBaseTools: Support TabSpace between section tag in DEC file
Yanyan Zhang [Fri, 11 Aug 2017 02:30:09 +0000 (10:30 +0800)]
BaseTools: Support TabSpace between section tag in DEC file

Per DEC spec, multiple section tag use <TS> to separate, and it can
support Tab, so this patch fix the bug to use Tab.

<TabSpace> ::= {<Tab>} {<Space>}
<TS> ::= <TabSpace>*

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yanyan Zhang <yanyanx.zhang@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoBaseTools: Don't need to add extra quotes when UI string from file
Bin Wang [Thu, 10 Aug 2017 08:54:57 +0000 (16:54 +0800)]
BaseTools: Don't need to add extra quotes when UI string from file

when the UI string is read from files, we don't need to add the extra
quotes. Otherwise, it will cause UI name has this extra quotes.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bin Wang <binx.a.wang@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoBaseTools/UPT: Support Multiple Installation
Hess Chen [Thu, 10 Aug 2017 08:36:47 +0000 (16:36 +0800)]
BaseTools/UPT: Support Multiple Installation

Add a new feature to UPT to support installing
multiple DIST packages in one time.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoBaseTools/Scripts: Add sample makefile for use with RunMakefile.py
Michael D Kinney [Wed, 2 Aug 2017 21:17:41 +0000 (14:17 -0700)]
BaseTools/Scripts: Add sample makefile for use with RunMakefile.py

https://bugzilla.tianocore.org/show_bug.cgi?id=670

Add sample makefile that can be used to test RunMakefile.py
script and can also be used as a template to start a new
PREBUILD/POSTBUILD makefile.

This makefile contains TAB characters instead of spaces on
purpose to maximize compatibility with make utilities.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoBaseTools/Scripts: Add python script to run a makefile
Michael D Kinney [Wed, 2 Aug 2017 21:16:49 +0000 (14:16 -0700)]
BaseTools/Scripts: Add python script to run a makefile

https://bugzilla.tianocore.org/show_bug.cgi?id=670

Add the python script RunMakefile.py that can be used
in a PREBUILD/POSTBUIILD action to invoke a makefile
passing in context as makefile defines.  The command
line arguments passed into RunMakefile.py are converted
to the following set of defines.

* ACTIVE_PLATFORM
* TARGET_ARCH
* TOOL_CHAIN_TAG
* CONF_DIRECTORY
* TARGET
* EXTRA_FLAGS

In addition, a makefile can access the system environment
variables including WORKSPACE and PACKAGES_PATH.

The makefile target from the following set is also passed
into the makefile.  If no target is passed into build, then
the 'all' target is used.

[all|fds|genc|genmake|clean|cleanall|cleanlib|modules|libraries|run]

A platform DSC file can use a statements in the [Defines]
section of the following form to use this script.  MAKEFILE
is a WORKSPACE or PACKAGES_PATH relative path to the makefile
to run.

[Defines]
  PREBUILD  = python BaseTools/Script/RunMakefile.py --makefile MAKEFILE
  POSTBUILD = python BaseTools/Script/RunMakefile.py --makefile MAKEFILE

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoBaseTools/build: Expand PREBUILD/POSTBUILD DSC actions
Michael D Kinney [Wed, 2 Aug 2017 21:07:05 +0000 (14:07 -0700)]
BaseTools/build: Expand PREBUILD/POSTBUILD DSC actions

https://bugzilla.tianocore.org/show_bug.cgi?id=670

* Extend PREBUILD/POSTBUILD define values to support more than
  one argument.
* Delay normalization of PREBUILD/POSTBUILD define values
  until all arguments in the define values can be processed.
* Convert PREBUILD/POSTBUILD build define value arguments
  that are WORKSPACE or PACKAGES_PATH relative paths to
  absolute paths.
* Append -p PlatformFile, --conf=ConfDirectory, and build target
  flags to command line used to execute PREBUILD/POSTBUILD
  actions.
* Remove PrebuildScript and PostbuildScript fields from the
  Build class and use Prebuild and Postbuild fields instead.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoMaintainers.txt: Change maintainer for Intel*Pkg.
Jiewen Yao [Wed, 9 Aug 2017 04:09:54 +0000 (12:09 +0800)]
Maintainers.txt: Change maintainer for Intel*Pkg.

Since Giri left Intel, we change 3 Intel*Pkg
maintainer.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Amy Chan <amy.chan@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Amy Chan <amy.chan@intel.com>
Reviewed-by: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
6 years agoNetworkPkg/Ip6Dxe: Support SetData interface to clear specific configuration
Jiaxin Wu [Tue, 28 Feb 2017 00:35:26 +0000 (08:35 +0800)]
NetworkPkg/Ip6Dxe: Support SetData interface to clear specific configuration

UEFI Spec 2.7 adds the clarification on SetData interface usage to clear specific
individual data types. This patch is to support this feature.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoMdeModulePkg/Ip4Dxe: Support SetData interface to clear specific configuration
Jiaxin Wu [Tue, 28 Feb 2017 00:35:08 +0000 (08:35 +0800)]
MdeModulePkg/Ip4Dxe: Support SetData interface to clear specific configuration

UEFI Spec 2.7 adds the clarification on SetData interface usage to clear specific
individual data types. This patch is to support this feature.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoMdePkg: Update the comments of Ip4Config2/Ip6Config Protocol
Jiaxin Wu [Mon, 20 Feb 2017 01:30:29 +0000 (09:30 +0800)]
MdePkg: Update the comments of Ip4Config2/Ip6Config Protocol

Update the comments of Ip4Config2/Ip6Config Protocol to consistent
with UEFI Spec 2.7, which provides the capability to clear specific
individual data types.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoShellPkg/drivers: Fix GCC build failure
Ruiyu Ni [Fri, 11 Aug 2017 03:18:34 +0000 (11:18 +0800)]
ShellPkg/drivers: Fix GCC build failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoIntelSiliconPkg: Fix VS2015 NOOPT IA32 build failure in IntelVTdDxe
Star Zeng [Thu, 10 Aug 2017 05:11:14 +0000 (13:11 +0800)]
IntelSiliconPkg: Fix VS2015 NOOPT IA32 build failure in IntelVTdDxe

There are VS2015 NOOPT IA32 build failure like below in IntelVTdDxe.
XXX.lib(XXX.obj) : error LNK2001: unresolved external symbol __allshl
XXX.lib(XXX.obj) : error LNK2001: unresolved external symbol __aullshr

This patch is to update Vtd.h to use UINT32 instead of UINT64 for
bitfields in structure definition, and also update IntelVTdDxe code
accordingly.

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>
6 years agoMdePkg: Fix Xcode 9 Beta treating 32-bit left shift as undefined
Andrew Fish [Thu, 3 Aug 2017 07:05:37 +0000 (15:05 +0800)]
MdePkg: Fix Xcode 9 Beta treating 32-bit left shift as undefined

Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=635

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Andrew Fish <afish@apple.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoIntelFrameworkModulePkg: Fix Xcode 9 Beta treating 32-bit left shift as undefined
Andrew Fish [Thu, 3 Aug 2017 07:05:10 +0000 (15:05 +0800)]
IntelFrameworkModulePkg: Fix Xcode 9 Beta treating 32-bit left shift as undefined

Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=635

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Andrew Fish <afish@apple.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoDuetPkg: Fix Xcode 9 Beta treating 32-bit left shift as undefined
Andrew Fish [Thu, 3 Aug 2017 07:04:38 +0000 (15:04 +0800)]
DuetPkg: Fix Xcode 9 Beta treating 32-bit left shift as undefined

Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=635

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Andrew Fish <afish@apple.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
6 years agoBaseTools: Fix Xcode 9 Beta treating 32-bit left shift as undefined
Yonghong Zhu [Wed, 2 Aug 2017 09:19:02 +0000 (17:19 +0800)]
BaseTools: Fix Xcode 9 Beta treating 32-bit left shift as undefined

Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=635

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Andrew Fish <afish@apple.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoQuarkPlatformPkg/Readme.md: Bring Readme.md up to date
Michael D Kinney [Wed, 9 Aug 2017 19:28:40 +0000 (12:28 -0700)]
QuarkPlatformPkg/Readme.md: Bring Readme.md up to date

The following commit moved the QuarkSocBinPkg from the root
directory of the edk2-non-osi repository to the
Silicon/Intel directory.

https://github.com/tianocore/edk2-non-osi/commit/182e85d04566800fe188de4b1c30a50533dd74b7

The following updates are made to Readme.md:

* PACKAGES_PATH setting for edk2-non-osi directory changes
* Remove use of edk2-FatPkg repository
* Remove use of edk2-BaseTools-win32 repository
* Run python build tools from sources

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Kelly Steele <kelly.steele@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Kelly Steele <kelly.steele@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoQuarkSocPkg/MemoryInit: Remove use of memset()/memcpy()
Michael D Kinney [Wed, 9 Aug 2017 19:19:46 +0000 (12:19 -0700)]
QuarkSocPkg/MemoryInit: Remove use of memset()/memcpy()

Map the use of memset() and memcpy() to the BaseMemoryLib
functions ZeroMem(), SetMem(), and CopyMem().  This fixes
GCC build issues with this module.

With the remap of the functions, the [BuildOptions] MSFT
CC_FLAGS to enable /Oi can also be removed, so the MSFT
and GCC builds behave the same.

Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Kelly Steele <kelly.steele@intel.com>
6 years agoBaseTools/edksetup.sh: fix invalid test for current working directory
Chris Ruffin [Thu, 3 Aug 2017 15:37:42 +0000 (23:37 +0800)]
BaseTools/edksetup.sh: fix invalid test for current working directory

edksetup.sh implements a test that requires the current working
directory to contain the edksetup.sh script.  This test has the side
effect of requiring the WORKSPACE to be set to the same directory as
the edksetup.sh.  In a multiple workspace configuration, it is
required to be able to have a WORKSPACE that is different from the
directory that contains edksetup.sh.  This changeset skips this test
if PACKAGE_PATH is set.

Change-Id: Ie6f16a08c012baf4e650c48cc8e91cdc466d05f2
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chris Ruffin <chris.ruffin@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoShellPkg/driver: Show "-" in non-SFO mode
Huajing Li [Mon, 7 Aug 2017 07:51:43 +0000 (15:51 +0800)]
ShellPkg/driver: Show "-" in non-SFO mode

The patch shows "X"/"-" instead of "Y"/"N" in column "CFG"
and "DIAG".
The patch shows "-" instead of "0" in column "#D" and "#C".

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Huajing Li <huajing.li@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoShellPkg/drivers: Show Image Name in non-SFO mode
Huajing Li [Wed, 9 Aug 2017 02:54:32 +0000 (10:54 +0800)]
ShellPkg/drivers: Show Image Name in non-SFO mode

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Huajing Li <huajing.li@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoMdeModulePkg: Variable: Fix typo in variable measure
Zhang, Chao B [Mon, 7 Aug 2017 14:48:21 +0000 (22:48 +0800)]
MdeModulePkg: Variable: Fix typo in variable measure

Fix variable measure debug message typo.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdeModulePkg/NvmExpressDxe: Notify NVME HW when system reset happens
Ruiyu Ni [Fri, 4 Aug 2017 09:07:31 +0000 (17:07 +0800)]
MdeModulePkg/NvmExpressDxe: Notify NVME HW when system reset happens

Per NVM Express Spec, software should notify NVME HW when shutdown
occurs.

The NVME controller requires notification for shutdown as part of
its management of internal structures. Even with FUA, failing to
notify the NVME controller to shutdown power off causes the NVME
controller to take quite some time to organize its tables on the
next power on. This time exceeds the normal timeout, so we would
fail to boot the NVME disk.

The host should set the Shutdown Notification (CC.SHN) field to 01b
to indicate a normal shutdown operation. The controller indicates
when shutdown processing is completed by updating the Shutdown Status
(CSTS.SHST) field to 10b.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
6 years agoMdePkg/Nvme: Add NVME shutdown notification related macros
Ruiyu Ni [Thu, 27 Jul 2017 07:43:58 +0000 (15:43 +0800)]
MdePkg/Nvme: Add NVME shutdown notification related macros

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
6 years agoNetworkPkg/HttpBootDxe: Refine the coding style.
Jiaxin Wu [Tue, 8 Aug 2017 07:21:20 +0000 (15:21 +0800)]
NetworkPkg/HttpBootDxe: Refine the coding style.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Bi Dandan <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
6 years agoOvmfPkg/AcpiPlatformDxe: short-circuit the transfer of an empty S3_CONTEXT
Laszlo Ersek [Sun, 6 Aug 2017 09:20:02 +0000 (11:20 +0200)]
OvmfPkg/AcpiPlatformDxe: short-circuit the transfer of an empty S3_CONTEXT

In commit 805762252733 ("OvmfPkg/AcpiPlatformDxe: save fw_cfg boot script
with QemuFwCfgS3Lib", 2017-02-23), we replaced the explicit S3 boot script
manipulation in TransferS3ContextToBootScript() with a call to
QemuFwCfgS3CallWhenBootScriptReady(). (Passing AppendFwCfgBootScript() as
callback.)

QemuFwCfgS3CallWhenBootScriptReady() checks for fw_cfg DMA up-front, and
bails with RETURN_NOT_FOUND if fw_cfg DMA is missing.

(This is justified as the goal of QemuFwCfgS3Lib is to "enable[] driver
modules [...] to produce fw_cfg DMA operations that are to be replayed at
S3 resume time".)

In turn, if QemuFwCfgS3CallWhenBootScriptReady() fails, then
OvmfPkg/AcpiPlatformDxe rolls back any earlier linker/loader script
processing, and falls back to the built-in ACPI tables.

(This is also justified because failure to save WRITE_POINTER commands for
replaying at S3 resume implies failure to process the linker/loader script
comprehensively.)

Calling QemuFwCfgS3CallWhenBootScriptReady() from
TransferS3ContextToBootScript() *unconditionally* is wrong however. For
the case when the linker/loader script contains no WRITE_POINTER commands,
the call perpetuated an earlier side effect, and introduced another one:

(1) On machine types that provide fw_cfg DMA (i.e., 2.5+),
    QemuFwCfgS3CallWhenBootScriptReady() would succeed, and allocate
    workspace for the boot script opcodes in reserved memory. However, no
    opcodes would actually be produced in the AppendFwCfgBootScript()
    callback, due to lack of any WRITE_POINTER commands.

    This waste of reserved memory had been introduced in earlier commit
    df73df138d9d ("OvmfPkg/AcpiPlatformDxe: replay
    QEMU_LOADER_WRITE_POINTER commands at S3", 2017-02-09).

(2) On machine types that lack fw_cfg DMA (i.e., 2.4 and earlier),
    TransferS3ContextToBootScript() would now fail the linker/loader
    script for no reason.

    (Note that QEMU itself prevents adding devices that depend on
    WRITE_POINTER if the machine type lacks fw_cfg DMA:

    $ qemu-system-x86_64 -M pc-q35-2.4 -device vmgenid

    qemu-system-x86_64: -device vmgenid: vmgenid requires DMA write
    support in fw_cfg, which this machine type does not provide)

Short-circuit an empty S3_CONTEXT in TransferS3ContextToBootScript() by
dropping S3_CONTEXT on the floor. This is compatible with the current
contract of the function as it constitutes a transfer of ownership.

Regression (2) was found and reported by Dhiru Kholia as an OSX guest boot
failure on the "pc-q35-2.4" machine type:

http://mid.mail-archive.com/CANO7a6x6EaWNZ8y=MvLU=w_LjRLXserO3NmsgHvaYE0aUCCWzg@mail.gmail.com

Dhiru bisected the issue to commit 805762252733.

Cc: Dhiru Kholia <dhiru.kholia@gmail.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Fixes: df73df138d9d53f7f7570f4fe97a6cde941a2656
Fixes: 805762252733bb67bc5157f0137c64e010724c77
Reported-by: Dhiru Kholia <dhiru.kholia@gmail.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Dhiru Kholia <dhiru.kholia@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agoMdeModulePkg SerialDxe: Process timeout consistently in SerialRead
Star Zeng [Tue, 18 Jul 2017 08:32:16 +0000 (16:32 +0800)]
MdeModulePkg SerialDxe: Process timeout consistently in SerialRead

https://lists.01.org/pipermail/edk2-devel/2017-July/012385.html
reported the timeout processing in SerialRead is not consistent.

Since SerialPortPoll only checks the status of serial port and
returns immediately, and SerialPortRead does not really implement
a time out mechanism and will always wait for enough input,
it will cause below results:
1. If there is no serial input at all, this interface will return
timeout immediately without any waiting;
2. If there is A characters in serial port FIFO, and caller requires
A+1 characters, it will wait until a new input is coming and timeout
will not really occur.

This patch is to update SerialRead() to check SerialPortPoll() and
read data through SerialPortRead() one byte by one byte, and check
timeout against mSerialIoMode.Timeout if no input.

Cc: Heyi Guo <heyi.guo@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoEmbeddedPkg/AndroidFastboot: split android boot header
Jun Nie [Wed, 2 Aug 2017 14:03:40 +0000 (22:03 +0800)]
EmbeddedPkg/AndroidFastboot: split android boot header

Split android boot header definition to share code among
different applications and libraries.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jun Nie <jun.nie@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoEdk2: Update UefiCpuPkg owner.
Fan, Jeff [Fri, 4 Aug 2017 14:40:55 +0000 (22:40 +0800)]
Edk2: Update UefiCpuPkg owner.

Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoUefiCpuPkg MtrrLib: Remove deprecated micro.
Eric Dong [Thu, 3 Aug 2017 08:52:52 +0000 (16:52 +0800)]
UefiCpuPkg MtrrLib: Remove deprecated micro.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoVlv2TbltDevicePkg: Remove reference deprecated macro.
Eric Dong [Fri, 4 Aug 2017 05:55:18 +0000 (13:55 +0800)]
Vlv2TbltDevicePkg: Remove reference deprecated macro.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoQuarkSocPkg MtrrLib: Remove reference deprecated macro.
Eric Dong [Thu, 3 Aug 2017 09:32:03 +0000 (17:32 +0800)]
QuarkSocPkg MtrrLib: Remove reference deprecated macro.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoUefiCpuPkg CpuDxe: Remove reference deprecated macro.
Eric Dong [Thu, 3 Aug 2017 08:41:19 +0000 (16:41 +0800)]
UefiCpuPkg CpuDxe: Remove reference deprecated macro.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoVlv2TbltDevicePkg: Enhance get mtrr mask logic.
Eric Dong [Wed, 2 Aug 2017 10:28:00 +0000 (18:28 +0800)]
Vlv2TbltDevicePkg: Enhance get mtrr mask logic.

In order to not use the deprecated macro, refine
get mtrr mask value logic.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoUefiCpuPkg CpuDxe: Enhance get mtrr mask logic.
Eric Dong [Wed, 2 Aug 2017 10:29:09 +0000 (18:29 +0800)]
UefiCpuPkg CpuDxe: Enhance get mtrr mask logic.

In order to not use the deprecated macro, refine
get mtrr mask value logic.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoQuarkSocPkg MtrrLib: Enhance get mtrr mask logic.
Eric Dong [Wed, 2 Aug 2017 10:26:43 +0000 (18:26 +0800)]
QuarkSocPkg MtrrLib: Enhance get mtrr mask logic.

In order to not use the deprecated macro, refine
get mtrr mask value logic.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoBaseTools/Conf: apply nasmb, asm16 build rule order
Chris Ruffin [Wed, 2 Aug 2017 20:30:06 +0000 (04:30 +0800)]
BaseTools/Conf: apply nasmb, asm16 build rule order

Prioritize nasmb rule over asm16 where both source types are specified.

Change-Id: I33ec348dab66b313ddb05cb15f2d8407a648c320
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chris Ruffin <chris.ruffin@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoNetworkPkg/HttpDxe: Support HTTP Patch method
Jiaxin Wu [Wed, 2 Aug 2017 07:51:47 +0000 (15:51 +0800)]
NetworkPkg/HttpDxe: Support HTTP Patch method

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoOvmfPkg/PlatformPei: support >=1TB high RAM, and discontiguous high RAM
Laszlo Ersek [Fri, 7 Jul 2017 23:28:37 +0000 (01:28 +0200)]
OvmfPkg/PlatformPei: support >=1TB high RAM, and discontiguous high RAM

In OVMF we currently get the upper (>=4GB) memory size with the
GetSystemMemorySizeAbove4gb() function.

The GetSystemMemorySizeAbove4gb() function is used in two places:

(1) It is the starting point of the calculations in GetFirstNonAddress().
    GetFirstNonAddress() in turn
    - determines the placement of the 64-bit PCI MMIO aperture,
    - provides input for the GCD memory space map's sizing (see
      AddressWidthInitialization(), and the CPU HOB in
      MiscInitialization()),
    - influences the permanent PEI RAM cap (the DXE core's page tables,
      built in permanent PEI RAM, grow as the RAM to map grows).

(2) In QemuInitializeRam(), GetSystemMemorySizeAbove4gb() determines the
    single memory descriptor HOB that we produce for the upper memory.

Respectively, there are two problems with GetSystemMemorySizeAbove4gb():

(1) It reads a 24-bit count of 64KB RAM chunks from the CMOS, and
    therefore cannot return a larger value than one terabyte.

(2) It cannot express discontiguous high RAM.

Starting with version 1.7.0, QEMU has provided the fw_cfg file called
"etc/e820". Refer to the following QEMU commits:

0624c7f916b4 ("e820: pass high memory too.", 2013-10-10),
7d67110f2d9a ("pc: add etc/e820 fw_cfg file", 2013-10-18)
7db16f2480db ("pc: register e820 entries for ram", 2013-10-10)

Ever since these commits in v1.7.0 -- with the last QEMU release being
v2.9.0, and v2.10.0 under development --, the only two RAM entries added
to this E820 map correspond to the below-4GB RAM range, and the above-4GB
RAM range. And, the above-4GB range exactly matches the CMOS registers in
question; see the use of "pcms->above_4g_mem_size":

  pc_q35_init() | pc_init1()
    pc_memory_init()
      e820_add_entry(0x100000000ULL, pcms->above_4g_mem_size, E820_RAM);
    pc_cmos_init()
      val = pcms->above_4g_mem_size / 65536;
      rtc_set_memory(s, 0x5b, val);
      rtc_set_memory(s, 0x5c, val >> 8);
      rtc_set_memory(s, 0x5d, val >> 16);

Therefore, remedy the above OVMF limitations as follows:

(1) Start off GetFirstNonAddress() by scanning the E820 map for the
    highest exclusive >=4GB RAM address. Fall back to the CMOS if the E820
    map is unavailable. Base all further calculations (such as 64-bit PCI
    MMIO aperture placement, GCD sizing etc) on this value.

    At the moment, the only difference this change makes is that we can
    have more than 1TB above 4GB -- given that the sole "high RAM" entry
    in the E820 map matches the CMOS exactly, modulo the most significant
    bits (see above).

    However, Igor plans to add discontiguous (cold-plugged) high RAM to
    the fw_cfg E820 RAM map later on, and then this scanning will adapt
    automatically.

(2) In QemuInitializeRam(), describe the high RAM regions from the E820
    map one by one with memory HOBs. Fall back to the CMOS only if the
    E820 map is missing.

    Again, right now this change only makes a difference if there is at
    least 1TB high RAM. Later on it will adapt to discontiguous high RAM
    (regardless of its size) automatically.

-*-

Implementation details: introduce the ScanOrAdd64BitE820Ram() function,
which reads the E820 entries from fw_cfg, and finds the highest exclusive
>=4GB RAM address, or produces memory resource descriptor HOBs for RAM
entries that start at or above 4GB. The RAM map is not read in a single
go, because its size can vary, and in PlatformPei we should stay away from
dynamic memory allocation, for the following reasons:

- "Pool" allocations are limited to ~64KB, are served from HOBs, and
  cannot be released ever.

- "Page" allocations are seriously limited before PlatformPei installs the
  permanent PEI RAM. Furthermore, page allocations can only be released in
  DXE, with dedicated code (so the address would have to be passed on with
  a HOB or PCD).

- Raw memory allocation HOBs would require the same freeing in DXE.

Therefore we process each E820 entry as soon as it is read from fw_cfg.

-*-

Considering the impact of high RAM on the DXE core:

A few years ago, installing high RAM as *tested* would cause the DXE core
to inhabit such ranges rather than carving out its home from the permanent
PEI RAM. Fortunately, this was fixed in the following edk2 commit:

  3a05b13106d1, "MdeModulePkg DxeCore: Take the range in resource HOB for
                PHIT as higher priority", 2015-09-18

which I regression-tested at the time:

  http://mid.mail-archive.com/55FC27B0.4070807@redhat.com

Later on, OVMF was changed to install its high RAM as tested (effectively
"arming" the earlier DXE core change for OVMF), in the following edk2
commit:

  035ce3b37c90, "OvmfPkg/PlatformPei: Add memory above 4GB as tested",
                2016-04-21

which I also regression-tested at the time:

  http://mid.mail-archive.com/571E8B90.1020102@redhat.com

Therefore adding more "tested memory" HOBs is safe.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1468526
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agoOvmfPkg/QemuFwCfgLib: Use BusMasterCommonBuffer to map FW_CFG_DMA_ACCESS
Brijesh Singh [Wed, 2 Aug 2017 22:12:48 +0000 (18:12 -0400)]
OvmfPkg/QemuFwCfgLib: Use BusMasterCommonBuffer to map FW_CFG_DMA_ACCESS

Commit 09719a01b11b (OvmfPkg/QemuFwCfgLib: Implement SEV internal function
for Dxe phase) uses IOMMU protocol to allocate and free FW_CFG_DMA_ACCESS
buffer when SEV is active. During initial commits we made assumption that
IOMMU.AllocateBuffer() will provide PlainTextAddress (i.e C-bit cleared).
This assumption was wrong, the AllocateBuffer() protocol member is not
expected to produce a buffer that is immediatly usable, and client is
required to call Map() uncondtionally with BusMasterCommonBuffer[64] to
get a mapping which is accessable by both host and device.

The patch refactors code a bit and add the support to Map()
FW_CFG_DMA_ACCESS buffer using BusMasterCommonBuffer operation after
allocation and Unamp() before free.

The complete discussion about this and recommendation from Laszlo can be
found here [1]

[1] https://lists.01.org/pipermail/edk2-devel/2017-July/012652.html

Suggested-by: Laszlo Ersek <lersek@redhat.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
[lersek@redhat.com: convert pointers to UINTN before converting to UINT64]
[lersek@redhat.com: fix argument indentation in multi-line function call]
[lersek@redhat.com: explicitly compare pointers to NULL]
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
6 years agoOvmfPkg/IoMmuDxe: Unmap(): recycle MAP_INFO after BusMasterCommonBuffer[64]
Laszlo Ersek [Wed, 2 Aug 2017 18:31:08 +0000 (20:31 +0200)]
OvmfPkg/IoMmuDxe: Unmap(): recycle MAP_INFO after BusMasterCommonBuffer[64]

In order for Unmap() to be callable from ExitBootServices() event handler
context (for cleaning up a BusMasterCommonBuffer[64] operation), we have
to completely liberate the affected path in Unmap() from dynamic memory
management.

The last remaining piece is the release of the MAP_INFO structure. Rather
than freeing it with FreePool(), recycle it to an internal list. Elements
of this "free list" can be reused for any kind of Map() operation, and can
be freed later, or recycled again.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: abort harder on memory encryption mask failures
Laszlo Ersek [Wed, 2 Aug 2017 17:35:38 +0000 (19:35 +0200)]
OvmfPkg/IoMmuDxe: abort harder on memory encryption mask failures

Upon a MemEncryptSevClearPageEncMask() failure in Map(), it wouldn't be
difficult to release the bounce buffer that was implicitly allocated for
BusMasterRead[64] and BusMasterWrite[64] operations. However, undoing any
partial memory encryption mask changes -- partial page splitting and PTE
modifications -- is practically impossible. (For example, restoring the
encryption mask on the entire range has no reason to fare any better than
the MemEncryptSevClearPageEncMask() call itself.)

For this reason, keep ASSERT_EFI_ERROR(), but hang in RELEASE builds too,
if MemEncryptSevClearPageEncMask() or MemEncryptSevSetPageEncMask() fails.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: implement in-place decryption/encryption for Map/Unmap
Laszlo Ersek [Wed, 2 Aug 2017 16:26:59 +0000 (18:26 +0200)]
OvmfPkg/IoMmuDxe: implement in-place decryption/encryption for Map/Unmap

At the moment, we have the following distribution of actions between the
IOMMU protocol member functions:

- AllocateBuffer() allocates pages and clears the memory encryption mask.

- FreeBuffer() re-sets the memory encryption mask, and deallocates pages.

- Map() does nothing at all when BusMasterCommonBuffer[64] is requested
  (and AllocateBuffer() was called previously). Otherwise, Map() allocates
  pages, and clears the memory encryption mask.

- Unmap() does nothing when cleaning up a BusMasterCommonBuffer[64]
  operation. Otherwise, Unmap() clears the encryption mask, and frees the
  pages.

This is wrong: the AllocateBuffer() protocol member is not expected to
produce a buffer that is immediately usable, and client code is required
to call Map() unconditionally, even if BusMasterCommonBuffer[64] is the
desired operation. Implement the right distribution of actions as follows:

- AllocateBuffer() allocates pages and does not touch the encryption mask.

- FreeBuffer() deallocates pages and does not touch the encryption mask.

- Map() does not allocate pages when BusMasterCommonBuffer[64] is
  requested, and it allocates pages (bounce buffer) otherwise.  Regardless
  of the BusMaster operation, Map() (and Map() only) clears the memory
  encryption mask.

- Unmap() restores the encryption mask unconditionally. If the operation
  was BusMasterCommonBuffer[64], then Unmap() does not release the pages.
  Otherwise, the pages (bounce buffer) are released.

This approach also ensures that Unmap() can be called from
ExitBootServices() event handlers, for cleaning up
BusMasterCommonBuffer[64] operations. (More specifically, for restoring
the SEV encryption mask on any in-flight buffers, after resetting any
referring devices.) ExitBootServices() event handlers must not change the
UEFI memory map, thus any memory allocation or freeing in Unmap() would
disqualify Unmap() from being called in such a context.

Map()-ing and Unmap()-ing memory for a BusMasterCommonBuffer[64] operation
effectively means in-place decryption and encryption in a SEV context. As
an additional hurdle, section "7.10.8 Encrypt-in-Place" of AMD publication
Nr.24593 implies that we need a separate temporary buffer for decryption
and encryption that will eventually land in-place. Allocating said
temporary buffer in the straightforward way would violate the above
allocation/freeing restrictions on Map()/Unmap(), therefore pre-allocate
this "stash buffer" too in AllocateBuffer(), and free it in FreeBuffer().

To completely rid Unmap() of dynamic memory impact, for
BusMasterCommonBuffer[64] operations, we're going to rework the lifecycle of
the MAP_INFO structures in a later patch.

(The MemEncryptSevSetPageEncMask() call in Unmap() could theoretically
allocate memory internally for page splitting, however this won't happen
in practice: in Unmap() we only restore the memory encryption mask, and
don't genuinely set it. Any page splitting will have occurred in Map()'s
MemEncryptSevClearPageEncMask() call first.)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: rework setup of "MapInfo->PlainTextAddress" in Map()
Laszlo Ersek [Wed, 2 Aug 2017 13:13:15 +0000 (15:13 +0200)]
OvmfPkg/IoMmuDxe: rework setup of "MapInfo->PlainTextAddress" in Map()

There are three issues with the current calculations:

- The initial logic that sets up "DmaMemoryTop" and "AllocateType" checks
  for the BusMasterCommonBuffer64 operation in two places. The inner check
  for BusMasterCommonBuffer64 will never evaluate to TRUE however, because
  the outer check excludes BusMasterCommonBuffer64.

- In order to lower "DmaMemoryTop" to (SIZE_4GB - 1), the outer check
  requires that the encrypted (original) buffer cross the 4GB mark. This
  is wrong: for BusMasterRead[64] and BusMasterWrite[64] operations, we
  unconditionally need a bounce buffer (a decrypted memory area), and for
  the 32-bit variants, "DmaMemoryTop" should be lowered regardless of the
  location of the original (encrypted) buffer.

- The current logic would be hard to extend for the in-place decryption
  that we'll implement in the next patch.

Therefore rework the "MapInfo->PlainTextAddress" setup. No functional
changes beyond said bugfixes.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: zero out pages before releasing them
Laszlo Ersek [Wed, 2 Aug 2017 09:53:53 +0000 (11:53 +0200)]
OvmfPkg/IoMmuDxe: zero out pages before releasing them

Whenever we release the plaintext bounce buffer pages that were allocated
implicitly in Map() for BusMasterRead[64] and BusMasterWrite[64], we
restore the encryption mask on them. However, we should also rewrite the
area (fill it with zeros) so that the hypervisor is not left with a
plaintext view of the earlier data.

Similarly, whenever we release the plaintext common buffer pages that were
allocated explicitly in AllocateBuffer() for BusMasterCommonBuffer[64], we
restore the encryption mask on them.  However, we should also rewrite the
area (fill it with zeros) so that the hypervisor is not left with a
plaintext view of the earlier data.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: clean up used library classes
Laszlo Ersek [Wed, 2 Aug 2017 10:11:50 +0000 (12:11 +0200)]
OvmfPkg/IoMmuDxe: clean up used library classes

The following library classes are not used by this module, so remove them
from the INF file's [LibraryClasses] section:
- DxeServicesTableLib
- UefiLib

The following library classes are used by this module, so add them to the
INF file's [LibraryClasses] section:
- BaseMemoryLib (e.g. via CopyMem())
- MemoryAllocationLib (e.g. via AllocatePool())

Sort the list of library classes (in both "IoMmuDxe.inf" and
"AmdSevIoMmu.h").

Remove all non-local #include directives from "IoMmuDxe.c"; both C files
of this module include "AmdSevIoMmu.h", and "AmdSevIoMmu.h" includes all
non-local headers already.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: propagate errors from AmdSevInstallIoMmuProtocol()
Laszlo Ersek [Wed, 2 Aug 2017 10:20:14 +0000 (12:20 +0200)]
OvmfPkg/IoMmuDxe: propagate errors from AmdSevInstallIoMmuProtocol()

If we cannot install the IOMMU protocol for whatever reason, exit the
driver with an error. The same is already done for the IOMMU Absent
protocol.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: don't initialize local variables
Laszlo Ersek [Wed, 2 Aug 2017 10:03:27 +0000 (12:03 +0200)]
OvmfPkg/IoMmuDxe: don't initialize local variables

The edk2 coding style requires separate assignments.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: convert UINTN arguments to UINT64 for the %Lx fmt spec
Laszlo Ersek [Wed, 2 Aug 2017 09:42:14 +0000 (11:42 +0200)]
OvmfPkg/IoMmuDxe: convert UINTN arguments to UINT64 for the %Lx fmt spec

The portable way to print UINTN values is to use the %Lx format specifier,
and to convert the values to UINT64. The second step is currently missing,
add it.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: rename HostAddress to CryptedAddress in MAP_INFO
Laszlo Ersek [Wed, 2 Aug 2017 09:34:18 +0000 (11:34 +0200)]
OvmfPkg/IoMmuDxe: rename HostAddress to CryptedAddress in MAP_INFO

As a continuation of the last patch, clarify that the area pointed-to by
"HostAddress" is encrypted and hidden from the hypervisor.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: rename DeviceAddress to PlainTextAddress in MAP_INFO
Laszlo Ersek [Wed, 2 Aug 2017 09:26:42 +0000 (11:26 +0200)]
OvmfPkg/IoMmuDxe: rename DeviceAddress to PlainTextAddress in MAP_INFO

In this particular IOMMU driver, "DeviceAddress" is just as accessible to
the CPU as "HostAddress", the difference is that the area pointed-to by
the former is plain-text and accessible to the hypervisor. Rename
"DeviceAddress" to "PlainTextAddress" in MAP_INFO.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: rewrap source code to 79 characters
Laszlo Ersek [Wed, 2 Aug 2017 09:20:03 +0000 (11:20 +0200)]
OvmfPkg/IoMmuDxe: rewrap source code to 79 characters

No functional changes.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
6 years agoOvmfPkg/IoMmuDxe: Fix header guard macro
Thomas Palmer [Fri, 4 Aug 2017 20:28:17 +0000 (15:28 -0500)]
OvmfPkg/IoMmuDxe: Fix header guard macro

Correct the header guard macro

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
6 years agoMdeModulePkg/DisplayEngine: Fix incorrect display issue
Dandan Bi [Fri, 28 Jul 2017 02:40:14 +0000 (10:40 +0800)]
MdeModulePkg/DisplayEngine: Fix incorrect display issue

In a form, some new menus may be dynamically inserted between highlight
menu and previous top of screen menu when some question are refreshed.
So the highlight menu and previous top of screen menu perhaps can't be
shown in one page. Existing codes miss to handle this case then will
cause incorrect display.This patch is to fix this display issue.

Cc: Eric Dong <eric.dong@intel.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: Eric Dong <eric.dong@intel.com>
6 years agoBaseTools/VfrCompile: Remove the MAX_PATH limitation
Dandan Bi [Fri, 28 Jul 2017 08:19:22 +0000 (16:19 +0800)]
BaseTools/VfrCompile: Remove the MAX_PATH limitation

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=579

Since we have already used LongFilePath() to convert
file path, so we can remove the MAX_PATH limitation.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Daniel Díaz <daniel.diaz@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
6 years agoBaseTools/VfrCompile: Fix segmentation fault issues
Dandan Bi [Tue, 11 Jul 2017 07:35:14 +0000 (15:35 +0800)]
BaseTools/VfrCompile: Fix segmentation fault issues

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=532

(1) Add NULL check before using a pointer.
(2) Use "%s" format string in DebugError function to
    avoid crash caused by incorrect input.

Cc: Bo Chen <chenbo@pdx.edu>
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: Eric Dong <eric.dong@intel.com>
6 years agoNetworkPkg: iSCSI should allow to set 6 or 12 length of ISID keyword.
Fu Siyuan [Thu, 3 Aug 2017 06:38:51 +0000 (14:38 +0800)]
NetworkPkg: iSCSI should allow to set 6 or 12 length of ISID keyword.

The last 3 bytes of ISID should be able to changed by setting the keyword with
a value with length 6 (only last 3 bytes) or 12 (full ISID) according to the
keyword definition in UEFI configuration namespace website.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoUefiCpuPkg: Enable Processor Trace feature.
Eric Dong [Fri, 4 Aug 2017 01:59:08 +0000 (09:59 +0800)]
UefiCpuPkg: Enable Processor Trace feature.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoUefiCpuPkg: Add Processor Trace feature definition.
Eric Dong [Wed, 19 Jul 2017 02:16:20 +0000 (10:16 +0800)]
UefiCpuPkg: Add Processor Trace feature definition.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoUefiCpuPkg: Add Pcds used by processor trace feature.
Eric Dong [Wed, 19 Jul 2017 01:00:30 +0000 (09:00 +0800)]
UefiCpuPkg: Add Pcds used by processor trace feature.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoUefiCpuPkg/Msr: Add a missing IvyBridge processor signature
Hao Wu [Wed, 2 Aug 2017 08:15:53 +0000 (16:15 +0800)]
UefiCpuPkg/Msr: Add a missing IvyBridge processor signature

This commit modifies the CPUID signature check MACRO for IvyBridge
processor by adding a missing DisplayModel 0x3E. The missing one appears
at Section 35.10.1 to Section 35.10.3 of the Intel(R) 64 and IA-32
Architectures Software Developer's Manual, Volume 3, September 2016.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
6 years agoMdeModulePkg PeiCore: Install SEC HOB data
Star Zeng [Tue, 1 Aug 2017 05:47:08 +0000 (13:47 +0800)]
MdeModulePkg PeiCore: Install SEC HOB data

If the EFI_SEC_HOB_DATA_PPI is in the list of PPIs passed to the PEI
entry point, the PEI Foundation will call the GetHobs() member
function and install all HOBs returned into the HOB list. It does
this after installing all PPIs passed from SEC into the PPI database
and before dispatching any PEIMs.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdePkg: Add definition for SecHobData PPI
Star Zeng [Wed, 19 Jul 2017 05:52:24 +0000 (13:52 +0800)]
MdePkg: Add definition for SecHobData PPI

This PPI is introduced in PI Version 1.5.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoUefiCpuPkg PiSmmCpuDxeSmm: Check LMCE capability when wait for AP.
Eric Dong [Thu, 20 Jul 2017 12:07:46 +0000 (20:07 +0800)]
UefiCpuPkg PiSmmCpuDxeSmm: Check LMCE capability when wait for AP.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoUefiCpuPkg CpuCommonFeaturesLib: Enable LMCE feature.
Eric Dong [Fri, 4 Aug 2017 00:46:41 +0000 (08:46 +0800)]
UefiCpuPkg CpuCommonFeaturesLib: Enable LMCE feature.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoUefiCpuPkg: Add definition for LMCE feature.
Eric Dong [Thu, 20 Jul 2017 12:05:43 +0000 (20:05 +0800)]
UefiCpuPkg: Add definition for LMCE feature.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoOvmfPkg: Undo removal of License.txt
Michael D Kinney [Thu, 3 Aug 2017 18:44:31 +0000 (11:44 -0700)]
OvmfPkg: Undo removal of License.txt

Undo removal of OvmfPkg/License.txt in commit

https://github.com/tianocore/edk2/commit/2a98de03444e6a1e04030e70bb85e62de6b82edc

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Andrew Fish <afish@apple.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoedk2: Add Readme.md to root of edk2 repository
Michael D Kinney [Wed, 19 Jul 2017 21:28:14 +0000 (14:28 -0700)]
edk2: Add Readme.md to root of edk2 repository

https://bugzilla.tianocore.org/show_bug.cgi?id=643

Add Readme.md with a brief description of the EDK II
open source project along with links to contribution
agreement, licenses, and resources.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Andrew Fish <afish@apple.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoedk2: Move License.txt file to root
Michael D Kinney [Wed, 19 Jul 2017 21:30:30 +0000 (14:30 -0700)]
edk2: Move License.txt file to root

https://bugzilla.tianocore.org/show_bug.cgi?id=642

Add top level License.txt file with the BSD 2-Clause
License that is used by the majority of the EKD II open
source project content.  Merge copyright statements
from the BSD 2-Clause License files in each package
directory and remove the duplication License.txt
file from package directories.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Andrew Fish <afish@apple.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoedk2: Reformat TianoCore Contribution Agreement 1.1
Michael D Kinney [Mon, 24 Jul 2017 21:53:10 +0000 (14:53 -0700)]
edk2: Reformat TianoCore Contribution Agreement 1.1

https://bugzilla.tianocore.org/show_bug.cgi?id=629

Update formatting of Contributions.txt to line wrap
at 80 columns.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Andrew Fish <afish@apple.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoedk2: Update to TianoCore Contribution Agreement 1.1
Michael D Kinney [Tue, 18 Jul 2017 20:59:21 +0000 (13:59 -0700)]
edk2: Update to TianoCore Contribution Agreement 1.1

https://bugzilla.tianocore.org/show_bug.cgi?id=629

Update the TianoCore Contribution Agreement from Version 1.0
to Version 1.1 to cover open source documentation associated
with the TianoCore project.

Version 1.0 covers source code files.  Version 1.1 is a
backwards compatible extension that adds support for document
files in both source form and compiled form.

The edk2 repository is updated so the same contribution
agreement is used by developers that work on TianoCore
related source code or TianoCore related documents.

Links to RFC and Wiki on the GitBook documentation process
* https://lists.01.org/pipermail/edk2-devel/2017-March/008654.html
* https://github.com/tianocore-docs/edk2-TemplateSpecification/wiki

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Andrew Fish <afish@apple.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoedk2: Move TianoCore Contribution Agreement to root
Michael D Kinney [Tue, 18 Jul 2017 20:34:33 +0000 (13:34 -0700)]
edk2: Move TianoCore Contribution Agreement to root

https://bugzilla.tianocore.org/show_bug.cgi?id=629

Move Contributions.txt that contains the TianoCore
Contribution Agreement 1.0 to the root of the edk2
repository and remove the duplicate Contributions.txt
files from all packages.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Andrew Fish <afish@apple.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoBaseTools/PatchCheck: Support Contribution Agreement 1.1
Michael D Kinney [Wed, 12 Jul 2017 20:11:07 +0000 (13:11 -0700)]
BaseTools/PatchCheck: Support Contribution Agreement 1.1

https://bugzilla.tianocore.org/show_bug.cgi?id=628

Update PatchCheck.py to support either
"Contributed-under: TianoCore Contribution Agreement 1.0"
or "Contributed-under: TianoCore Contribution Agreement 1.1"
in the commit message.

Temporarily continue to allow the TianoCore Contribution
Agreement 1.0 agreement.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Andrew Fish <afish@apple.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoNetworkPkg: Display HTTP redirection info to the screen if need.
Fu Siyuan [Wed, 26 Jul 2017 07:57:38 +0000 (15:57 +0800)]
NetworkPkg: Display HTTP redirection info to the screen if need.

HTTP defines a set of status code for redirecting a request to a different URI
in Section 6.4 of RFC7231 and also RFC7583. This patch updates the HTTP boot
driver to display the redirection info to the screen so the user would have
chance to know new URI address of the HTTP boot image.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
6 years agoShellPkg/dblk: Honor the BlockIo alignment requirement.
HuajingLi [Tue, 1 Aug 2017 04:30:18 +0000 (12:30 +0800)]
ShellPkg/dblk: Honor the BlockIo alignment requirement.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Huajing Li <huajing.li@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoUefiCpuPkg/CpuCommonFeaturesLib: Fix the documentation of PpinSupport().
Marvin.Haeuser@outlook.com [Fri, 21 Jul 2017 10:20:22 +0000 (18:20 +0800)]
UefiCpuPkg/CpuCommonFeaturesLib: Fix the documentation of PpinSupport().

The documentation of PpinSupport() refers to 'Enhanced Intel
SpeedStep'. This patch fixes these referneces.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoMdeModulePkg/Ufs: Set 'Data Segment Length' field for Write Descriptor
Hao Wu [Thu, 15 Jun 2017 07:15:59 +0000 (15:15 +0800)]
MdeModulePkg/Ufs: Set 'Data Segment Length' field for Write Descriptor

According to the Universal Flash Storage (UFS) Version 2.1 (JESD220C) spec
Section 10.7.8.5, the DATA SEGMENT LENGTH field of the UPIU shall also be
set to number of descriptor bytes to write.

The origin codes miss the above operation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdeModulePkg/UfsPassThruDxe: Add impl of UFS Device Config Protocol
Hao Wu [Mon, 19 Jun 2017 02:53:34 +0000 (10:53 +0800)]
MdeModulePkg/UfsPassThruDxe: Add impl of UFS Device Config Protocol

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoUefiCpuPkg SecCore: Fix operands of different size in bitwise operation
Star Zeng [Wed, 2 Aug 2017 02:07:31 +0000 (10:07 +0800)]
UefiCpuPkg SecCore: Fix operands of different size in bitwise operation

It is introduced by 9e9ca2100f22be29f1a53129d741f4305ff34a71.

Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdePkg/Ftp4: Fix wrong function pointer declaration
Alcantara, Paulo [Tue, 6 Jun 2017 00:33:36 +0000 (08:33 +0800)]
MdePkg/Ftp4: Fix wrong function pointer declaration

EFI_FTP4_DATA_CALLBACK is a function pointer and defined as follows:

> typedef
> EFI_STATUS
> (EFIAPI *EFI_FTP4_DATA_CALLBACK)(
>  IN EFI_FTP4_PROTOCOL           *This,
>  IN EFI_FTP4_COMMAND_TOKEN      *Token
>  );

And EFI_FTP4_COMMAND_TOKEN structure declared it as:

> EFI_FTP4_DATA_CALLBACK *DataCallback

Which ended up being a pointer to function pointer and clearly wrong.
This patch fixes it by removing the misleading '*' from declaration.
It's also fixed in new UEFI 2.7 spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Paulo Alcantara <paulo.alc.cavalcanti@hp.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoNetworkPkg/HttpDxe: Destroy the TLS instance when cleaning up the HTTP child
Jiaxin Wu [Mon, 31 Jul 2017 05:36:37 +0000 (13:36 +0800)]
NetworkPkg/HttpDxe: Destroy the TLS instance when cleaning up the HTTP child

During clean up the HTTP child, all resources used by it should be cleaned. But
currently, TLS instance is not destroyed.

This patch is to fix this issue.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoCryptoPkg/TlsLib: Remove the redundant free of BIO objects
Jiaxin Wu [Mon, 31 Jul 2017 05:29:40 +0000 (13:29 +0800)]
CryptoPkg/TlsLib: Remove the redundant free of BIO objects

TLS BIO objects (InBio/OutBio) will be freed by SSL_free() function.
So, the following free operation (BIO_free) in TlsFree is redundant.
It can be removed directly.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Long Qin <qin.long@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoNetworkPkg/Ip6Dxe: Fix the IPv6 PXE boot option goes missing issue
Jiaxin Wu [Sun, 30 Jul 2017 13:52:02 +0000 (21:52 +0800)]
NetworkPkg/Ip6Dxe: Fix the IPv6 PXE boot option goes missing issue

This patch is to fix the potential issue recorded at Bugzilla 636:
https://bugzilla.tianocore.org/show_bug.cgi?id=636

The issue is caused by the IPv6 policy switching after PXEv6 boot. When IP
policy is changing, the IPv6 children used by PXE.UdpRead() will be destroyed.
Then, PXE Stop() function is called to uninstall the devicePath protocol,
which leads to the IPv6 PXE boot option goes missing.

Through the above analysis, the IP driver should take the responsibility for
the upper layer network stacks recovery by using ConnectController().

Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Cc: Subramanian Sriram <sriram-s@hpe.com>
Cc: Ni Ruiyu <ruiyu.ni@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-by: Subramanian Sriram <sriram-s@hpe.com>
Tested-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
6 years agoNetworkPkg/HttpBootDxe: Fix spelling typo in EFI_HTTP_STATUS_CODE
Jiaxin Wu [Tue, 25 Jul 2017 12:49:27 +0000 (20:49 +0800)]
NetworkPkg/HttpBootDxe: Fix spelling typo in EFI_HTTP_STATUS_CODE

"HTTP_STATUS_300_MULTIPLE_CHIOCES"
This should instead be:
"HTTP_STATUS_300_MULTIPLE_CHOICES"

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoMdeModulePkg/DxeHttpLib: Fix spelling typo in EFI_HTTP_STATUS_CODE
Jiaxin Wu [Tue, 25 Jul 2017 12:48:12 +0000 (20:48 +0800)]
MdeModulePkg/DxeHttpLib: Fix spelling typo in EFI_HTTP_STATUS_CODE

"HTTP_STATUS_300_MULTIPLE_CHIOCES"
This should instead be:
"HTTP_STATUS_300_MULTIPLE_CHOICES"

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoMdePkg/Http.h: Fix spelling typo in EFI_HTTP_STATUS_CODE
Jiaxin Wu [Tue, 25 Jul 2017 12:47:09 +0000 (20:47 +0800)]
MdePkg/Http.h: Fix spelling typo in EFI_HTTP_STATUS_CODE

"HTTP_STATUS_300_MULTIPLE_CHIOCES"
This should instead be:
"HTTP_STATUS_300_MULTIPLE_CHOICES"

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoNetworkPkg/HttpDxe: Refine the coding style.
Jiaxin Wu [Tue, 25 Jul 2017 12:32:35 +0000 (20:32 +0800)]
NetworkPkg/HttpDxe: Refine the coding style.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoMdePkg/Http.h: Refine the coding style.
Jiaxin Wu [Tue, 25 Jul 2017 12:31:58 +0000 (20:31 +0800)]
MdePkg/Http.h: Refine the coding style.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoIntelSiliconPkg/IntelVTdDxe: Add explicit NULL pointer checks
Hao Wu [Tue, 1 Aug 2017 03:50:39 +0000 (11:50 +0800)]
IntelSiliconPkg/IntelVTdDxe: Add explicit NULL pointer checks

Add explicit NULL pointer check to make the codes more straight-forward.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>