]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
4 years agoUefiCpuPkg/PiSmmCpuDxeSmm: Enable MM MP Protocol
Eric Dong [Wed, 10 Jul 2019 07:49:11 +0000 (15:49 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Enable MM MP Protocol

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

Add MM Mp Protocol in PiSmmCpuDxeSmm driver.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
4 years agoMdePkg: Add new MM MP Protocol definition.
Eric Dong [Mon, 1 Jul 2019 04:37:24 +0000 (12:37 +0800)]
MdePkg: Add new MM MP Protocol definition.

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

EFI MM MP Protocol is defined in the PI 1.5 specification.

The MM MP protocol provides a set of functions to allow execution of
procedures on processors that have entered MM. This protocol has the
following properties:
1. The caller can invoke execution of a procedure on a processor, other
than the caller, that has also entered MM. Supports blocking and
non-blocking modes of operation.
2. The caller can invoke a procedure on multiple processors. Supports
blocking and non-blocking modes of operation.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
4 years agoBaseTools: Fix python3.8 SyntaxWarning
Cole Robinson [Fri, 12 Jul 2019 17:29:28 +0000 (01:29 +0800)]
BaseTools: Fix python3.8 SyntaxWarning

Building with python3.8 shows a warning like:

SyntaxWarning: invalid escape sequence \(
  GuidName = re.compile("\(GUID=[-a-fA-F0-9]+")

It seems harmless, but it's easy enough to fix: mark the string as
raw with the 'r' prefix like is used elsewhere in the file

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoEmulatorPkg/Unix: Convert timezone from seconds to minutes
Jordan Justen [Sat, 13 Jul 2019 00:34:55 +0000 (17:34 -0700)]
EmulatorPkg/Unix: Convert timezone from seconds to minutes

Fixes and assert seen when running ls under the shell. It appears the
assert was added in:

commit 99849a906e15ea3a9a0330d69bbae0d21ff49808

    ShellPkg/ls: Display the file time in local time.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoEmulatorPkg/build.sh: Fix missing usage of -b BUILDTARGET parameter
Jordan Justen [Sun, 18 Nov 2018 08:06:04 +0000 (00:06 -0800)]
EmulatorPkg/build.sh: Fix missing usage of -b BUILDTARGET parameter

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoEmulatorPkg: update HOST_TOOLS to xcode5
Stephano Cetola [Wed, 19 Jun 2019 16:57:20 +0000 (09:57 -0700)]
EmulatorPkg: update HOST_TOOLS to xcode5

The last compiler flag change was for Xcode 5.0, not Xcode 3.2. As such
the HOST_TOOLS should be set to XCODE5.

Also, fix a small typo.

This fixes bug 447:

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

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
4 years agoFmpDevicePkg: Fix various typos
Antoine Cœur [Thu, 11 Jul 2019 07:42:30 +0000 (15:42 +0800)]
FmpDevicePkg: Fix various typos

Fix one typo in FmpDevicePkg.

Signed-off-by: Cœur <coeur@gmx.fr>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoBaseTools: Add HOST_APPLICATION module type.
Jiewen Yao [Mon, 1 Jul 2019 06:19:13 +0000 (06:19 +0000)]
BaseTools: Add HOST_APPLICATION module type.

It can be used to indicate a module can be build to run
as OS application and run in OS environment.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Xiaoyu Lu <xiaoyux.lu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoBaseTools: Fixed the issue when ToolDefinitionFile is not generated
Bob Feng [Thu, 11 Jul 2019 00:57:58 +0000 (08:57 +0800)]
BaseTools: Fixed the issue when ToolDefinitionFile is not generated

ToolDefinitionFile is generated by PlatformAutoGen.ToolDefinition()
Code assume ToolDefinition is always called before using
ToolDefinitionFile, but in some cases, it's not true.

This patch is to fix this issue.

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoUefiCpuPkg/PiSmmCpu: ReclaimPages: fix incorrect operator binding
Ray Ni [Thu, 11 Jul 2019 01:16:03 +0000 (09:16 +0800)]
UefiCpuPkg/PiSmmCpu: ReclaimPages: fix incorrect operator binding

Fixes: 4eee0cc7c
Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoUefiCpuPkg/PiSmmCpu: Enable 5 level paging when CPU supports
Ray Ni [Wed, 12 Jun 2019 09:26:45 +0000 (17:26 +0800)]
UefiCpuPkg/PiSmmCpu: Enable 5 level paging when CPU supports

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

The patch changes SMM environment to use 5 level paging when CPU
supports it.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
(cherry picked from commit 7365eb2c8cf1d7112330d09918c0c67e8d0b827a)

4 years agoMdePkg/BaseLib.h: Update IA32_CR4 structure for 5-level paging
Ray Ni [Wed, 12 Jun 2019 03:04:52 +0000 (11:04 +0800)]
MdePkg/BaseLib.h: Update IA32_CR4 structure for 5-level paging

5-level paging is documented in white paper:
https://software.intel.com/sites/default/files/managed/2b/80/5-level_paging_white_paper.pdf

Commit f8113e25001e715390127f23e2197252cbd6d1a2
changed Cpuid.h already.

This patch updates IA32_CR4 structure to include LA57 field.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
(cherry picked from commit 7c5010c7f88b790f4524c4a5311819e3af5e2752)

4 years agoRevert "MdePkg/BaseLib.h: Update IA32_CR4 structure for 5-level paging"
Ray Ni [Fri, 12 Jul 2019 07:11:02 +0000 (15:11 +0800)]
Revert "MdePkg/BaseLib.h: Update IA32_CR4 structure for 5-level paging"

This reverts commit 7c5010c7f88b790f4524c4a5311819e3af5e2752.
Commit
7c5010c7f8 MdePkg/BaseLib.h: Update IA32_CR4 structure for 5-level paging
technically breaks the EDKII development process documented in
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Development-Process
and Maintainers.txt in EDKII repo root directory.

The voilation is commit 7c5010c7f8 doesn't have a Reviewed-by or
Acked-by from MdePkg maintainers.

Signed-off-by: Ray Ni <ray.ni@intel.com>
4 years agoRevert "UefiCpuPkg/PiSmmCpu: Enable 5 level paging when CPU supports"
Ray Ni [Fri, 12 Jul 2019 06:59:32 +0000 (14:59 +0800)]
Revert "UefiCpuPkg/PiSmmCpu: Enable 5 level paging when CPU supports"

This reverts commit 7365eb2c8cf1d7112330d09918c0c67e8d0b827a.
Commit
7c5010c7f8 MdePkg/BaseLib.h: Update IA32_CR4 structure for 5-level paging
technically breaks the EDKII development process documented in
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Development-Process
and Maintainers.txt in EDKII repo root directory.

The voilation is commit 7c5010c7f8 doesn't have a Reviewed-by or
Acked-by from MdePkg maintainers.

In order to revert 7c5010c7f87365eb2c8 needs to revert first otherwise
simply reverting 7c5010c7f8 will cause build break.

Signed-off-by: Ray Ni <ray.ni@intel.com>
4 years agoMaintainers.txt: Remove maintainer info for IntelFsp[Wrapper]Pkg
Ray Ni [Wed, 10 Jul 2019 08:04:40 +0000 (16:04 +0800)]
Maintainers.txt: Remove maintainer info for IntelFsp[Wrapper]Pkg

We removed IntelFspPkg and IntelFspWrapperPkg for
<https://bugzilla.tianocore.org/show_bug.cgi?id=1819>; now remove
the dangling maintainer/reviewer assignments too.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Andrew Fish <afish@apple.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
4 years agoIntelFsp2Pkg: Fix various typos
Antoine Cœur [Thu, 11 Jul 2019 08:54:31 +0000 (16:54 +0800)]
IntelFsp2Pkg: Fix various typos

Fix various typos in IntelFsp2Pkg.

Signed-off-by: Cœur <coeur@gmx.fr>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
4 years agoRevert "FmpDevicePkg: Fix various typos"
Antoine Cœur [Thu, 11 Jul 2019 08:31:15 +0000 (16:31 +0800)]
Revert "FmpDevicePkg: Fix various typos"

This reverts commit f527942e6bdd9f198db90f2de99a0482e9be5b1b.
Commit message was incorrect.

Signed-off-by: Cœur <coeur@gmx.fr>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
4 years agoUefiCpuPkg RegisterCpuFeaturesLib: Fix an ASSERTION issue
Star Zeng [Wed, 10 Jul 2019 11:40:05 +0000 (19:40 +0800)]
UefiCpuPkg RegisterCpuFeaturesLib: Fix an ASSERTION issue

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

We met assertion like below, it happens when there is only
one processor.

ASSERT_EFI_ERROR (Status = Not started)
ASSERT [CpuFeaturesDxe] X:\XXX\XXX\RegisterCpuFeaturesLib\
  DxeRegisterCpuFeaturesLib.c(149): !EFI_ERROR (Status)

The code should not call StartupAllAPs when there is only one processor.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Chandana Kumar <chandana.c.kumar@intel.com>
Cc: Kevin Li <kevin.y.li@intel.com>
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
4 years agoRevert "BaseTools/BfmLib: Add a tool BfmLib"
Liming Gao [Wed, 10 Jul 2019 15:25:23 +0000 (23:25 +0800)]
Revert "BaseTools/BfmLib: Add a tool BfmLib"

This reverts commit dc7b0dc8d662b3bedece2cf1015e2a94884cb111.
There are the concerns on code design and code quality, and
request to rewrite FCE, BfmLib and FMMT for the review.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Feng Bob C <bob.c.feng@intel.com>
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Bob C <bob.c.feng@intel.com>
4 years agoRevert "BaseTools/FCE: Add a tool FCE"
Liming Gao [Wed, 10 Jul 2019 15:25:21 +0000 (23:25 +0800)]
Revert "BaseTools/FCE: Add a tool FCE"

This reverts commit 3c59d94637adbfdd497b5a2c16073c7dc62b669c.
There are the concerns on code design and code quality, and
request to rewrite FCE, BfmLib and FMMT for the review.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Feng Bob C <bob.c.feng@intel.com>
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Bob C <bob.c.feng@intel.com>
4 years agoRevert "BaseTools/FMMT: Add a tool FMMT"
Liming Gao [Wed, 10 Jul 2019 15:25:18 +0000 (23:25 +0800)]
Revert "BaseTools/FMMT: Add a tool FMMT"

This reverts commit 080981d72dcbb782ad73716c439639324b0aa4dd.
There are the concerns on code design and code quality, and
request to rewrite FCE, BfmLib and FMMT for the review.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Feng Bob C <bob.c.feng@intel.com>
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Bob C <bob.c.feng@intel.com>
4 years agoRevert "BaseTools: fix FCE build when edksetup not executed"
Liming Gao [Wed, 10 Jul 2019 15:24:57 +0000 (23:24 +0800)]
Revert "BaseTools: fix FCE build when edksetup not executed"

This reverts commit d031fc07eb83c9d13bff3ebac25da458d5a47917.
There are the concerns on code design and code quality, and
request to rewrite FCE, BfmLib and FMMT for the review.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Feng Bob C <bob.c.feng@intel.com>
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Bob C <bob.c.feng@intel.com>
4 years agoRevert "BaseTools/FMMT: Change FMMT script type in PosixLike"
Liming Gao [Wed, 10 Jul 2019 15:24:30 +0000 (23:24 +0800)]
Revert "BaseTools/FMMT: Change FMMT script type in PosixLike"

This reverts commit 2112fc71b1112554bcfb75a454002d2bbeed552f.
There are the concerns on code design and code quality, and
request to rewrite FCE, BfmLib and FMMT for the review.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Feng Bob C <bob.c.feng@intel.com>
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Bob C <bob.c.feng@intel.com>
4 years agoRevert "BaseTools/BfmLib: Change BfmLib script type in PosixLike"
Liming Gao [Wed, 10 Jul 2019 15:24:27 +0000 (23:24 +0800)]
Revert "BaseTools/BfmLib: Change BfmLib script type in PosixLike"

This reverts commit 556bf5b3570a2290ad82c1a027740e72230baa26.
There are the concerns on code design and code quality, and
request to rewrite FCE, BfmLib and FMMT for the review.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Feng Bob C <bob.c.feng@intel.com>
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Bob C <bob.c.feng@intel.com>
4 years agoRevert "BaseTools/FCE: Change FCE script type in PosixLike"
Liming Gao [Wed, 10 Jul 2019 15:24:20 +0000 (23:24 +0800)]
Revert "BaseTools/FCE: Change FCE script type in PosixLike"

This reverts commit 8a842b31b93323ee3dc7631059292d30f6179cd3.
There are the concerns on code design and code quality, and
request to rewrite FCE, BfmLib and FMMT for the review.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Feng Bob C <bob.c.feng@intel.com>
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Bob C <bob.c.feng@intel.com>
4 years agoArmPlatformPkg: Actually disable PL031 interrupts
Alexander Graf [Wed, 10 Jul 2019 14:53:11 +0000 (16:53 +0200)]
ArmPlatformPkg: Actually disable PL031 interrupts

The PL031 interrupt mask register (IMSC) is not very clearly documented
in the PL031 specification. However, bit 0 (RTCIMSC) indicates whether
interrupts are enabled, not disabled.

So before this commit, we were actually *enabling* interrupts for the RTC.

This patch changes the logic to instead disable interrupts when they
are not disabled already.

Signed-off-by: Alexander Graf <graf@amazon.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoUefiCpuPkg/PiSmmCpu: Enable 5 level paging when CPU supports
Ray Ni [Wed, 12 Jun 2019 09:26:45 +0000 (17:26 +0800)]
UefiCpuPkg/PiSmmCpu: Enable 5 level paging when CPU supports

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

The patch changes SMM environment to use 5 level paging when CPU
supports it.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
4 years agoMdePkg/BaseLib.h: Update IA32_CR4 structure for 5-level paging
Ray Ni [Wed, 12 Jun 2019 03:04:52 +0000 (11:04 +0800)]
MdePkg/BaseLib.h: Update IA32_CR4 structure for 5-level paging

5-level paging is documented in white paper:
https://software.intel.com/sites/default/files/managed/2b/80/5-level_paging_white_paper.pdf

Commit f8113e25001e715390127f23e2197252cbd6d1a2
changed Cpuid.h already.

This patch updates IA32_CR4 structure to include LA57 field.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
4 years agoUefiCpuPkg/PiSmmCpu: Change variable names and comments to follow SDM
Ray Ni [Wed, 12 Jun 2019 02:14:42 +0000 (10:14 +0800)]
UefiCpuPkg/PiSmmCpu: Change variable names and comments to follow SDM

Per SDM, for IA-32e 4-KByte paging, there are four layers in the page
table structure:
1. PML4
2. Page-Directory-Pointer Table (PDPT)
3. Page-Directory (PD)
4. Page Table (PT)

The patch changes the local variable names and comments to use
"PML4", "PDPT", "PD", "PT" to better align to terms used in SDM.

There is no functionality impact for this change.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
4 years agoMdeModulePkg/Setup: Check ConfigAccess protocol in case it's destroyed
GregX Yeh [Tue, 9 Jul 2019 11:46:54 +0000 (11:46 +0000)]
MdeModulePkg/Setup: Check ConfigAccess protocol in case it's destroyed

https://bugzilla.tianocore.org/show_bug.cgi?id=1920
Check ConfigAccess protocol is available before process user input.

Signed-off-by: GregX Yeh <gregx.yeh@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Ted Kuo <ted.kuo@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
4 years agoBaseTools: Detect the change of env variable used in tooldef.txt
Feng, Bob C [Thu, 27 Jun 2019 08:47:36 +0000 (16:47 +0800)]
BaseTools: Detect the change of env variable used in tooldef.txt

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

Add TOOLS_DEF.ARCH file to all workspace meta files list.
TOOLS_DEF.ARCH include the evaluated Tool definition information
which is filtered by current tool_chain.

With this change, when the environment variable which
is used in ToolDef.txt is changed, build tool will
rebuild the platform.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoBaseTools: Fixed the issue of the CFlag for compile PcdValueInit.c
Feng, Bob C [Mon, 1 Jul 2019 09:48:51 +0000 (17:48 +0800)]
BaseTools: Fixed the issue of the CFlag for compile PcdValueInit.c

This issue happens when using Structured PCD.
Build tool use set to store the cflags for compile PcdValueInit.c,
that is the order of cflags is disorder.

This patch make -U, /U flags appear before -D, /D

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoFmpDevicePkg: Fix various typos
Antoine Cœur [Tue, 9 Jul 2019 09:10:11 +0000 (17:10 +0800)]
FmpDevicePkg: Fix various typos

Fix one typo in FmpDevicePkg.

Signed-off-by: Cœur <coeur@gmx.fr>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
4 years agoBaseTools/FCE: Change FCE script type in PosixLike
Shenglei Zhang [Fri, 5 Jul 2019 14:21:33 +0000 (22:21 +0800)]
BaseTools/FCE: Change FCE script type in PosixLike

Change the script type from PC to UNIX.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoBaseTools/BfmLib: Change BfmLib script type in PosixLike
Shenglei Zhang [Fri, 5 Jul 2019 14:21:14 +0000 (22:21 +0800)]
BaseTools/BfmLib: Change BfmLib script type in PosixLike

Change the script type from PC to UNIX.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoBaseTools/FMMT: Change FMMT script type in PosixLike
Shenglei Zhang [Fri, 5 Jul 2019 11:11:37 +0000 (19:11 +0800)]
BaseTools/FMMT: Change FMMT script type in PosixLike

Change the script type from PC to UNIX.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoBaseTools: Fix various typos
Antoine Cœur [Thu, 4 Jul 2019 11:43:48 +0000 (19:43 +0800)]
BaseTools: Fix various typos

Fix various typos in BaseTools.

Signed-off-by: Cœur <coeur@gmx.fr>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoBaseTools: fix FCE build when edksetup not executed
Leif Lindholm [Fri, 5 Jul 2019 10:25:31 +0000 (11:25 +0100)]
BaseTools: fix FCE build when edksetup not executed

Commit 3c59d94637ad ("BaseTools/FCE: Add a tool FCE") added a new tool
that is always built. Pre-existing tools locate the makefile includes
with relative paths, but FCE uses EDK_TOOLS_PATH, adding a new dependency
on having sourced edksetup.sh before building BaseTools.

Change FCE GNUmakefile to match other tools.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMaintainers.txt: Change SecurityPkg Maintainer Role
Zhang, Chao B [Fri, 5 Jul 2019 03:41:26 +0000 (11:41 +0800)]
Maintainers.txt: Change SecurityPkg Maintainer Role

Change Chao's role to Reviewer

Cc: Wang Jian J <jian.j.wang@intel.com>
Signed-off-by: Zhang, Chao B <chao.b.zhang@intel.com>
Reviewed-by: Wang Jian J <jian.j.wang@intel.com>
4 years agoRevert "MdePkg/Protocol/Hash: introduce GUID for SM3"
Laszlo Ersek [Thu, 4 Jul 2019 09:21:46 +0000 (11:21 +0200)]
Revert "MdePkg/Protocol/Hash: introduce GUID for SM3"

This reverts commit 49c1e683c452f68c7315454280d81449f7d94d2b.

The reason is that said commit had not been reviewed by MdePkg
maintainers, before it was pushed.

Cc: Imran Desai <imran.desai@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1781
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
4 years agoRevert "SecurityPkg: introduce the SM3 digest algorithm"
Laszlo Ersek [Thu, 4 Jul 2019 09:20:27 +0000 (11:20 +0200)]
Revert "SecurityPkg: introduce the SM3 digest algorithm"

This reverts commit 06dd5863b66edd9908834371e07fb4e11383c172.

The reason is that said commit directly depends on commit 49c1e683c452
("MdePkg/Protocol/Hash: introduce GUID for SM3", 2019-07-03), and the
latter commit is going to be reverted, due to its review process not
having followed established edk2 norms.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Imran Desai <imran.desai@intel.com>
Cc: Jian Wang <jian.j.wang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1781
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
4 years agoRevert "SecurityPkg/HashLibBaseCryptoRouter: recognize the SM3 digest algorithm"
Laszlo Ersek [Thu, 4 Jul 2019 09:17:45 +0000 (11:17 +0200)]
Revert "SecurityPkg/HashLibBaseCryptoRouter: recognize the SM3 digest algorithm"

This reverts commit 542d04e2a4fec0df0340d2ad7b59f011f20d03cc.

The reason is that said commit indirectly depends on commit 49c1e683c452
("MdePkg/Protocol/Hash: introduce GUID for SM3", 2019-07-03), and the
latter commit is going to be reverted, due to its review process not
having followed established edk2 norms.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Imran Desai <imran.desai@intel.com>
Cc: Jian Wang <jian.j.wang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1781
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
4 years agoRevert "SecurityPkg: set SM3 bit in TPM 2.0 hash mask by default"
Laszlo Ersek [Thu, 4 Jul 2019 09:11:24 +0000 (11:11 +0200)]
Revert "SecurityPkg: set SM3 bit in TPM 2.0 hash mask by default"

This reverts commit d5af8fc5a975feb6c745587d0d834733ad2048fd.

The reason is that said commit indirectly depends on commit 49c1e683c452
("MdePkg/Protocol/Hash: introduce GUID for SM3", 2019-07-03), and the
latter commit is going to be reverted, due to its review process not
having followed established edk2 norms.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Imran Desai <imran.desai@intel.com>
Cc: Jian Wang <jian.j.wang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1781
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
4 years agoRevert "OvmfPkg: link SM3 support into Tcg2Pei and Tcg2Dxe"
Laszlo Ersek [Thu, 4 Jul 2019 09:08:07 +0000 (11:08 +0200)]
Revert "OvmfPkg: link SM3 support into Tcg2Pei and Tcg2Dxe"

This reverts commit a7c7d21ffa9ad14b418e728a882df0a9b8815bf6.

The reason is that said commit had not been reviewed by OvmfPkg
maintainers/reviewers, before it was pushed.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Imran Desai <imran.desai@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Stefan Berger <stefanb@linux.ibm.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1781
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
4 years agoOvmfPkg: use DxeTpmMeasurementLib if and only if TPM2_ENABLE
Gary Lin [Thu, 4 Jul 2019 04:07:59 +0000 (04:07 +0000)]
OvmfPkg: use DxeTpmMeasurementLib if and only if TPM2_ENABLE

(a) OvmfPkg first had to resolve the TpmMeasurementLib class -- for
    SECURE_BOOT_ENABLE only -- when the DxeImageVerificationLib instance
    became dependent on TpmMeasurementLib. For details, refer to commit
    0d28d286bf4d ("OvmfPkg: resolve TpmMeasurementLib dependency
    introduced in r14687", 2013-09-21).

(b) At the time, only one instance of TpmMeasurementLib existed, namely
    DxeTpmMeasurementLib. This lib instance didn't do anything -- like it
    was desirable for OVMF --, because OVMF didn't include any Tcg / TrEE
    protocol implementations.

(c) In commit 308521b13354 ("MdeModulePkg: Move TpmMeasurementLib
    LibraryClass from SecurityPkg", 2015-07-01), TpmMeasurementLibNull was
    introduced.

(d) In commit 285542ebbb03 ("OvmfPkg: Link AuthVariableLib for following
    merged variable driver deploy", 2015-07-01), a TpmMeasurementLib
    resolution became necessary regardless of SECURE_BOOT_ENABLE. And so
    TpmMeasurementLib was resolved to TpmMeasurementLibNull in OVMF, but
    only in the non-SECURE_BOOT_ENABLE case. This step -- possibly, the
    larger series containing commit 285542ebbb03 -- missed an opportunity
    for simplification: given (b), the DxeTpmMeasurementLib instance
    should have been simply replaced with the TpmMeasurementLibNull
    instance, regardless of SECURE_BOOT_ENABLE.

(e) In commit 1abfa4ce4835 ("Add TPM2 support defined in trusted computing
    group.", 2015-08-13), the TrEE dependency was replaced with a Tcg2
    dependency in DxeTpmMeasurementLib.

(f) Starting with commit 0c0a50d6b3ff ("OvmfPkg: include Tcg2Dxe module",
    2018-03-09), OVMF would include a Tcg2 protocol implementation,
    thereby satisfying DxeTpmMeasurementLib's dependency. With
    TPM2_ENABLE, it would actually make sense to consume
    DxeTpmMeasurementLib -- however, DxeTpmMeasurementLib would never be
    used without SECURE_BOOT_ENABLE.

Therefore, we have the following four scenarios:

- TPM2_ENABLE + SECURE_BOOT_ENABLE: works as expected.

- Neither enabled: works as expected.

- Only TPM2_ENABLE: this build is currently incorrect, because
  Variable/RuntimeDxe consumes TpmMeasurementLib directly, but
  TpmMeasureAndLogData() will never reach the TPM because we link
  TpmMeasurementLibNull into the variable driver. This is a problem from
  the larger series containing (f).

- Only SECURE_BOOT_ENABLE: this build works as expected, but it is
  wasteful -- given that the protocol database will never contain Tcg2
  without TPM2_ENABLE, we should simply use TpmMeasurementLibNull. This is
  a problem from (d).

Resolving TpmMeasurementLib to DxeTpmMeasurementLib as a function of
*only* TPM2_ENABLE, we can fix / optimize the last two cases.

v2:
  - Amend the title and description suggested by Laszlo
  - Move TpmMeasurementLib to the existed TPM2_ENABLE block

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Gary Lin <glin@suse.com>
Message-Id: <20190704040731.5303-1-glin@suse.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoEmbeddedPkg: Fix various typos
Cœur [Wed, 3 Jul 2019 13:25:30 +0000 (14:25 +0100)]
EmbeddedPkg: Fix various typos

Fix various typos in EmbeddedPkg.

Signed-off-by: Coeur <coeur@gmx.fr>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoArmPlatformPkg: Fix various typos
Antoine Cœur [Wed, 6 Feb 2019 15:40:38 +0000 (23:40 +0800)]
ArmPlatformPkg: Fix various typos

Fix various typos in ArmPlatformPkg.

Signed-off-by: Coeur <coeur@gmx.fr>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoArmPkg: Fix various typos
Antoine Cœur [Wed, 6 Feb 2019 15:39:35 +0000 (23:39 +0800)]
ArmPkg: Fix various typos

Fix various typos in ArmPkg.

Signed-off-by: Coeur <coeur@gmx.fr>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
4 years agoBaseTools/FMMT: Add a tool FMMT
Shenglei Zhang [Tue, 28 May 2019 03:01:47 +0000 (11:01 +0800)]
BaseTools/FMMT: Add a tool FMMT

FMMT is a tool to enable removal, addition and replacement of
FFS files in FD image binaries.
https://bugzilla.tianocore.org/show_bug.cgi?id=1847

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoBaseTools/FCE: Add a tool FCE
Shenglei Zhang [Tue, 28 May 2019 08:07:43 +0000 (16:07 +0800)]
BaseTools/FCE: Add a tool FCE

FCE is a tool to retrieve and change HII configuration data in
Firmware Device(*.fd) files.
https://bugzilla.tianocore.org/show_bug.cgi?id=1848

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoBaseTools/BfmLib: Add a tool BfmLib
Shenglei Zhang [Wed, 29 May 2019 07:22:32 +0000 (15:22 +0800)]
BaseTools/BfmLib: Add a tool BfmLib

BmfLib is added for FCE tool.
https://bugzilla.tianocore.org/show_bug.cgi?id=1848

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoMaintainers.txt: Drop deprecated SourceForge SVN link
Hao A Wu [Thu, 27 Jun 2019 05:41:42 +0000 (13:41 +0800)]
Maintainers.txt: Drop deprecated SourceForge SVN link

The commit will remove the deprecated edk2 SVN mirror at:
https://svn.code.sf.net/p/edk2/code/trunk/edk2

After this commit, the above mirror will not be synced with the changes
made in the GitHub upstream.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoMaintainers.txt: add Leif Lindholm as Package Reviewer of ArmVirtPkg
Leif Lindholm [Wed, 3 Jul 2019 10:27:41 +0000 (11:27 +0100)]
Maintainers.txt: add Leif Lindholm as Package Reviewer of ArmVirtPkg

ArmVirtPkg was created before we introduced the Package Reviewer (R:)
role in Maintainers.txt. However, we have always had an informal
agreement that if Ard or Laszlo is absent, I can review patches by
the still present one for going into ArmVirtPkg.

Plus, as one of the ArmPkg maintainers, it makes sense for me to have
better visibility of goings-on in ArmVirtPkg.

So let's formalise that, and add myself as a Package Reviewer, to be
CC:d on patches (while not taking up full maintainer responsibilities).

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoOvmfPkg: link SM3 support into Tcg2Pei and Tcg2Dxe
Imran Desai [Wed, 29 May 2019 04:40:49 +0000 (04:40 +0000)]
OvmfPkg: link SM3 support into Tcg2Pei and Tcg2Dxe

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

EDK2 Support for SM3 digest algorithm is needed to enable TPM with SM3 PCR
banks. This digest algorithm is part of the China Crypto algorithm suite.
This integration has dependency on the openssl_1_1_1b integration into
edk2.
This patch links SM3 support into Tcg2Pei and Tcg2Dxe.

Signed-off-by: Imran Desai <imran.desai@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: jiewen.yao@intel.com
4 years agoSecurityPkg: set SM3 bit in TPM 2.0 hash mask by default
Imran Desai [Wed, 29 May 2019 04:40:48 +0000 (04:40 +0000)]
SecurityPkg: set SM3 bit in TPM 2.0 hash mask by default

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

EDK2 Support for SM3 digest algorithm is needed to enable TPM with SM3 PCR
banks. This digest algorithm is part of the China Crypto algorithm suite.
This integration has dependency on the openssl_1_1_1b integration into
edk2.
This patch sets SM3 bit in TPM2.0 hash mask by default.

Signed-off-by: Imran Desai <imran.desai@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian Wang <jian.j.wang@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: jiewen.yao@intel.com
4 years agoSecurityPkg/HashLibBaseCryptoRouter: recognize the SM3 digest algorithm
Imran Desai [Wed, 29 May 2019 04:40:47 +0000 (04:40 +0000)]
SecurityPkg/HashLibBaseCryptoRouter: recognize the SM3 digest algorithm

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

EDK2 Support for SM3 digest algorithm is needed to enable TPM with SM3 PCR
banks. This digest algorithm is part of the China Crypto algorithm suite.
This integration has dependency on the openssl_1_1_1b integration into
edk2.
This patch adds SM3 as an available digest algorithm to crypto router.

Signed-off-by: Imran Desai <imran.desai@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian Wang <jian.j.wang@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: jiewen.yao@intel.com
4 years agoSecurityPkg: introduce the SM3 digest algorithm
Imran Desai [Tue, 2 Jul 2019 13:30:34 +0000 (21:30 +0800)]
SecurityPkg: introduce the SM3 digest algorithm

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

EDK2 Support for SM3 digest algorithm is needed to enable TPM with SM3 PCR
banks. This digest algorithm is part of the China Crypto algorithm suite.
This integration has dependency on the openssl_1_1_1b integration into
edk2.
This patch add SM3 algorithm in the hashinstance library.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian Wang <jian.j.wang@intel.com>
Signed-off-by: Imran Desai <imran.desai@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: jiewen.yao@intel.com
4 years agoMdePkg/Protocol/Hash: introduce GUID for SM3
Imran Desai [Wed, 29 May 2019 04:40:45 +0000 (04:40 +0000)]
MdePkg/Protocol/Hash: introduce GUID for SM3

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

EDK2 Support for SM3 digest algorithm is needed to enable TPM with SM3 PCR
banks. This digest algorithm is part of the China Crypto algorithm suite.
This integration has dependency on the openssl_1_1_1b integration into
edk2.
This patch adds GUID for SM3 digest algorithm.

Signed-off-by: Imran Desai <imran.desai@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: jiewen.yao@intel.com
4 years agoMaintainers.txt: Remove information for IntelFramework[Module]Pkg
Hao A Wu [Mon, 27 May 2019 06:23:42 +0000 (14:23 +0800)]
Maintainers.txt: Remove information for IntelFramework[Module]Pkg

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

Since IntelFramework[Module]Pkg have been removed, this commit will update
the Maintainers.txt to reflect such changes.

Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoRemove IntelFrameworkPkg
Hao A Wu [Mon, 27 May 2019 06:22:37 +0000 (14:22 +0800)]
Remove IntelFrameworkPkg

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

Please note a subsequent commit will followed to update the information in
Maintainers.txt to reflect this package removal.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoRemove IntelFrameworkModulePkg
Hao A Wu [Mon, 27 May 2019 06:19:41 +0000 (14:19 +0800)]
Remove IntelFrameworkModulePkg

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

Please note a subsequent commit will followed to update the information in
Maintainers.txt to reflect this package removal.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoShellPkg: acpiview: Make '-h' option not require a parameter
Krzysztof Koch [Fri, 28 Jun 2019 08:57:00 +0000 (16:57 +0800)]
ShellPkg: acpiview: Make '-h' option not require a parameter

Make the -h command line option a binary flag. Now, colour
highlighting is enabled whenever this flag is set (stateless),
instead of being dependent on previous acpiview command
invocations.

By removing the parameter required with the -h flag the command
line parsing logic becomes simpler.

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
4 years agoShellPkg: acpiview: Remove duplicate indentation in IORT parser
Krzysztof Koch [Fri, 28 Jun 2019 10:24:38 +0000 (18:24 +0800)]
ShellPkg: acpiview: Remove duplicate indentation in IORT parser

Remove redundant whitespace characters at the beginning of the strings
describing IORT table field names.

When dumping ACPI table contents, the indentation level for printing
field names is controled using the 'Indent' argument to the 'ParseAcpi'
function. In the IORT acpiview parser, both 'Indent' and extra
whitespace characters are used for indentation, which results in
excess indentation.

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
4 years agoShellPkg: acpiview: Remove '-v' flag from allowed command line args
Krzysztof Koch [Fri, 28 Jun 2019 08:56:59 +0000 (16:56 +0800)]
ShellPkg: acpiview: Remove '-v' flag from allowed command line args

According to the acpiview documentation, the -v flag enables verbose
output and it is set on default.

Moreover, the acpiview UEFI shell tool dumps the same output with
and without this flag set.

Therefore this patch removes the superfluous -v flag from allowed
command line parameters.

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
4 years agoShellPkg: acpiview: Remove redundant IORT node types enum
Krzysztof Koch [Fri, 28 Jun 2019 10:24:37 +0000 (18:24 +0800)]
ShellPkg: acpiview: Remove redundant IORT node types enum

Replace the enum defining valid node types in the IORT table with
macros from IoRemappingTable.h.

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
4 years agoShellPkg: acpiview: Allow disabling consistency checks (-q flag)
Krzysztof Koch [Fri, 28 Jun 2019 08:56:58 +0000 (16:56 +0800)]
ShellPkg: acpiview: Allow disabling consistency checks (-q flag)

The current documentation for the acpiview UEFI shell tool states
that the '-c' flag enables consistency checks on ACPI table data.
However, these checks are enabled anyway by default.

This patch keeps ACPI table validation as a default option, but it
makes it possible to turn ACPI table validation off by setting the
newly-introduced '-q' flag. Consequently, the '-c' flag is removed.

The remaining code changes in this patch make a number of consistency
checks optional (but enabled by default):
1. ACPI table field offset mismatch.
2. ACPI table field validation functions provided in the ACPI_PARSER
   arrays.
3. Table checksum computation.

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
4 years agoShellPkg: acpiview: Make DBG2 output consistent with other tables
Krzysztof Koch [Fri, 28 Jun 2019 10:24:36 +0000 (18:24 +0800)]
ShellPkg: acpiview: Make DBG2 output consistent with other tables

Print an extra newline character at the end DBG2 table parsing in order
to make the output resemble the one for other ACPI table parsers.

With this change, there is now a blank line between the DBG2 table dump
and the 'Table Statistics' section.

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
4 years agoShellPkg: acpiview: Fix '\n\n' printing in Table Checksum reporting
Krzysztof Koch [Fri, 28 Jun 2019 08:56:57 +0000 (16:56 +0800)]
ShellPkg: acpiview: Fix '\n\n' printing in Table Checksum reporting

Move printing double newline character ('\n\n') from the beginning of
ACPI table checksum validation message to the end of the raw binary
data dump.

This way acpiview table dump looks similar regardless of whether Table
Checksum is validated or not.

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
4 years agoShellPkg: acpiview: Remove '/?' from valid command line flags
Krzysztof Koch [Fri, 28 Jun 2019 08:56:56 +0000 (16:56 +0800)]
ShellPkg: acpiview: Remove '/?' from valid command line flags

Acpiview currently allows displaying help info by specifying both
-? and /? flags. This patch removes /? from valid command line
flags that can be passed to the acpiview tool, as this
flag is not used for such purpose in other UEFI shell commands.

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
4 years agoShellPkg: acpiview: Improve PPTT table field validation
Krzysztof Koch [Fri, 28 Jun 2019 10:24:35 +0000 (18:24 +0800)]
ShellPkg: acpiview: Improve PPTT table field validation

Add Cache Structure (Type 1) 'Number of sets' and 'Associativity'
field validation in the acpiview Processor Properties Topology
Table (PPTT) parser.

Replace literal values with precompiler macros for existing
Cache Structure validation functions.

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
4 years agoEmulatorPkg/MiscSubClassPlatformDxe: Remove this unused module
Wu, Hao A [Tue, 2 Jul 2019 02:30:53 +0000 (10:30 +0800)]
EmulatorPkg/MiscSubClassPlatformDxe: Remove this unused module

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

For commit 63f9b9b9312f3e08c92a2ea3cdbe01e723ef653b, the use of module
EmulatorPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf

was replaced by:
EmulatorPkg/PlatformSmbiosDxe/PlatformSmbiosDxe.inf

in platform DSC/FDF files.

This commit will remove this unused module from EmulatorPkg.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoShellPkg/UefiShellLib: Set input pointer parameter to null if failure
Bret Barkelew [Wed, 12 Jun 2019 06:04:57 +0000 (14:04 +0800)]
ShellPkg/UefiShellLib: Set input pointer parameter to null if failure

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

While failed to allocate memory to save the response,
set the input/output parameter 'Response'(VOID **) to
NULL to indicate the failure not only depend on the
returned status.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoOvmfPkg/XenBusDxe: Don't call DisconnectController in Stop()
Anthony PERARD [Mon, 1 Jul 2019 11:14:03 +0000 (12:14 +0100)]
OvmfPkg/XenBusDxe: Don't call DisconnectController in Stop()

Calling DisconnectController() on children isn't part of the job of
EFI_DRIVER_BINDING_PROTOCOL.Stop() as it only needs to deallocate
resources allocated in Start(). The disconnection will happen when
both DevicePath and XenBus protocols gets uninstalled.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20190701111403.7007-1-anthony.perard@citrix.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4 years agoOvmfPkg/XenBusDxe: Close XenIoProtocol openned by children
Anthony PERARD [Mon, 1 Jul 2019 10:50:12 +0000 (11:50 +0100)]
OvmfPkg/XenBusDxe: Close XenIoProtocol openned by children

In XenBusDxe, the XenBusAddDevice() opens the gXenIoProtocolGuid on
behalf of child controllers. It is never closed and prevents us from
uninstalling the protocol.

Close it where we stop all the children in XenBusDxe->Stop().

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20190701105012.25758-1-anthony.perard@citrix.com>

4 years agoMdeModulePkg SmbiosMeasurementDxe: Add Type4 Voltage field to blacklist
Star Zeng [Thu, 27 Jun 2019 11:12:10 +0000 (19:12 +0800)]
MdeModulePkg SmbiosMeasurementDxe: Add Type4 Voltage field to blacklist

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

The Type4 Voltage field may be various.
So this patch adds it into the blacklist.

Signed-off-by: Star Zeng <star.zeng@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Donald Kuo <donald.kuo@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoIntelFsp2Pkg: FSP Python scripts to support 3.x.
Chasel Chiu [Fri, 21 Jun 2019 00:43:22 +0000 (08:43 +0800)]
IntelFsp2Pkg: FSP Python scripts to support 3.x.

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

Updated FSP Python scripts to support both 2.x and
3.x.

Test:
  . Verified with Python 2.7.12 and 3.6.6.
  . Verified tool result is the same before the change.
  . Both py -2 and py -3 built binary can boot.

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
4 years agoPciBusDxe: duplicate node insertion for every PPB device in the system
Javeed, Ashraf [Mon, 27 May 2019 10:23:56 +0000 (18:23 +0800)]
PciBusDxe: duplicate node insertion for every PPB device in the system

https://bugzilla.tianocore.org/show_bug.cgi?id=1796
Bug fixed in PciBusDxe\PciLib.c.
Removed the redundant second call to PciSearchDevice sub-routine when the
PCD for the Hot-Plug support is disabled.

Signed-off-by: Ashraf Javeed <Ashraf.javeed@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
4 years agoMdeModulePkg/BdsDxe: Use a pcd to control PlatformRecovery
Zhichao Gao [Wed, 22 May 2019 00:59:45 +0000 (08:59 +0800)]
MdeModulePkg/BdsDxe: Use a pcd to control PlatformRecovery

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

Use the PcdPlatformRecoverySupport to control the function
of platform recovery in BDS.
First, set the variable's ("OsIndicationsSupported")
EFI_OS_INDICATIONS_START_PLATFORM_RECOVERY bit base on the pcd.
It would affect the variable "OsIndications".
While the platform does not support the platform recovery,
it is inappropriate to set a PlatformRecovery#### variable. So
skip setting the variable. But it should remain the behavior of
booting from a default file path (such as \EFI\BOOT\BOOTX64.EFI)
to be compatible with the previous version UEFI spec.

Add memory check before build platform default boot option. If
fail to allocate memory for the defualt boot file path, put the
system into dead loop to indicate it is unable to boot.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoMdeModulePkg: Add a pcd to set the OS indications bit
Bret Barkelew [Fri, 29 Mar 2019 05:47:25 +0000 (13:47 +0800)]
MdeModulePkg: Add a pcd to set the OS indications bit

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

Add a pcd PcdPlatformRecoverySupport to conditionally
set an OS indications bit and set the 'PlatformRecovery####'
variable. This pcd would also control whether the BDS
support platform recovery or not.
Update the uni file to add the prompt and help string base on
the description in dec file.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoSecurityPkg: Remove DxeDeferImageLoadLib in DSC
Shenglei Zhang [Mon, 1 Jul 2019 02:26:51 +0000 (10:26 +0800)]
SecurityPkg: Remove DxeDeferImageLoadLib in DSC

The current version will cause build fail because DxeDeferImageLoadLib
exists in DSC file but it was actually deleted. So it should be removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1919

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian Wang <jian.j.wang@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoBaseTools:Linux changes the way the latest version is judged
Fan, ZhijuX [Wed, 26 Jun 2019 04:49:33 +0000 (12:49 +0800)]
BaseTools:Linux changes the way the latest version is judged

Some Linux servers do not have BC installed,so errors occur.
So the judgment was changed to avoid this error.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoFix indentation in edksetup.sh SetupPython3
rebecca@bluestop.org [Wed, 26 Jun 2019 16:54:56 +0000 (00:54 +0800)]
Fix indentation in edksetup.sh SetupPython3

Signed-off-by: Rebecca Cran <rebecca@bluestop.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoMdeModulePkg/SdMmcHcDxe: Implement revision 3 of SdMmcOverrideProtocol
Albecki, Mateusz [Wed, 26 Jun 2019 13:10:03 +0000 (21:10 +0800)]
MdeModulePkg/SdMmcHcDxe: Implement revision 3 of SdMmcOverrideProtocol

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

Implement support for GetOperatingParamters notify phase
in SdMmcHcDxe driver. GetOperatingParameters notify phase
is signaled before we start card detection and initialization.
Code has been updated for both eMMC and SD card controllers to
take into consideration those new parameters. Initialization process
has been divided into 2 steps. In the first step we bring the link
up to the point where we can get card identification data(Extended
CSD in eMMC case and SWITCH command response in SD card case). This
data is later used along with controller capabilities and operating
parameters passed in GetOperatingParameters phase to choose preferred
bus settings in GetTargetBusSettings function. Those settings are later
on to start bus training to high speeds. If user passes incompatible
setting with selected bus timing driver will assume it's standard behavior
with respect to that setting. For instance if HS400 has been selected as a
target bus timing due to card and controller support bus width setting of
4 and 1 bit won't be respected and 8 bit setting will be chosen instead.

Tests on Marvell boards were also performed by Marcin Wojtas
<mw@semihalf.com>:

https://edk2.groups.io/g/devel/message/42999

Board 1 (out of tree): SD - OK, MMC - OK
Board 2: (Armada80x0McBin): SD - OK, MMC - OK
Board 3: (Armada70x0Db): SD - problems, MMC - OK

Please note that the problem on Armada70x0Db SD devices are introduced by
adding new types of SD bus modes, a subsequent patch within edk2-platforms
repository will be proposed to address it.
(More details can be referred from the above link.)

Signed-off-by: Mateusz Albecki <mateusz.albecki@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Regression-tested-by: Sumit Garg <sumit.garg@linaro.org>
4 years agoMdeModulePkg/SdMmcOverride: Add GetOperatingParam notify phase
Albecki, Mateusz [Wed, 26 Jun 2019 13:10:02 +0000 (21:10 +0800)]
MdeModulePkg/SdMmcOverride: Add GetOperatingParam notify phase

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

The new notify phase allows platform to configure additional
bus parameters in addition to parameters that can already be configured
with capability override. Specifically we allow to configure bus width,
clock frequency and driver strength. If platform doesn't wish to configure
some of the parameters it can left it on default values and driver will
assume it's standard behavior with respect to those parameters.
The definition of the SD_MMC_BUS_MODE has been extended to
incorporate SD card default speed and high speed.

Tests on Marvell boards were also performed by Marcin Wojtas
<mw@semihalf.com>:

https://edk2.groups.io/g/devel/message/42999

Board 1 (out of tree): SD - OK, MMC - OK
Board 2: (Armada80x0McBin): SD - OK, MMC - OK
Board 3: (Armada70x0Db): SD - problems, MMC - OK

Please note that the problem on Armada70x0Db SD devices are introduced by
adding new types of SD bus modes, a subsequent patch within edk2-platforms
repository will be proposed to address it.
(More details can be referred from the above link.)

Signed-off-by: Mateusz Albecki <mateusz.albecki@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Regression-tested-by: Sumit Garg <sumit.garg@linaro.org>
4 years agoMdeModulePkg/UfsPassThruDxe: Fix unaligned data transfer handling
Albecki, Mateusz [Tue, 25 Jun 2019 09:44:28 +0000 (17:44 +0800)]
MdeModulePkg/UfsPassThruDxe: Fix unaligned data transfer handling

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

Since UFS specification requires the data buffer specified
in PRDT to be DWORD aligned in size we had a code in
UfsInitUtpPrdt that aligned the data buffer by rounding down
the buffer size to DWORD boundary. This meant that for SCSI
commands that wanted to perform unaligned data transfer(such as
SENSE command) we specified to small buffer for the data to fit
and transfer was aborted. This change introduces code that allocates
auxiliary DWORD aligned data buffer for unaligned transfer. Device
transfers data to aligned buffer and when data transfer is over driver
copies data from aligned buffer to data buffer passed by user.

Signed-off-by: Mateusz Albecki <mateusz.albecki@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoArmVirtPkg: handle NETWORK_TLS_ENABLE in ArmVirtQemu*
Laszlo Ersek [Mon, 24 Jun 2019 16:30:27 +0000 (18:30 +0200)]
ArmVirtPkg: handle NETWORK_TLS_ENABLE in ArmVirtQemu*

Port the [LibraryClasses], [PcdsFixedAtBuild] and [Components] settings
that are related to NETWORK_TLS_ENABLE from OvmfPkg to ArmVirtPkg.
ArmVirtXen is not modified because it doesn't include the edk2 network
stack.

(This change is now simpler than it would have been when TianoCore#1009
was originally filed, due to ArmVirtPkg consuming the NetworkPkg include
fragments meanwhile, from TianoCore#1293 / commit 157a3b1aa50f.)

The usage hints from "OvmfPkg/README", section "HTTPS Boot", apply.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Gary Lin <glin@suse.com>
Cc: Guillaume GARDET <guillaume.gardet@arm.com>
Cc: Julien Grall <julien.grall@arm.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1009
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Guillaume Gardet <guillaume.gardet@arm.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Tested-by: Gary Lin <glin@suse.com>
4 years agoBaseTools:Remove unused Edk2\BuildNotes2.txt
Fan, ZhijuX [Tue, 18 Jun 2019 06:54:44 +0000 (14:54 +0800)]
BaseTools:Remove unused Edk2\BuildNotes2.txt

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

Edk2\BuildNotes2.txt is not maintained any more. User can find the
related info in wiki. So, this file can be removed.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoEdk2Setup: Support different VS tool chain setup
Dandan Bi [Wed, 12 Jun 2019 03:28:46 +0000 (11:28 +0800)]
Edk2Setup: Support different VS tool chain setup

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

This patch is to update edksetup with additional option:
VS2017 VS2015 VS2013 VS2012 to setup different VS environment.
And will report error if the specified VS tool is not installed.
For VS2017, also consider the case that only VS2017 build tool
is installed.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoEdk2: Remove nt32 related flag in bat files
Dandan Bi [Thu, 6 Jun 2019 02:48:50 +0000 (10:48 +0800)]
Edk2: Remove nt32 related flag in bat files

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

NT32Pkg has been removed, remove nt32 related
flags in bat files.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
4 years agoSecurityPkg/DxeDeferImageLoadLib: Remove DxeDeferImageLoadLib
Shenglei Zhang [Wed, 19 Jun 2019 01:47:56 +0000 (09:47 +0800)]
SecurityPkg/DxeDeferImageLoadLib: Remove DxeDeferImageLoadLib

The library DxeDeferImageLoadLib supports UID feature and it is conflicted
with the driver SecurityStubDxe (Defer3rdPartyImageLoad.c).
And the UID feature is dropped. So it should be removed from SecurityPkg.
https://bugzilla.tianocore.org/show_bug.cgi?id=1919

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian Wang <jian.j.wang@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
4 years agoMdeModulePkg/DxeCapsuleLibFmp: Add missing NULL pointer check.
Wei6 Xu [Thu, 27 Jun 2019 08:43:06 +0000 (16:43 +0800)]
MdeModulePkg/DxeCapsuleLibFmp: Add missing NULL pointer check.

Add missing NULL pointer check for CapsuleNameBufStart.
Also add comments to notice that capsule name integrity check assumes
the capsule has been validated by IsValidCapsuleHeader().

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
4 years agoBaseTools/Capsule: Supports multiple payloads and drivers in capsule
Jin, Eric [Wed, 26 Jun 2019 05:55:35 +0000 (13:55 +0800)]
BaseTools/Capsule: Supports multiple payloads and drivers in capsule

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

1)Add arguments "--embedded-driver" to support embedded driver
in command line.
2)Add arguments "--update-image-index" to identify ImageIndex
within the device in command line.
3)Add arguments "-j JSONFILE" to support multiple payloads and
embedded drivers with JSON file.

The update is in a backwards compatible manner, so all command
line options to support single payload are still supported. But
all the options associated with multiple payloads should be
provided in a JSON file.

Cc: Bob Feng <bob.c.feng@intel.com>
Signed-off-by: Eric Jin <eric.jin@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
4 years agoUefiCpuPkg/MpInitLib: MicrocodeDetect: Ensure checked range is valid
Zhichao Gao [Wed, 26 Jun 2019 04:51:55 +0000 (12:51 +0800)]
UefiCpuPkg/MpInitLib: MicrocodeDetect: Ensure checked range is valid

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

0x0       MicrocodeBegin  MicrocodeEntry  MicrocodeEnd      0xffffffff
|--------------|---------------|---------------|---------------|
                                 valid TotalSize
TotalSize is only valid between 0 and (MicrocodeEnd - MicrocodeEntry).
So add '(UINTN)MicrocodeEntryPoint > (MAX_ADDRESS - TotalSize)' before
'((UINTN)MicrocodeEntryPoint + TotalSize) > MicrocodeEnd' to make sure
((UINTN)MicrocodeEntryPoint + TotalSize) wouldn't overflow.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
4 years agoMdeModulePkg/UfsPassThruDxe: Refactor UFS device presence detection
Albecki, Mateusz [Fri, 21 Jun 2019 15:27:02 +0000 (23:27 +0800)]
MdeModulePkg/UfsPassThruDxe: Refactor UFS device presence detection

In current implementation we are checking for device presence every
time we execute UIC command. To make UfsExecUicCommands more generic
checking device presence has been moved to UfsDeviceDetection.

Signed-off-by: Mateusz Albecki <mateusz.albecki@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
4 years agoPcAtChipsetPkg: Remove framework modules
Hao A Wu [Mon, 27 May 2019 05:59:30 +0000 (13:59 +0800)]
PcAtChipsetPkg: Remove framework modules

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

The commit will remove the below modules from PcAtChipsetPkg:
* PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf
* PcAtChipsetPkg/8254TimerDxe/8254Timer.inf
* PcAtChipsetPkg/IsaAcpiDxe/IsaAcpi.inf

They are considered legacy framework components and will no longer be used
after the removal of IntelFramework[Module]Pkg.

Also, the unused (after the modules being removed) PCDs will be deleted in
package level DEC/UNI files.

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
4 years agoSecurityPkg: add FvReportPei.inf in dsc for build validation
Jian J Wang [Fri, 10 May 2019 02:22:46 +0000 (10:22 +0800)]
SecurityPkg: add FvReportPei.inf in dsc for build validation

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

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: "Hernandez Beltran, Jorge" <jorge.hernandez.beltran@intel.com>
Cc: Harry Han <harry.han@intel.com>
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
4 years agoSecurityPkg/FvReportPei: implement a common FV verifier and reporter
Jian J Wang [Fri, 10 May 2019 02:19:36 +0000 (10:19 +0800)]
SecurityPkg/FvReportPei: implement a common FV verifier and reporter

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

This driver implements a common checker, verifier and reporter which is
independent of hardware based root-of-trust.

Usually the hardware based root-of-trust will not verify all BIOS but
part of it. For example, Boot Guard will only verify IBB segment. The IBB
needs to verify other part of BIOS, i.e. other FVs to transfer control to
from IBB. This driver plays the role in IBB to verify FVs not covered by
hardware root-of-trust to make sure integrity of the chain of trust.

To be hardware/platform independent, PPI

  gEdkiiPeiFirmwareVolumeInfoStoredHashFvPpiGuid

is introduced for platform to pass digest information to this driver.
This PPI should include all information needed to verify required FVs in
required boot mode.

struct _EDKII_PEI_FIRMWARE_VOLUME_INFO_STORED_HASH_FV_PPI {
  FV_HASH_INFO            HashInfo;
  UINTN                   FvNumber;
  HASHED_FV_INFO          FvInfo[1];
};

To avoid TOCTOU issue, all FVs to be verified will be copied to memory
before hash calculation. That also means this driver has to be run after
permanent memory has been discovered.

For a measured boot, this driver will install

  gEdkiiPeiFirmwareVolumeInfoPrehashedFvPpiGuid

to report digest of each FV to TCG driver.

For a verified boot, this driver will verify the final hash value
(calculated from the concatenation of each FV's hash) for indicated
FVs against the hash got from platform/hardware.

If pass, it will build EFI_HOB_TYPE_FV (consumed by DXE core) and/or
install gEfiPeiFirmwareVolumeInfoPpiGuid (consumed by PEI core), and
then report status code PcdStatusCodeFvVerificationPass.

If fail, it just report status code PcdStatusCodeFvVerificationFail
and go to dead loop if status report returns.

The platform can register customized handler to process pass and fail
cases differently.

Currently, this driver only supports hash (sha256/384/512) verification
for the performance consideration.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: "Hernandez Beltran, Jorge" <jorge.hernandez.beltran@intel.com>
Cc: Harry Han <harry.han@intel.com>
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
4 years agoSecurityPkg: add definitions for OBB verification
Jian J Wang [Tue, 19 Feb 2019 12:00:27 +0000 (20:00 +0800)]
SecurityPkg: add definitions for OBB verification

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

gEdkiiPeiFirmwareVolumeInfoStoredHashFvPpiGuid should be installed by
platform to pass FV hash information to the common FV verify/report
driver, in which the hash value will be calculated again based on the
information fed in and then verified.

The information passed in this PPI include:
  - FVs location in flash and length
  - Hash values for different boot mode

The hash value must be calculated in following way (if 3 FVs to calc):

  FV1 -> Hash1
  FV2 -> Hash2
  FV3 -> Hash3
  Hash1 + Hash2 + Hash3 -> HashAll

Only HashAll is stored in this PPI. The purposes for this algorithm
are two:

  1. To report each FV's hash to TCG driver and verify HashAll at the
     same time without the burden to calculate the hash twice;
  2. To save hash value storage due to potential hardware limitation

Different boot mode may have its own hash value so that each mode can
decide which FV will be verified. For example, for the sake of performance,
S3 may choose to skip some FVs verification and normal boot will verify
all FVs it concerns.

So in this PPI, each FV information has flag to indicate which boot mode
it will be taken into hash calculation.

And if multiple hash values passed in this PPI, each has a flag to indicate
which boot mode it's used for. Note one hash value supports more than one
boot modes if they're just the same.

PcdStatusCodeFvVerificationPass and PcdStatusCodeFvVerificationFail are
introduced to report status back to platform, and platform can choose how
to act upon verification success and failure.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: "Hernandez Beltran, Jorge" <jorge.hernandez.beltran@intel.com>
Cc: Harry Han <harry.han@intel.com>
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
4 years agoOvmfPkg: don't assign PCI BARs above 4GiB when CSM enabled
David Woodhouse [Wed, 26 Jun 2019 11:37:42 +0000 (12:37 +0100)]
OvmfPkg: don't assign PCI BARs above 4GiB when CSM enabled

Mostly, this is only necessary for devices that the CSM might have
native support for, such as VirtIO and NVMe; PciBusDxe will already
degrade devices to 32-bit if they have an OpROM.

However, there doesn't seem to be a generic way of requesting PciBusDxe
to downgrade specific devices.

There's IncompatiblePciDeviceSupportProtocol but that doesn't provide
the PCI class information or a handle to the device itself, so there's
no simple way to just match on all NVMe devices, for example.

Just leave gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size set to zero for
CSM builds, until/unless that can be fixed.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20190626113742.819933-5-dwmw2@infradead.org>

4 years agoOvmfPkg: Don't build in QemuVideoDxe when we have CSM
David Woodhouse [Wed, 26 Jun 2019 11:37:41 +0000 (12:37 +0100)]
OvmfPkg: Don't build in QemuVideoDxe when we have CSM

QemuVideoDxe installs its own legacy INT 10h handler for the benefit of
systems like Windows 2008r2 which attempt to use INT 10h even when booted
via EFI.

This interacts extremely badly with a CSM actually attempting to install
a real video BIOS.

The last thing done before invoking a legacy OpROM is to call INT 10h to
set a plain text mode. In the case where it's the video BIOS OpROM being
loaded, INT 10h will normally point to an iret stub in the CSM itself.

Unless QemuVideoDxe has changed INT10h to point to a location in the
0xC0000 segment that it didn't allocate properly, so the real OpROM has
been shadowed over them top of it, and the INT 10h vector now points to
some random place in the middle of the newly-shadowed OpROM.

Don't Do That Then. QemuVideoDxe doesn't do any acceleration and just
sets up a linear framebuffer, so we don't lose much by just
unconditionally using BiosVideoDxe instead when CSM is present.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20190626113742.819933-4-dwmw2@infradead.org>