]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
6 years agoMdePkg: introduce DxeRuntimeDebugLibSerialPort
Ard Biesheuvel [Tue, 20 Feb 2018 10:53:10 +0000 (10:53 +0000)]
MdePkg: introduce DxeRuntimeDebugLibSerialPort

Introduce a variant of BaseDebugLibSerialPort that behaves correctly with
regards to the use of the serial port after ExitBootServices(). At boot
time, all DEBUG() prints and ASSERT() invocations are executed normally.
At runtime, DEBUG() prints are dropped entirely, and ASSERT()s omit the
serial output as well, and only perform the configured post-ASSERT()
action, i.e., issue a CPU breakpoint or enter a deadloop.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
6 years agoMdeModulePkg/RecoveryDevice.h: Remove semicolon after GUID definitions
Hao Wu [Fri, 23 Feb 2018 00:44:20 +0000 (08:44 +0800)]
MdeModulePkg/RecoveryDevice.h: Remove semicolon after GUID definitions

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

Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoEmbeddedPkg: use central variable definitions in .vfr files
Leif Lindholm [Wed, 13 Dec 2017 12:04:40 +0000 (12:04 +0000)]
EmbeddedPkg: use central variable definitions in .vfr files

Use UefiMultiPhase.h in Vfr.vfr instead of duplicating EFI_VARIABLE_*
definitions.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
6 years agoMdeModulePkg: use central variable definitions in DriverSampleDxe
Leif Lindholm [Wed, 13 Dec 2017 12:01:04 +0000 (12:01 +0000)]
MdeModulePkg: use central variable definitions in DriverSampleDxe

Use UefiMultiPhase.h in Vfr.vfr instead of duplicating EFI_VARIABLE_*
definitions.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdePkg: restrict UefiMultiPhase.h contents if VFRCOMPILE defined
Leif Lindholm [Fri, 15 Dec 2017 16:08:17 +0000 (16:08 +0000)]
MdePkg: restrict UefiMultiPhase.h contents if VFRCOMPILE defined

Turns out all .vfr files in the tree interacting with DynamicPcds
manually copy the same set of EFI_VARIABLE_* definitions, since the rest
of UefiMultiPhase.h is incompatible with VfrCompile.

For now, reshuffle these definitions to the start of the file, and put
the rest of the file behind #ifndef VFRCOMPILE to permit direct
inclusion in .vfr source files.

https://bugzilla.tianocore.org/show_bug.cgi?id=878 has been raised to
request VfrCompile is extended to support the original format.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoShellPkg/Ping: fix loss of first packet
Meenakshi Aggarwal [Fri, 16 Feb 2018 08:45:11 +0000 (14:15 +0530)]
ShellPkg/Ping: fix loss of first packet

Issue:
Reply for first ping packet was getting dropped.

Cause:
Sometimes reply message comes even before trasmit
function returns, hence missing 1st reply

Fix:
Prepare the TxList before calling Transmit function.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoBaseTools: Fix the bug to display the single SKUID info
Yonghong Zhu [Wed, 21 Feb 2018 02:09:03 +0000 (10:09 +0800)]
BaseTools: Fix the bug to display the single SKUID info

when defined SKUID_IDENTIFIER = DEFAULT|TEST in DSC [Defines] section,
per spec it means current SKUID is single, the bug is build report print
both DEFAULT and TEST info, it should only print TEST.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoBaseTools: Add check for INF statement must be a .inf file
Yonghong Zhu [Wed, 7 Feb 2018 06:41:11 +0000 (14:41 +0800)]
BaseTools: Add check for INF statement must be a .inf file

Per FDF spec, INF statement must use a .inf file, we add this error
check.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoBaseTools: Add WindowsLike path in front of PATH Env
Yonghong Zhu [Thu, 22 Feb 2018 02:30:41 +0000 (10:30 +0800)]
BaseTools: Add WindowsLike path in front of PATH Env

Original BaseTools source build append WindowsLike path to PATH Env,
while WINDDK installation has a "build.exe", if user place WINDDK
folder to PATH either during WINDDK installation or manually, it will
block the BaseTools' build.bat.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdePkg/BaseSafeIntLib: fix undefined behavior in SafeInt64Mult()
Laszlo Ersek [Thu, 15 Feb 2018 16:09:43 +0000 (17:09 +0100)]
MdePkg/BaseSafeIntLib: fix undefined behavior in SafeInt64Mult()

If we have to negate UnsignedResult (due to exactly one of Multiplicand
and Multiplier being negative), and UnsignedResult is exactly
MIN_INT64_MAGNITUDE (value 2^63), then the statement

        *Result = - ((INT64)UnsignedResult);

invokes both implementation-defined behavior and undefined behavior.

First, MIN_INT64_MAGNITUDE is not representable as INT64, therefore the
result of the (inner) conversion

  (INT64)MIN_INT64_MAGNITUDE

is implementation-defined, or an implementation-defined signal is raised,
according to ISO C99 6.3.1.3p3.

Second, if we assume that the C language implementation defines the
conversion to INT64 simply as reinterpreting the bit pattern
0x8000_0000_0000_0000 as a signed integer in two's complement
representation, then the conversion immediately produces the negative
value MIN_INT64 (value -(2^63)). In turn, the (outer) negation

  -(MIN_INT64)

invokes undefined behavior, because the mathematical result of the
negation, namely 2^63, cannot be represented in an INT64 object. (Not even
mentioning the fact that the mathematical result would be incorrect.) In
practice, the undefined negation of MIN_INT64 happens to produce an
unchanged, valid-looking result on x86, i.e. (-(MIN_INT64)) == MIN_INT64.

We can summarize this as the undefined -- effectless -- negation canceling
out the botched -- auto-negating -- implementation-defined conversion.
Instead of relying on such behavior, dedicate a branch to this situation:
assign MIN_INT64 directly. The branch can be triggered e.g. by multiplying
(2^62) by (-2).

Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
6 years agoMdePkg/BaseSafeIntLib: clean up parentheses in MIN_INT64_MAGNITUDE
Laszlo Ersek [Thu, 15 Feb 2018 16:09:43 +0000 (17:09 +0100)]
MdePkg/BaseSafeIntLib: clean up parentheses in MIN_INT64_MAGNITUDE

The definition of the MIN_INT64_MAGNITUDE macro is correct, but it's
harder to read than necessary: the sub-expression

      (( (UINT64) - (MIN_INT64 + 1) ))

is doubly parenthesized. Reusing one pair of the outer parens, rewrite the
sub-expression (without change in meaning) so that the minus sign cannot
be mistaken for subtraction:

      ( (UINT64)(- (MIN_INT64 + 1)) )

The resultant macro definition matches the following expressions in
SafeInt64Mult():

>     //
>     // Avoid negating the most negative number.
>     //
>     UnsignedMultiplicand = ((UINT64)(- (Multiplicand + 1))) + 1;

and

>     //
>     // Avoid negating the most negative number.
>     //
>     UnsignedMultiplier = ((UINT64)(- (Multiplier + 1))) + 1;

Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
6 years agoMdePkg/BaseSafeIntLib: fix undefined behavior in SafeInt64Add()
Laszlo Ersek [Thu, 15 Feb 2018 13:47:11 +0000 (14:47 +0100)]
MdePkg/BaseSafeIntLib: fix undefined behavior in SafeInt64Add()

The addition in the assignment

  SignedResult = Augend + Addend;

is performed with unchecked INT64 operands. According to ISO C, if the
mathematical result of signed integer addition cannot be represented in
the result type, the behavior is undefined. (Refer to ISO C99 6.5p5.
6.2.5p9 only exempts unsigned integers, and 6.3.1.3p3 does not apply
because it treats the conversion of integers that have been successfully
evaluated first.)

Replace the after-the-fact result checking with checks on the operands,
and only perform the addition if it is safe.

Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
6 years agoMdePkg/BaseSafeIntLib: fix undefined behavior in SafeInt64Sub()
Laszlo Ersek [Thu, 15 Feb 2018 13:47:11 +0000 (14:47 +0100)]
MdePkg/BaseSafeIntLib: fix undefined behavior in SafeInt64Sub()

The subtraction in the assignment

  SignedResult = Minuend - Subtrahend;

is performed with unchecked INT64 operands. According to ISO C, if the
mathematical result of signed integer subtraction cannot be represented in
the result type, the behavior is undefined. (Refer to ISO C99 6.5p5.
6.2.5p9 only exempts unsigned integers, and 6.3.1.3p3 does not apply
because it treats the conversion of integers that have been successfully
evaluated first.)

Replace the after-the-fact result checking with checks on the operands,
and only perform the subtraction if it is safe.

Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
6 years agoEmbeddedPkg/FdtLib: incorporate missing overlay support
Ard Biesheuvel [Thu, 15 Feb 2018 10:30:33 +0000 (10:30 +0000)]
EmbeddedPkg/FdtLib: incorporate missing overlay support

Commit a099239015eb ("EmbeddedPkg/FdtLib: Update FdtLib to v1.4.5")
updated our FdtLib implementation to a more recent upstream version,
but omitted fdt_overlay.c due to its ambiguous licensing situation.
This has been resolved now, so take the latest upstream version of
the file (which received no other modifications in the mean time)
and add it to FdtLib.

Note that fdt_overlay.c has a dependency on strtoul() which EDK does
not provide natively, so add a private implementation that wraps the
BaseLib routines that do roughly the same.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoMdeModulePkg/UsbMass: Fix hot-plug USB CDROM can't be recognized
Ruiyu Ni [Tue, 13 Feb 2018 07:21:48 +0000 (15:21 +0800)]
MdeModulePkg/UsbMass: Fix hot-plug USB CDROM can't be recognized

In below calling stack:
UsbBootIsUnitReady()
 UsbBootExecCmdWithRetry()
  UsbBootExecCmd()
    UsbBootRequestSense()
When USB CDROM is hot-plugged, UsbBootRequestSense() retrieves sense
key (6 = UnitAttention), additional sense code (29h = Power ON).
But it wrongly maps such sense data to Device Error status.
It causes UsbBootExecCmd() executed again.
In the second time call to UsbBootExecCmd(), UsbBootRequestSense()
retrieves sense key (6 = UnitAttention), additional sense code
(28h = media changed).

The above analysis explains why hot-plug USB CDROM cannot be
recognized after below commit:
SHA1 a662afb5b023a187ef638d3cb0e0c313ad39a7fc
* MdeModulePkg/UsbStorage: Fix "map -r" cannot detect media change,
which removes the media changed status check in UsbBootDetectMedia().

The proper fix to this problem is to map the ASC (additional sense
code 29h) properly to success status so that no second call to
UsbBootExecCmd() is made.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
6 years agoShellPkg/ShellLib: Fix a bug in InternalShellIsHexOrDecimalNumber
Ruiyu Ni [Tue, 13 Feb 2018 08:39:31 +0000 (15:39 +0700)]
ShellPkg/ShellLib: Fix a bug in InternalShellIsHexOrDecimalNumber

InternalShellIsHexOrDecimalNumber() wrongly treats "-" as a number.
The patch fixes this issue.

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

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoShellPkg/[hex]edit: Fix CTRL+<Alpha> doesn't work from hyper terminal
Ruiyu Ni [Tue, 13 Feb 2018 09:29:55 +0000 (17:29 +0800)]
ShellPkg/[hex]edit: Fix CTRL+<Alpha> doesn't work from hyper terminal

After commit 20ddbc133f679b7895dfdaf2fd58ec4c8183a1d8
* MdeModulePkg/ConSplitter: ReadKeyStrokeEx always return key state

When one physical console supports to report the shift key state,
the key data returned from ConSplitter driver at least carries
the shift key valid bit.
The patch fixes the edit/hexedit to accept Unicode (1) when
the no shift key is pressed or reported.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoMdeModulePkg/ResetUtilityLib: Fix GCC build failure
Ruiyu Ni [Tue, 13 Feb 2018 03:02:30 +0000 (11:02 +0800)]
MdeModulePkg/ResetUtilityLib: Fix GCC build failure

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
6 years agoMdeModulePkg/BmpSupportLib: Refine type cast for pointer subtraction
Hao Wu [Tue, 13 Feb 2018 02:23:51 +0000 (10:23 +0800)]
MdeModulePkg/BmpSupportLib: Refine type cast for pointer subtraction

Since the pointer subtraction here is not performed by pointers to
elements of the same array object. This might lead to potential issues,
such behavior is undefined according to C11 standard.

Refine the pointer subtraction expressions by casting each pointer to
UINTN first and then perform the subtraction.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoNetworkPkg: Read HttpTlsCipherList variable and configure it for HTTPS session.
Jiaxin Wu [Fri, 9 Feb 2018 03:52:06 +0000 (11:52 +0800)]
NetworkPkg: Read HttpTlsCipherList variable and configure it for HTTPS session.

v2:
* Refine the error handling returned from GetVariable.

This patch is to read the HttpTlsCipherList variable and configure it for the
later HTTPS session.

If the variable is not set by any platform, EFI_NOT_FOUND will be returned
from GetVariable service. In such a case, the default CipherList created in
TlsDxe driver will be used.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Kinney Michael D <michael.d.kinney@intel.com>
Cc: Zimmer Vincent <vincent.zimmer@intel.com>
Cc: Yao Jiewen <jiewen.yao@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: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
6 years agoNetworkPkg: Define one private variable for HTTPS to set Tls CipherList.
Jiaxin Wu [Fri, 9 Feb 2018 03:44:57 +0000 (11:44 +0800)]
NetworkPkg: Define one private variable for HTTPS to set Tls CipherList.

v2:
* Rename the file/variable name.

This variable (HttpTlsCipherList) can be set by any platform that want to
control its own preferred Tls CipherList for the later HTTPS session.

The valid contents of variable must follow the TLS CipherList format defined
in RFC 5246. The valid length of variable must be an integral multiple of 2.
For example, if below cipher suites are preferred:
    CipherSuite TLS_RSA_WITH_AES_128_CBC_SHA256 = {0x00,0x3C}
    CipherSuite TLS_RSA_WITH_AES_256_CBC_SHA256 = {0x00,0x3D}
Then, the contents of variable should be:
    {0x00,0x3C,0x00,0x3D}

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Kinney Michael D <michael.d.kinney@intel.com>
Cc: Zimmer Vincent <vincent.zimmer@intel.com>
Cc: Yao Jiewen <jiewen.yao@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: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
6 years agoShellPkg: remove superfluous TimerLib resolution
Laszlo Ersek [Mon, 12 Feb 2018 13:03:44 +0000 (14:03 +0100)]
ShellPkg: remove superfluous TimerLib resolution

TimerLib had to be resolved in commit 5ab97a64b51c ("ShellPkg/bcfg: Add
Shell Spec 2.2 modification functionality", 2017-03-01) because:

- the BCFG command started making calls to UefiBootManagerLib
  (EfiBootManagerVariableToLoadOption(),
  EfiBootManagerLoadOptionToVariable(), EfiBootManagerFreeLoadOption()),

- and "MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf"
  depended on TimerLib.

Because TimerLib is platform-specific, but "ShellPkg/ShellPkg.dsc" is
meant to produce a UEFI shell binary that is platform-independent (see
"ShellBinPkg/ReadMe.txt"), we resolved TimerLib to
"BaseTimerLibNullTemplate.inf". (TimerLib functionality was never actually
needed on UefiBootManagerLib code paths that were exercised by the shell /
BCFG.)

Thanks to the last patch, UefiBootManagerLib no longer depends on
TimerLib, thus we can drop the TimerLib resolution entirely.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoMdeModulePkg/UefiBootManagerLib: remove superfluous TimerLib dependency
Laszlo Ersek [Mon, 12 Feb 2018 12:43:46 +0000 (13:43 +0100)]
MdeModulePkg/UefiBootManagerLib: remove superfluous TimerLib dependency

In commit 3a039a567a5f ("MdeModulePkg/UefiBootManagerLib: Remove the
useless perf codes", 2018-02-12), the BmWriteBootToOsPerformanceData()
function was removed. No TimerLib API calls are left, thus remove the
TimerLib class dependency from "InternalBm.h" and "UefiBootManagerLib.inf"
as well.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoOvmfPkg: drop stale SafeBlockIoLib and SafeOpenProtocolLib resolutions
Laszlo Ersek [Mon, 12 Feb 2018 12:16:14 +0000 (13:16 +0100)]
OvmfPkg: drop stale SafeBlockIoLib and SafeOpenProtocolLib resolutions

These are listed under "ShellPkg/Application/Shell/Shell.inf", but they
have been commented out ever since commit 345a0c8fce38 ("OvmfPkg: Add
support for UEFI shell", 2011-06-26). No such lib classes exist in edk2.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoShellPkg/[hex]edit: Fix wrongly use gST->ConIn as the console handle
Ruiyu Ni [Mon, 12 Feb 2018 15:32:22 +0000 (23:32 +0800)]
ShellPkg/[hex]edit: Fix wrongly use gST->ConIn as the console handle

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoShellPkg/[hex]edit: use SimpleTextInEx to read console
Ruiyu Ni [Mon, 12 Feb 2018 13:42:55 +0000 (21:42 +0800)]
ShellPkg/[hex]edit: use SimpleTextInEx to read console

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

Edit and HexEdit commands assume that SimpleTxtIn translates
Ctrl+<Alpha-Key> key combinations into Unicode control characters
(0x1-0x1A).

Such translation does not seem to be required by the UEFI spec.
Shell should not rely on implementation specific behavior.
It should instead use SimpleTextInEx to read Ctrl+<Alpha-Key> key
combinations.

The patch changes edit and hexedit to only consumes SimpleTextInEx
so that the implementation specific behavior dependency is removed.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reported-by: Felix <felixp@mail.ru>
Cc: Felix <felixp@mail.ru>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoShellPkg/help: Fix "-?" may not show manual sometimes
Ruiyu Ni [Sun, 11 Feb 2018 15:17:22 +0000 (23:17 +0800)]
ShellPkg/help: Fix "-?" may not show manual sometimes
Shell core was enhanced to find the manual string in PE resource
section. But the finding algorithm is too strict: If the manual is
written beginning with:
.TH command 0 "descripton of command"

but user types "COMMAND.efi -?". The finding algorithm uses
case-sensitive compare between "command" and "COMMAND" resulting
in the manual cannot be found.

The patch fixes this issue by using existing ManFileFindTitleSection
and ManFileFindSections which compare command case-insensitive.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoMdeModulePkg/Performance.h: Remove the useless definition
Dandan Bi [Wed, 31 Jan 2018 01:57:57 +0000 (09:57 +0800)]
MdeModulePkg/Performance.h: Remove the useless definition

Remove the definitions related to old perf codes.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoVlv2TbltDevicePkg/Override/GenericBdsLib:Remove useless Perf code
Dandan Bi [Wed, 31 Jan 2018 05:09:44 +0000 (13:09 +0800)]
Vlv2TbltDevicePkg/Override/GenericBdsLib:Remove useless Perf code

Our new performance infrastructure (edk2 trunk commit hash value:
SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~
SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4) can support to
dump performance date form ACPI table in OS. So we can remove
the old perf code to write performance data to OS.

Cc: David Wei <david.wei@intel.com>
Cc: Mang Guo <mang.guo@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: zwei4 <david.wei@intel.com>
6 years agoIntelFrameworkModulePkg/GenericBdsLib: Remove the useless Perf codes
Dandan Bi [Wed, 31 Jan 2018 02:36:39 +0000 (10:36 +0800)]
IntelFrameworkModulePkg/GenericBdsLib: Remove the useless Perf codes

Our new performance infrastructure (edk2 trunk commit hash value:
SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~
SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4) can support to
dump performance date form ACPI table in OS. So we can remove
the old perf code to write performance data to OS.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoIntelFrameworkModulePkg/BdsDxe: Remove the useless Perf codes
Dandan Bi [Wed, 31 Jan 2018 02:35:17 +0000 (10:35 +0800)]
IntelFrameworkModulePkg/BdsDxe: Remove the useless Perf codes

Our new performance infrastructure (edk2 trunk commit hash value:
SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~
SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4) can support to
dump performance date form ACPI table in OS. So we can remove
the old perf code to write performance data to OS.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdeModulePkg/UefiBootManagerLib: Remove the useless perf codes
Dandan Bi [Wed, 24 Jan 2018 05:36:09 +0000 (13:36 +0800)]
MdeModulePkg/UefiBootManagerLib: Remove the useless perf codes

V2: Just update the commit message to reference the hash value of
new performance infrastructure.

Our new performance infrastructure (edk2 trunk commit hash value:
SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~
SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4) can support to
dump performance date form ACPI table in OS. So we can remove
the old perf code to write performance data to OS.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdeModulePkg/BdsDxe: Remove useless perf Code
Dandan Bi [Wed, 24 Jan 2018 05:27:09 +0000 (13:27 +0800)]
MdeModulePkg/BdsDxe: Remove useless perf Code

V2: Just update the commit message to reference the hash value of
new performance infrastructure.

Our new performance infrastructure (edk2 trunk commit hash value:
SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~
SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4) can support to
dump performance date form ACPI table in OS. So we can remove
the old perf code to write performance data to OS.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoUefiCpuPkg/S3Resume: Remove useless perf code
Dandan Bi [Wed, 24 Jan 2018 05:19:59 +0000 (13:19 +0800)]
UefiCpuPkg/S3Resume: Remove useless perf code

V2: Just update the commit message to reference the hash value of
new performance infrastructure.

Our new performance infrastructure (edk2 trunk commit hash value:
SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~
SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4)can support to
dump performance date form ACPI table in OS. So we can remove
the old perf code to write performance data to OS.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdeModulePkg/DxeCapsuleLibFmp: Verify nested capsule with FMP
Kinney, Michael D [Wed, 7 Feb 2018 01:43:32 +0000 (17:43 -0800)]
MdeModulePkg/DxeCapsuleLibFmp: Verify nested capsule with FMP

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

Update IsNestedFmpCapsule() to verify the CapsuleGuid in
the CapsuleHeader against the installed Firmware Management
Protocol instances.  The current logic that uses the ESRT
Table does not work because capsules are processed before
the ESRT Table is published at the Ready To Boot event.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoArmVirtPkg: Add SafeIntLib and BmpSupportLib to DSC files
Michael D Kinney [Tue, 2 Jan 2018 23:09:05 +0000 (15:09 -0800)]
ArmVirtPkg: Add SafeIntLib and BmpSupportLib to DSC files

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

The BootGraphicsResourceTableDxe module uses the BmpSupportLib
and SafeIntLib to convert a GOP BLT buffer to a BMP graphics image.
Add library mappings for these new library classes.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoEmulatorPkg: Add SafeIntLib and BmpSupportLib to DSC files
Michael D Kinney [Thu, 28 Dec 2017 00:38:44 +0000 (16:38 -0800)]
EmulatorPkg: Add SafeIntLib and BmpSupportLib to DSC files

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

Add BmpSupportLib and SafeIntLib mappings that are required
by GenericBdsLib.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.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: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoDuetPkg: Add SafeIntLib and BmpSupportLib to DSC files
Michael D Kinney [Thu, 28 Dec 2017 00:38:29 +0000 (16:38 -0800)]
DuetPkg: Add SafeIntLib and BmpSupportLib to DSC files

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

Add BmpSupportLib and SafeIntLib mappings that are required
by GenericBdsLib.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoQuarkPlatformPkg: Add SafeIntLib and BmpSupportLib to DSC files
Michael D Kinney [Thu, 28 Dec 2017 00:39:58 +0000 (16:39 -0800)]
QuarkPlatformPkg: Add SafeIntLib and BmpSupportLib to DSC files

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

Add BmpSupportLib and SafeIntLib mappings that are required
by the DxeCapsuleLib when CAPSULE_ENABLE is set.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
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: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoVlv2TbltDevicePkg/Override/GenericBdsLib: Use BmpSupportLib
Michael D Kinney [Thu, 28 Dec 2017 00:10:39 +0000 (16:10 -0800)]
Vlv2TbltDevicePkg/Override/GenericBdsLib: Use BmpSupportLib

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

Update GenericBdsLib to use BmpSupportLib to convert a BMP
graphics image to a GOP BLT buffer to display the boot logo.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: David Wei <david.wei@intel.com>
Cc: Mang Guo <mang.guo@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoOvmfPkg: Add SafeIntLib and BmpSupportLib to DSC files
Michael D Kinney [Sat, 30 Dec 2017 02:59:21 +0000 (18:59 -0800)]
OvmfPkg: Add SafeIntLib and BmpSupportLib to DSC files

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

The BootGraphicsResourceTableDxe module uses the BmpSupportLib
and SafeIntLib to convert a GOP BLT buffer to a BMP graphics image.
Add library mappings for these new library classes.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoIntelFrameworkModulePkg/GenericBdsLib: Use BmpSupportLib
Michael D Kinney [Thu, 28 Dec 2017 00:09:55 +0000 (16:09 -0800)]
IntelFrameworkModulePkg/GenericBdsLib: Use BmpSupportLib

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

Update GenericBdsLib to use BmpSupportLib to convert a BMP
graphics image to a GOP BLT Buffer to display the boot logo.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@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: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoMdeModulePkg/BootGraphicsResourceTableDxe: Use BmpSupportLib
Michael D Kinney [Fri, 29 Dec 2017 19:26:42 +0000 (11:26 -0800)]
MdeModulePkg/BootGraphicsResourceTableDxe: Use BmpSupportLib

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

Use BmpSupportLib to convert a GOP BLT Buffer to the BMP graphics
image that is published in an ACPI BGRT table.

* Remove use of IndustryStandard/Bmp.h include file
* Remove mBmpImageHeaderTemplate.  This is handled by BmpSupportLib
* Clean up code style with function prototypes at top
  and all module global variables together
* Update SetBootLogo() to use SafeIntLib to check input parameters
  for overflows.
* Remove internal function BgrtAcpiTableChecksum().  Use
  CalculateCheckSum8() directly from BgrtReadyToBootEventNotify()
* Remove InstallBootGraphicsResourceTable().  Move all the code into
  BgrtReadyToBootEventNotify() that is signaled at ready to boot.
* Remove all logic that converts a GOP BLT buffer to a BMP graphics image
  and use BmpSupportLib function TranslateGopBltToBmp() instead.
* Use AllocatePool() instead of AllocatePages() to allocate copy of
  BMP image that is provided by BGRT.  This is required to be compatible
  with BmpSupportLib function TranslateGopBltToBmp() that uses
  AllocatePool().
* Zero OemId in BGRT header before filling in value from PCD.
* Get size of PcdAcpiDefaultOemId and only copy the the size of the PCD
  if it is smaller than the size of the OemId field in the BGRT header.
* Use WriteUnaligned24() instead of CopyMem() for the OemTableId field
  of the BGRT header.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoMdeModulePkg/DxeCapsuleLibFmp: Use BmpSupportLib
Michael D Kinney [Thu, 28 Dec 2017 00:09:31 +0000 (16:09 -0800)]
MdeModulePkg/DxeCapsuleLibFmp: Use BmpSupportLib

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

Use BmpSupportLib to convert a BMP graphics image to a
GOP BLT buffer.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoMdeModulePkg: Add BmpSupportLib class and instance
Kinney, Michael D [Fri, 22 Dec 2017 19:24:38 +0000 (11:24 -0800)]
MdeModulePkg: Add BmpSupportLib class and instance

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

Add BmpSupportLib class and instances that provides services to
convert a BMP graphics image to a GOP BLT buffer and to convert
a GOP BLT buffer to a BMP graphics image.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoVlv2TbltDevicePkg: Switch from EsrtDxe to EsrtFmpDxe
Michael D Kinney [Thu, 4 Jan 2018 23:26:52 +0000 (15:26 -0800)]
Vlv2TbltDevicePkg: Switch from EsrtDxe to EsrtFmpDxe

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport

The EsrtFmpDxe module is a lightweight version of the EsrtDxe
module that produces ESRT entries based only on FMP Protocol
instances.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoQuarkPlatformPkg: Switch from EsrtDxe to EsrtFmpDxe
Michael D Kinney [Thu, 4 Jan 2018 23:26:26 +0000 (15:26 -0800)]
QuarkPlatformPkg: Switch from EsrtDxe to EsrtFmpDxe

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport

The EsrtFmpDxe module is a lightweight version of the EsrtDxe
module that produces ESRT entries based only on FMP Protocol
instances.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoMdeModulePkg/EsrtFmpDxe: Add EsrtFmpDxe module
Michael D Kinney [Thu, 4 Jan 2018 23:25:35 +0000 (15:25 -0800)]
MdeModulePkg/EsrtFmpDxe: Add EsrtFmpDxe module

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

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport

The EsrtFmpDxe module is a lightweight version of the EsrtDxe
module that produces ESRT entries based only on FMP Protocol
instances.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoIntelFrameworkPkg/FrameworkUefiLib: Sync with MdePkg/UefiLib
Kinney, Michael D [Fri, 2 Feb 2018 17:59:18 +0000 (09:59 -0800)]
IntelFrameworkPkg/FrameworkUefiLib: Sync with MdePkg/UefiLib

Add functions that have been added to MdePkg/UefiLib.

* GetVariable2()
* GetEfiGlobalVariable2

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@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: Star Zeng <star.zeng@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoIntelFrameworkPkg/FrameworkUefiLib: Add EfiLocateProtocolBuffer()
Kinney, Michael D [Fri, 2 Feb 2018 00:14:02 +0000 (16:14 -0800)]
IntelFrameworkPkg/FrameworkUefiLib: Add EfiLocateProtocolBuffer()

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

Add new API to the UefiLib that locates and returns
an array of protocols instances that match a given
protocol.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@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: Star Zeng <star.zeng@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoMdePkg/UefiLib: Add EfiLocateProtocolBuffer()
Michael D Kinney [Tue, 2 Jan 2018 18:40:07 +0000 (10:40 -0800)]
MdePkg/UefiLib: Add EfiLocateProtocolBuffer()

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

Add new API to the UefiLib that locates and returns
an array of protocols instances that match a given
protocol.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jiewen Yao <jiewen.yao@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: Star Zeng <star.zeng@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
6 years agoSourceLevelDebugPkg DebugUsb3: Check mUsb3Instance before dereferencing it
Star Zeng [Fri, 9 Feb 2018 02:25:12 +0000 (10:25 +0800)]
SourceLevelDebugPkg DebugUsb3: Check mUsb3Instance before dereferencing it

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
6 years agoMdeModulePkg/PerfLib: Add NULL pointer check for "Token"
Dandan Bi [Fri, 9 Feb 2018 05:21:08 +0000 (13:21 +0800)]
MdeModulePkg/PerfLib: Add NULL pointer check for "Token"

"Token" is passed through the perf entry, it's may be NULL.
So we need to add NULL pointer check before reference it.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoBaseTools: Fix VOID* type bug
Feng, YunhuaX [Fri, 9 Feb 2018 04:31:10 +0000 (12:31 +0800)]
BaseTools: Fix VOID* type bug

Code miss UINT32 and UINT64 value type setting in
VOID*, like as {UINT32({TRUE})}

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoEmbeddedPkg: _really_ delete PcdCacheEnable from .dec
Leif Lindholm [Thu, 8 Feb 2018 19:16:42 +0000 (19:16 +0000)]
EmbeddedPkg: _really_ delete PcdCacheEnable from .dec

Commit e537d878 meant to, but failed to, remove PcdCacheEnable.
Address this, and get rid of this obsolete flag.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
6 years agoBeagleBoardPkg: drop unused PcdCacheEnabled dependency
Leif Lindholm [Thu, 8 Feb 2018 19:13:35 +0000 (19:13 +0000)]
BeagleBoardPkg: drop unused PcdCacheEnabled dependency

Commit f72df138 got rid of the use of PcdCacheEnabled, but failed to
actually drop it as a dependency for BeagleBoardLib.

Get rid of it, so the module will still build when the Pcd is _really_
removed.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
6 years agoBaseTool: correct the generate compress section process
Feng, YunhuaX [Fri, 9 Feb 2018 08:06:07 +0000 (16:06 +0800)]
BaseTool: correct the generate compress section process

First generate a dummy file with section alignment,
then compress the dummy file to generate the compress file

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoUefiCpuPkg/S3Resume: Add more perf entry for S3 phase
Bi, Dandan [Thu, 8 Feb 2018 06:19:52 +0000 (14:19 +0800)]
UefiCpuPkg/S3Resume: Add more perf entry for S3 phase

V2: Just update the commit message.

Add more perf entry to hook BootScriptDonePpi/EndOfPeiPpi/
EndOfS3Resume.

Add the new perf entry with Identifier
PERF_INMODULE_START_ID/PERF_INMODULE_END_ID which are defined
in new performance infrastructure (edk2 trunk commit hash value:
SHA-1: 73fef64f14d1b97ae9bd4705df3becc022391eba ~
SHA-1: 115eae650bfd2be2c2bc37360f4a755065e774c4).
PERF_INMODULE_START_ID/PERF_INMODULE_END_ID are general Identifier
which are used within a module.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
6 years agoShellPkg/DP: Update the error message info
Dandan Bi [Fri, 9 Feb 2018 03:10:12 +0000 (11:10 +0800)]
ShellPkg/DP: Update the error message info

Make the error message clearer if fail to get ACPI/FPDT table.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoShellPkg/Dp: Add null pointer check
Bi, Dandan [Fri, 9 Feb 2018 03:10:11 +0000 (11:10 +0800)]
ShellPkg/Dp: Add null pointer check

Cc: Liming Gao <liming.gao@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg/DriverSampleDxe: Make bit fields aligned in C structure
Bi, Dandan [Thu, 8 Feb 2018 14:28:39 +0000 (22:28 +0800)]
MdeModulePkg/DriverSampleDxe: Make bit fields aligned in C structure

For a structure with a series of bit fields and used as a storage
in vfr file, and if the bit fields do not add up to the size of
the defined type.In the C code use sizeof() to get size of the
structure, the results may vary form the compiler(VS,GCC...).
But the size of the storage calculated by VfrCompiler is fixed
(calculate with alignment).To avoid the issue cased by above case,
we need to make the total width of the bit fields in the structure
aligned with the size of the defined type for these bit fields.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg/ResetSystemPei: Add reset notifications in PEI
Bret Barkelew [Thu, 1 Feb 2018 02:31:40 +0000 (18:31 -0800)]
MdeModulePkg/ResetSystemPei: Add reset notifications in PEI

The Reset Notification protocol is added in UEFI spec to support
reset notification mechanism in the DXE phase.
This patch adds similar EDKII specific Reset Notification PPI to PEI
phase to provide the same support.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoMdeModulePkg: Add ResetSystemPei PEIM
Ruiyu Ni [Mon, 4 Sep 2017 08:50:14 +0000 (16:50 +0800)]
MdeModulePkg: Add ResetSystemPei PEIM

This driver implements Reset2, ResetFilter and ResetHandler PPIs.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoMdePkg/UefiRuntimeLib: Support more module types.
Ruiyu Ni [Tue, 5 Sep 2017 03:29:46 +0000 (11:29 +0800)]
MdePkg/UefiRuntimeLib: Support more module types.

Because DxeResetSystemLib links to this library to provide
reset system services, change UefiRuntimeLib to support
the same set of module types as what DxeResetSystemLib does.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoMdeModulePkg: Add ResetUtility library class and BASE instance
Michael D Kinney [Fri, 1 Sep 2017 08:16:50 +0000 (16:16 +0800)]
MdeModulePkg: Add ResetUtility library class and BASE instance

The library class that provides services to generate a GUID specific
reset, parse the GUID from a GUID specific reset, and build the
ResetData buffer for any type of reset that requires extra data.

Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoMdeModulePkg: Add ResetSystemLib instances that call core services
Michael D Kinney [Fri, 1 Sep 2017 08:12:21 +0000 (01:12 -0700)]
MdeModulePkg: Add ResetSystemLib instances that call core services

Add a PEI instance of ResetSystemLib that calls the ResetSystem2()
service in the PEI Services Table.

Add a DXE instance of ResetSystemLib that calls the ResetSystem()
service in the UEFI Runtime Services Table.

These 2 library instances should be the default ResetSystemLib
mapping for most PEIMs and DXE drivers so all reset system requests
go through the core service.

Only the implementation of the core servies should use the
platform specific instance of the ResetSystemLib that actually
performs the hardware actions to reset the platform.

Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
6 years agoMdeModulePkg/ResetSystemRuntimeDxe: Add more debug message
Ruiyu Ni [Tue, 5 Sep 2017 03:29:00 +0000 (11:29 +0800)]
MdeModulePkg/ResetSystemRuntimeDxe: Add more debug message

The patch adds more debug message in ResetSystem().
It also removes unnecessary check of mResetNotifyDepth.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoMdeModulePkg/ResetSystemRuntimeDxe: Add platform filter and handler
Michael D Kinney [Fri, 1 Sep 2017 07:51:08 +0000 (00:51 -0700)]
MdeModulePkg/ResetSystemRuntimeDxe: Add platform filter and handler

Add support for platform specific reset filters and platform
specific reset handlers to ResetSystem().  A filter may modify
the reset type and reset data and call ResetSystem() with the
modified parameters.  A handler performs the reset action.

The support for platform specific filters and platform specific
handlers is based on the Reset Notification feature added to the
UEFI 2.7 Specification.

Platform specific reset filters are processed first so the final
reset type and reset data can be determined.  In the DXE Phase
The UEFI Reset Notifications are processed second so all UEFI
Drivers that have registered for a Reset Notification can perform
any required clean up actions.  The platform specific reset
handlers are processed third.  If there are no registered
platform specific reset handlers or none of them reset the
platform, then the default reset action based on the
ResetSystemLib is performed.

In the PEI Phase, filters and handlers are registered through
the following 2 PPIs that are based on
EFI_RESET_NOTIFICATION_PROTOCOL.
* gEdkiiPlatformSpecificResetFilterPpiGuid
* gEdkiiPlatformSpecificResetHandlerPpiGuid

In the DXE Phase, filters and handlers are registered through
the following 2 Protocols that are based on
EFI_RESET_NOTIFICATION_PROTOCOL.
* gEdkiiPlatformSpecificResetFilterProtocolGuid
* gEdkiiPlatformSpecificResetHandlerProtocolGuid

Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
6 years agoMdeModulePkg/PeiMain: Cleanup whitespace in Reset.c
Michael D Kinney [Fri, 1 Sep 2017 07:32:22 +0000 (00:32 -0700)]
MdeModulePkg/PeiMain: Cleanup whitespace in Reset.c

Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdeModulePkg/PeiMain: Always attempt to use Reset2 PPI first
Michael D Kinney [Fri, 1 Sep 2017 07:31:03 +0000 (00:31 -0700)]
MdeModulePkg/PeiMain: Always attempt to use Reset2 PPI first

Update PEI Service ResetSystem() to always attempt to use
the Reset2 PPI before looking for the Reset PPI.

Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdePkg/PeiServicesLib: Add PeiServicesResetSystem2()
Michael D Kinney [Fri, 1 Sep 2017 07:23:11 +0000 (15:23 +0800)]
MdePkg/PeiServicesLib: Add PeiServicesResetSystem2()

Add the PeiServicesResetSytstem2() function to the PeiServiesLib
to call the ResetSystem2() services in the PEI Services Table.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdePkg/Include: Add management mode FV file type and depex.
Supreeth Venkatesh [Thu, 8 Feb 2018 20:25:16 +0000 (04:25 +0800)]
MdePkg/Include: Add management mode FV file type and depex.

As per PI specification v1.6,
As per section 2.1.4.1,
The following file types exist:
Table 3. Defined File Types
Name                                   Value
EFI_FV_FILETYPE_RAW                    0x01
EFI_FV_FILETYPE_FREEFORM               0x02
EFI_FV_FILETYPE_SECURITY_CORE          0x03
EFI_FV_FILETYPE_PEI_CORE               0x04
EFI_FV_FILETYPE_DXE_CORE               0x05
EFI_FV_FILETYPE_PEIM                   0x06
EFI_FV_FILETYPE_DRIVER                 0x07
EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER   0x08
EFI_FV_FILETYPE_APPLICATION            0x09
EFI_FV_FILETYPE_MM                     0x0A
EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE  0x0B
EFI_FV_FILETYPE_COMBINED_MM_DXE        0x0C
EFI_FV_FILETYPE_MM_CORE                0x0D
EFI_FV_FILETYPE_MM_STANDALONE          0x0E
EFI_FV_FILETYPE_MM_CORE_STANDALONE     0x0F

The following new section type is added:
EFI_SECTION_MM_DEPEX

This patch adds the management mode FV file type and depex.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoUefiCpuPkg/FeaturesLib: don't init MCi_CTL/STATUS when MCA's disabled
Ruiyu Ni [Thu, 8 Feb 2018 06:43:20 +0000 (14:43 +0800)]
UefiCpuPkg/FeaturesLib: don't init MCi_CTL/STATUS when MCA's disabled

Today's McaInitialize() doesn't check State value before initialize
MCi_CTL and MCi_STATUS.
The patch fixes this issue by only initializing the two kinds of
MSRs when State is enabled.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
6 years agoShellPkg/rm: fix hang when deleting an absolutely-empty directory
Ruiyu Ni [Thu, 8 Feb 2018 03:40:04 +0000 (11:40 +0800)]
ShellPkg/rm: fix hang when deleting an absolutely-empty directory
An ordinary empty directory should contain "." and ".." entries.
When an empty directory even doesn't contain "." or ".." entry,
FileHandleFindFirstFile() may return error status and a NULL
FileInfo.
IsDirectoryEmpty() implementation in Rm.c doesn't consider this
case and the deference of FileInfo->FileName causes page fault
exception because FileInfo is NULL.
The patch checks the return status of FileHandleFindFirstFile()
to fix this issue.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoShellPkg/hexedit: Fix a read-after-free bug
Ruiyu Ni [Wed, 7 Feb 2018 16:05:10 +0000 (00:05 +0800)]
ShellPkg/hexedit: Fix a read-after-free bug

HDiskImageSetDiskNameOffsetSize() and HFileImageSetFileName()
may be called using the current disk name or file name.
When this happens, today's implementation firstly frees the memory
and then accesses the just-freed memory.
The patch fixes this issue by doing nothing when the disk or file
name is the current one.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoSourceLevelDebugPkg DebugUsb3: Fix GCC build failures
Star Zeng [Thu, 8 Feb 2018 08:01:06 +0000 (16:01 +0800)]
SourceLevelDebugPkg DebugUsb3: Fix GCC build failures

Fix GCC build failures below.
variable 'EvtTrb' set but not used [-Werror=unused-but-set-variable]
variable 'Index' set but not used [-Werror=unused-but-set-variable]

The build failure could only be caught with -D SOURCE_DEBUG_USE_USB3
build flag.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
6 years agoBaseTools: Update Expression.py for string comparison and MACRO replace issue
Yunhua Feng [Wed, 7 Feb 2018 13:37:26 +0000 (21:37 +0800)]
BaseTools: Update Expression.py for string comparison and MACRO replace issue

1. Fix string comparison incorrect issue, we expected "ABC" is greater than
"AAD" since the second char 'B' is greater than 'A'.
2. fix MACRO not replace issue.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
6 years agoBaseTools: not specified value of MAX_CONCURRENT_THREAD_NUMBER
Yonghong Zhu [Mon, 5 Feb 2018 06:14:07 +0000 (14:14 +0800)]
BaseTools: not specified value of MAX_CONCURRENT_THREAD_NUMBER

when MAX_CONCURRENT_THREAD_NUMBER is not specified, tool will
automatically detect number of processor threads.

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=775
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoOvmfPkg/PlatformPei: sync AmdSevInitialize() definition with declaration
Laszlo Ersek [Tue, 6 Feb 2018 21:18:36 +0000 (22:18 +0100)]
OvmfPkg/PlatformPei: sync AmdSevInitialize() definition with declaration

"Platform.h" declares the AmdSevInitialize() function without EFIAPI, but
the definition in "AmdSev.c" includes EFIAPI.

GCC toolchains without LTO do not catch this error because "AmdSev.c" does
not include "Platform.h"; i.e. the declaration used by callers such as
"Platform.c" is not actually matched against the function definition at
build time.

With LTO enabled, the mismatch is found -- however, as a warning only, due
to commit f8d0b9662993 ("BaseTools GCC5: disable warnings-as-errors for
now", 2016-08-03).

Include the header in the C file (which turns the issue into a hard build
error on all GCC toolchains), plus sync the declaration from the header
file to the C file.

There's been no functional breakage because AmdSevInitialize() takes no
parameters.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Fixes: 13b5d743c87a22dfcd94e8475d943dee5712b62d
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
6 years agoShellPkg/UefiShellDebug1CommandsLib: sync Compress() definition with decl.
Laszlo Ersek [Tue, 6 Feb 2018 21:08:07 +0000 (22:08 +0100)]
ShellPkg/UefiShellDebug1CommandsLib: sync Compress() definition with decl.

"Compress.h" declares the Compress() function as EFIAPI, but the
definition in "Compress.c" lacks EFIAPI.

GCC toolchains without LTO do not catch this error because "Compress.c"
does not include "Compress.h"; i.e. the declaration used by callers such
as "EfiCompress.c" is not actually matched against the function definition
at build time.

With LTO enabled, the mismatch is found -- however, as a warning only, due
to commit f8d0b9662993 ("BaseTools GCC5: disable warnings-as-errors for
now", 2016-08-03).

Include the header in the C file (which turns the issue into a hard build
error on all GCC toolchains), plus sync the declaration from the header
file to the C file. Finally, remove EFIAPI from both declaration and
definition -- this was the original intent of commit c4e74e9b814c
("ShellPkg/UefiShellDebug1CommandsLib: Remove unnecessary EFIAPI",
2016-10-09), but it missed the header file.

(Gary meant to address that omission in Oct 2017:

  [edk2] [PATCH] ShellPkg/UefiShellDebug1CommandsLib: Remove EFIAPI from
                 Compress()

  http://mid.mail-archive.com/20171026065329.32311-1-glin@suse.com

and Ray reviewed the patch, but then the patch was never committed.)

So do the sync and drop EFIAPI now.

This happens to fix the EFICOMPRESS shell command, when built with GCC for
X64.

Cc: Gary Lin <glin@suse.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Fixes: c4e74e9b814cfb4b51cf832f3bb218cd2aba348b
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Gary Lin <glin@suse.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoSourceLevelDebugPkg DebugUsb3: Support IOMMU
Star Zeng [Wed, 31 Jan 2018 07:17:05 +0000 (15:17 +0800)]
SourceLevelDebugPkg DebugUsb3: Support IOMMU

For PEI, allocate granted DMA buffer from IOMMU PPI.
For DXE, map DMA buffer by PciIo.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoSourceLevelDebugPkg DebugUsb3: Fix some typos
Star Zeng [Sun, 4 Feb 2018 09:33:10 +0000 (17:33 +0800)]
SourceLevelDebugPkg DebugUsb3: Fix some typos

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
6 years agoSourceLevelDebugPkg DebugAgentLib: Rename IsBsp to DebugAgentIsBsp
Star Zeng [Fri, 2 Feb 2018 07:34:48 +0000 (15:34 +0800)]
SourceLevelDebugPkg DebugAgentLib: Rename IsBsp to DebugAgentIsBsp

For avoiding function name confliction,
rename IsBsp to DebugAgentIsBsp.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoBaseTools: Enhance error handling for unsupported toolchain Flags/Path
Yonghong Zhu [Wed, 7 Feb 2018 01:17:08 +0000 (09:17 +0800)]
BaseTools: Enhance error handling for unsupported toolchain Flags/Path

Case1: Cover the Tool PATH is not exist, eg: build MdeModule under GCC5
toolchain and IPF arch.
Case2: Cover the Tool FLAGS is not exist, eg: build OvmfPkg under
CLANG35 toolchain and X64 arch.

fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=595
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoSecurityPkg: Tcg2Smm: Refine type cast in pointer abstraction
Zhang, Chao B [Thu, 8 Feb 2018 06:22:39 +0000 (14:22 +0800)]
SecurityPkg: Tcg2Smm: Refine type cast in pointer abstraction

Pointer subtraction is not performed by pointers to elements of the same
array object. Such behavior is undefined by C11 standard and might lead to
potential issues, Refine pointer subtraction by first casting each pointer
to UINTN.

Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
6 years agoUefiCpuPkg/FeaturesLib: Fix Haswell CPU hang with 50% throttling
Ruiyu Ni [Tue, 6 Feb 2018 07:26:41 +0000 (15:26 +0800)]
UefiCpuPkg/FeaturesLib: Fix Haswell CPU hang with 50% throttling

Today's implementation only assumes SandyBridge CPU supports
Extended On-Demand Clock Modulation Duty Cycle.
Actually it is supported when CPUID.06h.EAX[5] == 1.

When platform requests 50% throttling, it causes value 1000b
set to the low-4 bits of IA32_CLOCK_MODULATION.
But the wrong code sets 1000b to bits[1-3] which causes assertion.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jeff Fan <vanjeff_919@hotmail.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
6 years agoShellPkg/Dp: Updated to dump perf log based on FPDT table
Dandan Bi [Mon, 22 Jan 2018 08:39:03 +0000 (16:39 +0800)]
ShellPkg/Dp: Updated to dump perf log based on FPDT table

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg/FirmwarePerfSmm:Enhance for new pref infrastructure
Dandan Bi [Tue, 30 Jan 2018 03:07:36 +0000 (11:07 +0800)]
MdeModulePkg/FirmwarePerfSmm:Enhance for new pref infrastructure

V3:
a. Remove unused definitions
b. Get records size form the records buffer when getting size action
is triggered.

V2:
Update FirmwarePerformanceSmm to receive the address
of performance records instead of records content.

Receive buffer address of Boot performance records
which are reported by SmmCorePerformanceLib.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg/FirmwarePerfDxe:Enhance for new pref infrastructure
Dandan Bi [Wed, 17 Jan 2018 01:47:58 +0000 (09:47 +0800)]
MdeModulePkg/FirmwarePerfDxe:Enhance for new pref infrastructure

V4:
Update the GUID for status code in DxeCorePerformanceLib and
FirmwarePerformanceDxe.

V3:Add handling for the case when performance feature is not enabled.

V2:
Update FirmwarePerformanceDxe to receive the address
of performance records instead of records content.

1. Remove the macro EXTENSION_RECORD_SIZE, since the extension
size can be got through PcdExtFpdtBootRecordPadSize.

2. Hook EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT to install ACPI table

3. Copy SMM record accord to the allocated size

4. Receive Boot performance table address instead of
 contents which are reported DxeCorePerformanceLib.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg/FirmwarePerformancePei:Add FPDT records for S3 phase
Dandan Bi [Wed, 17 Jan 2018 01:42:42 +0000 (09:42 +0800)]
MdeModulePkg/FirmwarePerformancePei:Add FPDT records for S3 phase

Add FPDT records into boot performance table for S3 phase

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg/SmmCorePerformanceLib:Track FPDT record in SMM phase
Dandan Bi [Wed, 17 Jan 2018 01:31:18 +0000 (09:31 +0800)]
MdeModulePkg/SmmCorePerformanceLib:Track FPDT record in SMM phase

V3:
a. Handle the case when string is empty in String Record.
b. Use gEdkiiFpdtExtendedFirmwarePerformanceGuid to report status
code.
c. Refine the code logic.

V2:
Update SmmCorePerformanceLib to report the buffer address of
boot performance records instead of records contents.

Updated to convert Pref entry to FPDT record in SMM phase and then
export records to FPDT table.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg/DxeCorePerformanceLib:Track FPDT record in DXE phase
Dandan Bi [Fri, 19 Jan 2018 05:01:38 +0000 (13:01 +0800)]
MdeModulePkg/DxeCorePerformanceLib:Track FPDT record in DXE phase

V4:
a.Update the GUID for status code in DxeCorePerformanceLib and
FirmwarePerformanceDxe.
b. Add check for Insert FPDT record in DxeCorePerformanceLib
to avoid re-entry case.

V3:
a. Handle the case when string is empty in String Record.
b. refine the code logic.

V2:
Update DxecorePerformanceLib to report the boot performance table
address instead of records contents.

Updated to convert Pref entry to FPDT record in DXE phase and then
allocate boot performance table to save the record and report
the address of boot performance table to FirmwarePerformanceDxe.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg/PeiPerformance:Updated to track FPDT record in PEI phase
Dandan Bi [Fri, 19 Jan 2018 04:46:02 +0000 (12:46 +0800)]
MdeModulePkg/PeiPerformance:Updated to track FPDT record in PEI phase

V3:Handle the case when string is empty in String Record.

Updated to convert Pref entry to FPDT record in PEI phase and then
report the records to DxeCorePerfLib through GUID hob.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg:Add definitions for new Performance infrastructure
Gao, Liming [Thu, 7 Dec 2017 15:29:53 +0000 (23:29 +0800)]
MdeModulePkg:Add definitions for new Performance infrastructure

V3:
Add "FPDT_" prefix for related definitions.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoUefiCpuPkg/PiSmmCpuDxeSmm: fix infinite loop issue in SMM profile
Jian J Wang [Tue, 6 Feb 2018 02:08:25 +0000 (10:08 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: fix infinite loop issue in SMM profile

> v2:
>   Reduce the number of page to update/restore from 3 to 2 because DF
>   has no effect in this issue.

The infinite loop is caused by the memory instruction, such as
"rep mov", operating on memory block crossing boundary of NON-PRESENT
pages. Because the address triggering page fault set in CR2 will be in
the first page, SmmProfilePFHandler() will only change the first page
into PRESENT. The page following will be still in NON-PRESENT status.

Since SmmProfilePFHandler() will setup single-step trap for the
instruction causing #PF, when the handler returns back to the
instruction and re-execute it, both #DB and #PF will be triggered
because the instruction wants to access both first and second page
but only first page is PRESENT.

Normally #DB exception will be handled first and its handler will
change first page back to NON-PRESENT status. Then #PF is handled
and its handler will change first page to PRESENT status again and
setup another single-step for the instruction triggering #PF. Then
the whole system falls into an infinite loop and the memory operation
will never move on.

This patch fix above situation by always changing 2 pages to PRESENT
status instead of just 1 page. Those 2 pages include the page causing
#PF and the page after it.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
6 years agoMdeModulePkg/PiSmmCore: add API parameter check
Jian J Wang [Tue, 6 Feb 2018 05:12:36 +0000 (13:12 +0800)]
MdeModulePkg/PiSmmCore: add API parameter check

The Heap Guard feature wrapped SmmInternalFreePagesEx with
SmmInternalFreePagesExWithGuard but didn't add necessary
parameter check. This patch fixes this situation.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdeModulePkg/PciBusDxe: Fix VS2012 build failure
Dandan Bi [Wed, 7 Feb 2018 01:00:17 +0000 (09:00 +0800)]
MdeModulePkg/PciBusDxe: Fix VS2012 build failure

Initialize local variable to suppress warning C4703:
potentially uninitialized local pointer variable.

Both reads (dereferences) of "PciRootBridgeIo" in
PciBusDriverBindingStart() are only reached if
"gFullEnumeration" is TRUE on entry *and* we successfully
open the EfiPciRootBridgeIoProtocol interface.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
6 years agoBaseTools: Fixed incorrect Structure Pcd Value.
Feng, Bob C [Wed, 7 Feb 2018 04:10:29 +0000 (12:10 +0800)]
BaseTools: Fixed incorrect Structure Pcd Value.

When structurePCD only has overall value assigned
in Dsc under different SKU, the value under default sku is used.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoBaseTools: Fixed Build failed issue.
BobCF [Tue, 6 Feb 2018 07:20:46 +0000 (15:20 +0800)]
BaseTools: Fixed Build failed issue.

If the PCD is not used in DSC file and user set
that PCD value from Command line, build will fail.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoBaseTool: Fixed Pcd issues.
Feng, Bob C [Wed, 7 Feb 2018 02:01:59 +0000 (10:01 +0800)]
BaseTool: Fixed Pcd issues.

1. Check variable offset when merging Hii Pcds
2. Fixed the issue of Hii value inherit with default store.
3. Error handling for incorrect structure pcd declare.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>