]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
5 years agoArmVirtPkg: resolve PciCapLib, PciCapPciSegmentLib, PciCapPciIoLib
Laszlo Ersek [Fri, 4 May 2018 08:09:20 +0000 (10:09 +0200)]
ArmVirtPkg: resolve PciCapLib, PciCapPciSegmentLib, PciCapPciIoLib

Resolve the PciCapLib, PciCapPciSegmentLib, and PciCapPciIoLib classes to
their single respective instances under OvmfPkg. Later patches will use
those lib classes in OvmfPkg drivers, some of which are included in
ArmVirt platforms.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoOvmfPkg: resolve PciCapLib, PciCapPciSegmentLib, PciCapPciIoLib
Laszlo Ersek [Fri, 4 May 2018 08:06:08 +0000 (10:06 +0200)]
OvmfPkg: resolve PciCapLib, PciCapPciSegmentLib, PciCapPciIoLib

Resolve the PciCapLib, PciCapPciSegmentLib, and PciCapPciIoLib classes to
their single respective instances. Later patches will use these lib
classes in OvmfPkg drivers.

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>
5 years agoOvmfPkg: introduce PciCapPciIoLib
Laszlo Ersek [Sat, 28 Apr 2018 21:23:10 +0000 (23:23 +0200)]
OvmfPkg: introduce PciCapPciIoLib

Add a library class, and a UEFI_DRIVER lib instance, that are layered on
top of PciCapLib, and allow clients to plug an EFI_PCI_IO_PROTOCOL backend
into PciCapLib, for config space access.

(Side note:

Although the UEFI spec says that EFI_PCI_IO_PROTOCOL_CONFIG() returns
EFI_UNSUPPORTED if "[t]he address range specified by Offset, Width, and
Count is not valid for the PCI configuration header of the PCI
controller", this patch doesn't directly document the EFI_UNSUPPORTED
error code, for ProtoDevTransferConfig() and its callers
ProtoDevReadConfig() and ProtoDevWriteConfig(). Instead, the patch refers
to "unspecified error codes". The reason is that in edk2, the
PciIoConfigRead() and PciIoConfigWrite() functions [1] can also return
EFI_INVALID_PARAMETER for the above situation.

Namely, PciIoConfigRead() and PciIoConfigWrite() first call
PciIoVerifyConfigAccess(), which indeed produces the standard
EFI_UNSUPPORTED error code, if the device's config space is exceeded.
However, if PciIoVerifyConfigAccess() passes, and we reach
RootBridgeIoPciRead() and RootBridgeIoPciWrite() [2], then
RootBridgeIoCheckParameter() can still fail, e.g. if the root bridge
doesn't support extended config space (see commit 014b472053ae3).

For all kinds of Limit violations in IO, MMIO, and config space,
RootBridgeIoCheckParameter() returns EFI_INVALID_PARAMETER, not
EFI_UNSUPPORTED. That error code is then propagated up to, and out of,
PciIoConfigRead() and PciIoConfigWrite().

[1] MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c
[2] MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c
)

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>
5 years agoOvmfPkg: introduce PciCapPciSegmentLib
Laszlo Ersek [Sat, 28 Apr 2018 21:22:59 +0000 (23:22 +0200)]
OvmfPkg: introduce PciCapPciSegmentLib

Add a library class, and a BASE lib instance, that are layered on top of
PciCapLib, and allow clients to plug a PciSegmentLib backend into
PciCapLib, for config space access.

(Side note:

The "MaxDomain" parameter is provided because, in practice, platforms
exist where a PCI Express device may show up on a root bridge such that
the root bridge doesn't support access to extended config space. Earlier
the same issue was handled for MdeModulePkg/PciHostBridgeDxe in commit
014b472053ae3. However, that solution does not apply to the PciSegmentLib
class, because:

(1) The config space accessor functions of the PciSegmentLib class, such
    as PciSegmentReadBuffer(), have no way of informing the caller whether
    access to extended config space actually succeeds.

    (For example, in the UefiPciSegmentLibPciRootBridgeIo instace, which
    could in theory benefit from commit 014b472053ae3, the
    EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Pci.Read() status code is explicitly
    ignored, because there's no way for the lib instance to propagate it
    to the PciSegmentLib caller. If the
    EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Pci.Read() call fails, then
    DxePciSegmentLibPciRootBridgeIoReadWorker() returns Data with
    indeterminate value.)

(2) There is no *general* way for any firmware platform to provide, or
    use, a PciSegmentLib instance in which access to extended config space
    always succeeds.

In brief, on a platform where config space may be limited to 256 bytes,
access to extended config space through PciSegmentLib may invoke undefined
behavior; therefore PciCapPciSegmentLib must give platforms a way to
prevent such access.)

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>
5 years agoOvmfPkg: introduce PciCapLib
Laszlo Ersek [Sat, 28 Apr 2018 21:22:11 +0000 (23:22 +0200)]
OvmfPkg: introduce PciCapLib

Add a library class, and a BASE lib instance, to work more easily with PCI
capabilities in PCI config space. Functions are provided to parse
capabilities lists, and to locate, describe, read and write capabilities.
PCI config space access is abstracted away.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Suggested-by: 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>
5 years agoSecurityPkg/TcgStorage*Lib.h: Fix ECC reported issues.
Eric Dong [Tue, 22 May 2018 05:47:16 +0000 (13:47 +0800)]
SecurityPkg/TcgStorage*Lib.h: Fix ECC reported issues.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
5 years agoMdePkg/TcgStorage*.h: Fixed ECC reported issues.
Eric Dong [Tue, 22 May 2018 05:46:42 +0000 (13:46 +0800)]
MdePkg/TcgStorage*.h: Fixed ECC reported issues.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
5 years agoBaseTools/tools_def: add "-fno-unwind-tables" to GCC_AARCH64_CC_FLAGS
Laszlo Ersek [Fri, 18 May 2018 17:20:32 +0000 (19:20 +0200)]
BaseTools/tools_def: add "-fno-unwind-tables" to GCC_AARCH64_CC_FLAGS

The ElfConvert routines in GenFw don't handle the ".eh_frame" ELF section
emitted by gcc. For this reason, Leif disabled the generation of that
section for AARCH64 with "-fno-asynchronous-unwind-tables" in commit
28e80befa4fe [1], and Ard did the same for IA32 and X64 in commit
26ecc55c027d [2]. (The CLANG38 toolchain received the same flag at its
inception, in commit 6f756db5ea05 [3].)

However, ".eh_frame" is back now; in upstream gcc commit 9cbee213b579 [4]
(part of tag "gcc-8_1_0-release"), both "-fasynchronous-unwind-tables" and
"-funwind-tables" were made the default for AARCH64. (The patch author
described the effects on the gcc mailing list [5].) We have to counter the
latter flag with "-fno-unwind-tables", otherwise GenFw chokes on
".eh_frame" again (triggered for example on Fedora 28).

"-f[no-]unwind-tables" goes back to at least gcc-4.4 [6], so it's safe to
add to GCC_AARCH64_CC_FLAGS.

[1] https://github.com/tianocore/edk2/commit/28e80befa4fe
[2] https://github.com/tianocore/edk2/commit/26ecc55c027d
[3] https://github.com/tianocore/edk2/commit/6f756db5ea05
[4] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=9cbee213b579
[5] http://mid.mail-archive.com/7b28c03a-c032-6cec-c127-1c12cbe98eeb@foss.arm.com
[6] https://gcc.gnu.org/onlinedocs/gcc-4.4.7/gcc/Code-Gen-Options.html

Cc: "Danilo C. L. de Paula" <ddepaula@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Cole Robinson <crobinso@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Reported-by: "Danilo C. L. de Paula" <ddepaula@redhat.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: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg/IndustryStandard: Add header file for SPMI ACPI table
Hao Wu [Thu, 22 Mar 2018 07:52:31 +0000 (15:52 +0800)]
MdePkg/IndustryStandard: Add header file for SPMI ACPI table

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

Add the header file for Service Processor Management Interface ACPI table
definition.

Cc: Younas Khan <pmdyounaskhan786@gmail.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
5 years agoBaseTools/Workspace: Fix ValueChain set
Marvin Haeuser [Tue, 22 May 2018 11:48:29 +0000 (19:48 +0800)]
BaseTools/Workspace: Fix ValueChain set

Commit 88252a90d1ca7846731cd2e4e8e860454f7d97a3 changed ValueChain
from a dict to a set, but also changed the (former) key type from a
touple to two separate values, which was probably unintended and also
breaks build for packages involving Structured PCDs, because add()
only takes one argument.
This commit changes the values back to touples.

V2:
  - Removed a whitespace change.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoMdeModulePkg Variable: Fix XCODE5 varargs warning
Liming Gao [Mon, 14 May 2018 13:12:35 +0000 (21:12 +0800)]
MdeModulePkg Variable: Fix XCODE5 varargs warning

https://bugzilla.tianocore.org/show_bug.cgi?id=741
Change VariableGetBestLanguage() parameter type from BOOLEAN to UINTN

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Steven Shi <steven.shi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoIntelFrameworkPkg UefiLib: Fix XCODE5 varargs warning
Liming Gao [Mon, 14 May 2018 13:12:34 +0000 (21:12 +0800)]
IntelFrameworkPkg UefiLib: Fix XCODE5 varargs warning

https://bugzilla.tianocore.org/show_bug.cgi?id=741
Change GetBestLanguage() parameter type from BOOLEAN to UINTN

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Steven Shi <steven.shi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg UefiLib: Fix XCODE5 varargs warning
Liming Gao [Mon, 14 May 2018 13:12:33 +0000 (21:12 +0800)]
MdePkg UefiLib: Fix XCODE5 varargs warning

https://bugzilla.tianocore.org/show_bug.cgi?id=741
Change GetBestLanguage() parameter type from BOOLEAN to UINTN

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Steven Shi <steven.shi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoOvmfPkg/PlatformBootManagerLib: process TPM PPI request
Marc-André Lureau [Fri, 18 May 2018 12:23:04 +0000 (14:23 +0200)]
OvmfPkg/PlatformBootManagerLib: process TPM PPI request

Call Tcg2PhysicalPresenceLibProcessRequest() to process pending PPI
requests from PlatformBootManagerAfterConsole().

Laszlo understanding of edk2 is that the PPI operation processing was
meant to occur *entirely* before End-Of-Dxe, so that 3rd party UEFI
drivers couldn't interfere with PPI opcode processing *at all*.

He suggested that we should *not* call
Tcg2PhysicalPresenceLibProcessRequest() from BeforeConsole(). Because,
an "auth" console, i.e. one that does not depend on a 3rd party
driver, is *in general* impossible to guarantee. Instead we could opt
to trust 3rd party drivers, and use the "normal" console(s) in
AfterConsole(), in order to let the user confirm the PPI requests. It
will depend on the user to enable Secure Boot, so that the
trustworthiness of those 3rd party drivers is ensured. If an attacker
roots the guest OS from within, queues some TPM2 PPI requests, and
also modifies drivers on the EFI system partition and/or in GPU option
ROMs (?), then those drivers will not load after guest reboot, and
thus the dependent console(s) won't be used for confirming the PPI
requests.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoOvmfPkg: add Tcg2PhysicalPresenceLibQemu
Marc-André Lureau [Fri, 18 May 2018 12:23:03 +0000 (14:23 +0200)]
OvmfPkg: add Tcg2PhysicalPresenceLibQemu

Cloned "SecurityPkg/Library/DxeTcg2PhysicalPresenceLib" and:

- removed all the functions that are unreachable from
  Tcg2PhysicalPresenceLibProcessRequest() [called from platform BDS],
  or SubmitRequestToPreOSFunction() and
  ReturnOperationResponseToOsFunction() [called from Tcg2Dxe].

- replaced everything that's related to the
  TCG2_PHYSICAL_PRESENCE*_VARIABLE variables, with direct access to
  the QEMU structures.

This commit is based on initial experimental work from Stefan Berger.
In particular, he wrote most of QEMU PPI support, and designed the
qemu/firmware interaction. Initially, Stefan tried to reuse the
existing SecurityPkg code, but we eventually decided to get rid of the
variables and simplify the ovmf/qemu version.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[lersek@redhat.com: clean up non-idiomatic coding style]
[lersek@redhat.com: null mPpi on invalid PPI address]
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoOvmfPkg/IndustryStandard: add QemuTpm.h header
Marc-André Lureau [Fri, 18 May 2018 12:23:02 +0000 (14:23 +0200)]
OvmfPkg/IndustryStandard: add QemuTpm.h header

Add some common macros and type definitions corresponding to the QEMU
TPM interface.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
5 years agoOvmfPkg: add Tcg2PhysicalPresenceLibNull when !TPM2_ENABLE
Marc-André Lureau [Fri, 18 May 2018 12:23:01 +0000 (14:23 +0200)]
OvmfPkg: add Tcg2PhysicalPresenceLibNull when !TPM2_ENABLE

This NULL library will let us call
Tcg2PhysicalPresenceLibProcessRequest() unconditionally from
BdsPlatform when building without TPM2_ENABLE.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[lersek@redhat.com: replace MdeModulePkg.dec w/ MdePkg.dec]
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoBaseTools: Enhance error message when file is not exist for Gensec
Yonghong Zhu [Fri, 11 May 2018 08:11:51 +0000 (16:11 +0800)]
BaseTools: Enhance error message when file is not exist for Gensec

When the file is not exist in workspace or packages path, current
Gensec tool doesn't report exactly error message.

FILE FV_IMAGE = 11111111-4CF1-42D8-A0C3-B3F60779dF4D  {
  SECTION GUIDED A7717414-C616-4977-9420-844712A735BF {
    SECTION FV_IMAGE = TestPkg/Test.fd
  }
}

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoBaseTools: Report more clear error message when PCD type mismatch
Yunhua Feng [Wed, 16 May 2018 05:59:59 +0000 (13:59 +0800)]
BaseTools: Report more clear error message when PCD type mismatch

Error message is not clear when PCD type defined in driver's Library
is different with PCD type defined in DSC components or PCD type
defined in DSC PCD section.

Case as below:
DSC:
[PcdsFixedAtBuild]
PcdToken.PcdCName | "A"
[Components]
 TestPkg/TestDriver.inf {
  <PcdsPatchableInModule>
    PcdToken.PcdCName | "B"
 }
Library:
[Pcd]
 PcdToken.PcdCName

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>
5 years agoBaseTools: Library PCD type will inherit from the driver
Yunhua Feng [Mon, 14 May 2018 01:54:46 +0000 (09:54 +0800)]
BaseTools: Library PCD type will inherit from the driver

If a PCD is not referenced in global PCD section of DSC file at all,
but is referenced in module scope, then the default PCD type for libs
should be the module scoped PCD type.

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=901
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>
5 years agoBaseTools: Fix bug PCD type in component is not same with Pcd section
Yunhua Feng [Thu, 10 May 2018 08:47:44 +0000 (16:47 +0800)]
BaseTools: Fix bug PCD type in component is not same with Pcd section

Per DSC spec 3.11 [Components] Sections:
The PCD access methods (and storage methods) are selected on a platform
basis - it is not permitted to have a PCD listed in one of the Pcd
sections and use it differently in an individual module. For example,
if a PCD is listed in a [PcdsFixedAtBuild] section, it is not permitted
to list it in a <PcdsPatchableInModule> sub-section of an INF file.
but current code doesn't report error for this case.

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=951
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>
5 years agoSecurityPkg:Tcg2Smm: Update TcgNvs info after memory is allocated
Zhang, Chao B [Fri, 18 May 2018 08:38:18 +0000 (16:38 +0800)]
SecurityPkg:Tcg2Smm: Update TcgNvs info after memory is allocated

Update package format info in _PRS to TcgNvs after memory is allocated.

Change-Id: Icfadb350e60d3ed2df332e92c257ce13309c0018
Contributed-under: TianoCore Contribution Agreement 1.1
Cc: Yao Jiewen <jiewen.yao@intel.com>
Cc: Long Qin <qin.long@intel.com>
Signed-off-by: Zhang, Chao B <chao.b.zhang@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
5 years agoBaseTools: Separate HOST and PREFIX env for GCC tool chain
Liming Gao [Wed, 25 Apr 2018 10:11:42 +0000 (18:11 +0800)]
BaseTools: Separate HOST and PREFIX env for GCC tool chain

The crossing GCC compiler may use the different path for make and gcc tool.
So, GCC_HOST_BIN is introduced for make path. GCC5_BIN is still kept for
gcc path. User needs to set GCC_HOST_BIN besides set GCC5_BIN env if
the default make is not used. Normally, make is in the default system path.
GCC_HOST_BIN is not required to be set.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
5 years agoIntelFrameworkPkg/UefiLib: Fix build fail caused by commit b6d5def2fa
Dandan Bi [Fri, 18 May 2018 06:15:06 +0000 (14:15 +0800)]
IntelFrameworkPkg/UefiLib: Fix build fail caused by commit b6d5def2fa

In commit b6d5def2faf56334128ea2f056356d7e3852831e
when adding 'OUT' decorator for the parameter in AddUnicodeString(),
it delete the function name by mistake. This patch is to fix this
issue.

CC: Marvin Haeuser <Marvin.Haeuser@outlook.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>
5 years agoMdePkg/SmmPeriodicSmiLib: Get Periodic SMI Context More Robustly
Ruiyu Ni [Wed, 9 May 2018 09:36:06 +0000 (17:36 +0800)]
MdePkg/SmmPeriodicSmiLib: Get Periodic SMI Context More Robustly

The PeriodicSmiDispatchFunction() in SmmPeriodicSmiLib may assert
with "Bad CR signature".

Currently, the SetActivePeriodicSmiLibraryHandler() function
(invoked at the beginning of the PeriodicSmiDispatchFunction()
function) attempts to locate the PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT
structure pointer for the current periodic SMI from a given
EFI_SMM_PERIODIC_TIMER_REGISTER_CONTEXT (RegiserContext) structure
pointer (using the CR macro).

The RegisterContext structure pointer passed to the
PeriodicSmiDispatchFunction() is assumed to point to the same
RegisterContext structure address given to the
SmmPeriodicTimerDispatch2 protocol Register() API in
PeriodicSmiEnable().

However, certain SmmPeriodicTimerDispatch2 implementation may copy
the RegisterContext to a local buffer and pass that address as the
context to PeriodicSmiDispatchFunction() in which case usage of the
CR macro to find the parent structure base fails.

The patch uses the LookupPeriodicSmiLibraryHandler() function to
find the PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT structure pointer.
This works even in this scenario since the DispatchHandle returned
from the SmmPeriodicTimerDispatch2 Register() function uniquely
identifies that registration.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoOvmfPkg/PlatformBootManagerLib: connect Virtio RNG devices again
Laszlo Ersek [Thu, 17 May 2018 19:51:11 +0000 (21:51 +0200)]
OvmfPkg/PlatformBootManagerLib: connect Virtio RNG devices again

Virtio RNG devices are never boot devices, so in commit 245c643cc8b7 we
stopped connecting them. This is a problem because an OS boot loader may
depend on EFI_RNG_PROTOCOL to seed the OS's RNG.

Connect Virtio RNG devices again. And, while commit 245c643cc8b7 removed
that from PlatformBootManagerAfterConsole(), reintroduce it now to
PlatformBootManagerBeforeConsole() -- this way Driver#### options launched
between both functions may access EFI_RNG_PROTOCOL too.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Fixes: 245c643cc8b73240c3b88cb55b2911b285a8c10d
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1579518
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoArmVirtPkg/PlatformBootManagerLib: connect Virtio RNG devices again
Laszlo Ersek [Thu, 17 May 2018 19:51:11 +0000 (21:51 +0200)]
ArmVirtPkg/PlatformBootManagerLib: connect Virtio RNG devices again

Virtio RNG devices are never boot devices, so in commit ff1d0fbfbaec we
stopped connecting them. This is a problem because an OS boot loader may
depend on EFI_RNG_PROTOCOL to seed the OS's RNG.

Connect Virtio RNG devices again. And, while commit ff1d0fbfbaec removed
that from PlatformBootManagerAfterConsole(), reintroduce it now to
PlatformBootManagerBeforeConsole() -- this way Driver#### options launched
between both functions may access EFI_RNG_PROTOCOL too.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Fixes: ff1d0fbfbaec55038ccf888759588fa4e21516f4
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1579518
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoOvmfPkg/QemuVideoDxe: Enable DISPLAY_OTHER pci class for qemu stdvga
Gerd Hoffmann [Thu, 17 May 2018 09:21:33 +0000 (11:21 +0200)]
OvmfPkg/QemuVideoDxe: Enable DISPLAY_OTHER pci class for qemu stdvga

This makes QemuVideo bind to the secondary-vga device.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoOvmfPkg/QemuVideoDxe: Add SubClass field to QEMU_VIDEO_CARD
Gerd Hoffmann [Thu, 17 May 2018 09:21:32 +0000 (11:21 +0200)]
OvmfPkg/QemuVideoDxe: Add SubClass field to QEMU_VIDEO_CARD

Then check for PCI_CLASS_DISPLAY_VGA using the new field.
This allows to enable/disable non-vga display classes per
card entry.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoMdeModulePkg PeiCore: FvCount to be checked for the registered for shadow PEIM
Liming Gao [Wed, 16 May 2018 01:35:01 +0000 (09:35 +0800)]
MdeModulePkg PeiCore: FvCount to be checked for the registered for shadow PEIM

The PEIM in all cached FV image may be in registered for shadow status.
Current logic CurrentPeimFvCount is not enough.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoIntelFrameworkPkg/FrameworkUefiLib: Add 'OUT' decorator where necessary.
Marvin.Haeuser@outlook.com [Sat, 5 May 2018 14:23:55 +0000 (22:23 +0800)]
IntelFrameworkPkg/FrameworkUefiLib: Add 'OUT' decorator where necessary.

The functions AddUnicodeString() and AddUnicodeString2() might return
a new value into their parameter UnicodeStringTable, hence add the
appropiate 'OUT' decorator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg/UefiLib: Add 'OUT' decorator where necessary.
Marvin.Haeuser@outlook.com [Sat, 5 May 2018 14:23:54 +0000 (22:23 +0800)]
MdePkg/UefiLib: Add 'OUT' decorator where necessary.

The functions AddUnicodeString() and AddUnicodeString2() might return
a new value into their parameter UnicodeStringTable, hence add the
appropiate 'OUT' decorator.

V2: Update FrameworkUefiLib as well.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg/PeiServicesLib: Decorate 'PpiDescriptor' as OPTIONAL for LocatePpi().
Marvin.Haeuser@outlook.com [Sat, 5 May 2018 14:24:50 +0000 (22:24 +0800)]
MdePkg/PeiServicesLib: Decorate 'PpiDescriptor' as OPTIONAL for LocatePpi().

The UEFI PI specification defines PpiDescriptor to be OPTIONAL for
the LocatePpi PEI Service. This patch reflects this in the function
declaration and definition of the corresponding PeiServices library
function.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoSecurityPkg/TcgSTorage*Lib.h: Add referenced spec information.
Eric Dong [Tue, 8 May 2018 02:32:53 +0000 (10:32 +0800)]
SecurityPkg/TcgSTorage*Lib.h: Add referenced spec information.

Add link and version info for the referenced spec.

Cc: Jiewen yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoMdePkg/TcgStorage*.h: Add referenced spec information.
Eric Dong [Tue, 8 May 2018 02:32:52 +0000 (10:32 +0800)]
MdePkg/TcgStorage*.h: Add referenced spec information.

Add link and version info for the referenced spec.

Cc: Jiewen yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoBaseTools: Fix --hash Package and Module hash value.
Lin, Derek [Wed, 9 May 2018 09:03:23 +0000 (17:03 +0800)]
BaseTools: Fix --hash Package and Module hash value.

The order of List enumeration is arbitrary.
Need to be sorted while calculating Package/Module hash, otherwise it
generate different hash value even nothing changes.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Derek Lin <derek.lin2@hpe.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoSecurityPkg/OpalPassword: Fix PSID revert no hint message.
Eric Dong [Mon, 14 May 2018 07:28:40 +0000 (15:28 +0800)]
SecurityPkg/OpalPassword: Fix PSID revert no hint message.

For no warning message when do the PSID revert action, the
message in the popup dialog is not enough. The error use
of NULL for CreatePopUp function caused this regression.
This change fixed it.

Passed Unit Test:
1. Check PSID revert with/without warning message cases.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoSecurityPkg/TcgStorageOpalLib: Fix GCC build failure.
Eric Dong [Mon, 14 May 2018 07:25:03 +0000 (15:25 +0800)]
SecurityPkg/TcgStorageOpalLib: Fix GCC build failure.

Function definition different with function implementation
caused this build failure. Change code to make them
consistent to pass the build.

Done Unit Test:
1. Pass GCC build.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoOvmfPkg/PlatformBootManagerLib: connect consoles unconditionally
Laszlo Ersek [Sat, 12 May 2018 22:13:53 +0000 (00:13 +0200)]
OvmfPkg/PlatformBootManagerLib: connect consoles unconditionally

If both ConIn and ConOut exist, but ConIn references none of the PS/2
keyboard, the USB wild-card keyboard, and any serial ports, then
PlatformInitializeConsole() currently allows the boot to proceed without
any input devices at all. This makes for a bad user experience -- the
firmware menu could only be entered through OsIndications, set by a guest
OS.

Do what ArmVirtQemu does already, namely connect the consoles, and add
them to ConIn / ConOut / ErrOut, unconditionally. (The underlying
EfiBootManagerUpdateConsoleVariable() function checks for duplicates.)

The issue used to be masked by the EfiBootManagerConnectAll() call that
got conditionalized in commit 245c643cc8b7.

This patch is best viewed with "git show -b -W".

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Fixes: 245c643cc8b73240c3b88cb55b2911b285a8c10d
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1577546
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoMdeModulePkg Variable: Fix the returned status in UpdateVariableStore
cinnamon shia [Fri, 11 May 2018 15:21:12 +0000 (23:21 +0800)]
MdeModulePkg Variable: Fix the returned status in UpdateVariableStore

If Fvb is a NULL, return EFI_UNSUPPORTED.
If the remaining size is not enough, return EFI_OUT_OF_RESOURCES.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: cinnamon shia <cinnamon.shia@hpe.com>
Signed-off-by: Ansen Huang <ansen.huang@hpe.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg Variable: Fix a corner case issue about setting a variable
cinnamon shia [Fri, 11 May 2018 15:21:11 +0000 (23:21 +0800)]
MdeModulePkg Variable: Fix a corner case issue about setting a variable

Fix the issue that failed to update or add a UEFI variable if the remaining size is equal to the data size
of the variable.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: cinnamon shia <cinnamon.shia@hpe.com>
Signed-off-by: Ansen Huang <ansen.huang@hpe.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoBaseTools: Fix python error with --genfds-multi-thread.
Lin, Derek [Wed, 9 May 2018 09:03:24 +0000 (17:03 +0800)]
BaseTools: Fix python error with --genfds-multi-thread.

When self.Alignment is None, it ran into python error since there is no
strip() in None.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Derek Lin <derek.lin2@hpe.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Remove the redundant code
Yonghong Zhu [Wed, 9 May 2018 08:41:28 +0000 (16:41 +0800)]
BaseTools: Remove the redundant code

the ArraySize and Array already be got in line 1093, so this code are
redundant.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
5 years agoBaseTools: Fix generating array's size is incorrect in AutoGen.c
Yunhua Feng [Mon, 7 May 2018 10:26:24 +0000 (18:26 +0800)]
BaseTools: Fix generating array's size is incorrect in AutoGen.c

case example:
DSC:
 [PcdsFixedAtBuild]
  PcdToken.PcdName | "A"
 [Components]
 TestPkg/TestDriver.inf {
  PcdToken.PcdName | {0x41,0x42,0x43,0x44}
 }

Generating the size of array is incorrect in AutoGen.c
 GLOBAL_REMOVE_IF_UNREFERENCED const UINT8
 _gPcd_FixedAtBuild_PcdName[2] = {0x41,0x42,0x43,0x44};

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=950
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>
5 years agoBaseTools: incorrect calculation for 16M
Carsey, Jaben [Tue, 8 May 2018 16:01:35 +0000 (00:01 +0800)]
BaseTools: incorrect calculation for 16M

the "0x" was missing.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools/VfrCompile: Avoid using uninitialized pointer
Bi, Dandan [Wed, 9 May 2018 05:02:11 +0000 (13:02 +0800)]
BaseTools/VfrCompile: Avoid using uninitialized pointer

V2:
Add function _INIT_OPHDR_COND () for variable initialization.
Make code logic more clean.

Previously _CLEAR_SAVED_OPHDR () is used for variable
initialization, and we updated it to clean memory.
But _CLEAR_SAVED_OPHDR () is still called for variable
initialization. This will cause uninitialized pointer
will be checked to free and cause unexpected issue.

This patch is to add new function for variable initialization
and keep _CLEAR_SAVED_OPHDR () to clean memory which is
aligned with its function name.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Gary Lin <glin@suse.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoIntelSiliconPkg MicrocodeUpdateDxe: Honor FIT table
Star Zeng [Wed, 28 Mar 2018 08:52:12 +0000 (16:52 +0800)]
IntelSiliconPkg MicrocodeUpdateDxe: Honor FIT table

It is the second step for
https://bugzilla.tianocore.org/show_bug.cgi?id=540.

V2: Use error handling instead of ASSERT for FIT table checking result.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
5 years agoMdeModulePkg/PciHostBridge: Count the (mm)io overhead when polling
Ruiyu Ni [Mon, 23 Apr 2018 06:20:26 +0000 (14:20 +0800)]
MdeModulePkg/PciHostBridge: Count the (mm)io overhead when polling

RootBridgeIo.PollMem()/PollIo() originally don't count the IO/MMIO
access overhead when delaying.
The patch changes the implementation to count the access overhead
so that the actually delay equals to user required delay.

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: Chasel Chiu <chasel.chiu@intel.com>
5 years agoIntelFrameworkModule/LegacyBios: Use reserved memory for legacy data
Ruiyu Ni [Wed, 25 Apr 2018 07:05:54 +0000 (15:05 +0800)]
IntelFrameworkModule/LegacyBios: Use reserved memory for legacy data

Certain Legacy USB implementation needs to access legacy data (BDA,
etc.) from SMM environment. While currently it's not allowed to
access BS memory from SMM after EndofDxe, change the legacy data
to use reserved memory type.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoUefiCpuPkg/SecMain: Add NORETURN decorator to SecStartup().
Marvin H?user [Tue, 27 Feb 2018 16:50:59 +0000 (00:50 +0800)]
UefiCpuPkg/SecMain: Add NORETURN decorator to SecStartup().

The function SecStartup() is not supposed to return. Hence, add the
NORETURN decorator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoCryptoPkg/CrtLibSupport: add secure_getenv() stub function
Laszlo Ersek [Mon, 7 May 2018 19:59:23 +0000 (21:59 +0200)]
CryptoPkg/CrtLibSupport: add secure_getenv() stub function

The Fedora distro ships a modified OpenSSL 1.1.0 package stream. One of
their patches calls the secure_getenv() C library function. We already
have a stub for getenv(); it applies trivially to secure_getenv() as well.
Add the secure_getenv() stub so that edk2 can be built with Fedora's
OpenSSL 1.1.0 sources.

Cc: Qin Long <qin.long@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Long Qin <qin.long@intel.com>
5 years agoMdeModulePkg/AcpiPlatformDxe: Unload after execution.
Marvin.Haeuser@outlook.com [Mon, 7 May 2018 09:08:06 +0000 (17:08 +0800)]
MdeModulePkg/AcpiPlatformDxe: Unload after execution.

AcpiPlatformDxe solely performs one-time tasks and does not expose
any services or create any events. Hence it can safely be unloaded
after the Entry Point execution by returning an error code.

V2: Return EFI_REQUEST_UNLOAD_IMAGE.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg CapsuleApp: Check Buffer against NULL before freeing it
Star Zeng [Thu, 26 Apr 2018 09:16:47 +0000 (17:16 +0800)]
MdeModulePkg CapsuleApp: Check Buffer against NULL before freeing it

If the capsule from command line is not present,
Buffer will be random value when freeing it in DumpCapsule(),
then ASSERT will happen or other memory pool may be freed.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
5 years agoBaseTools: Correct the variable name
Yonghong Zhu [Mon, 7 May 2018 05:41:27 +0000 (13:41 +0800)]
BaseTools: Correct the variable name

the commit bff74750 introduce a undefined variable name 'scope' cause build
failure, it should use 'Scope'.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Retrieve /U and -U CC flags to structure PcdValueInit Makefile
Liming Gao [Fri, 4 May 2018 05:28:10 +0000 (13:28 +0800)]
BaseTools: Retrieve /U and -U CC flags to structure PcdValueInit Makefile

/D and -D flags have been added. So, /U and -U flags should be added.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoSecurityPkg/OpalPassword: Add support for pyrite 2.0 devices.
Eric Dong [Mon, 7 May 2018 05:27:40 +0000 (13:27 +0800)]
SecurityPkg/OpalPassword: Add support for pyrite 2.0 devices.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoSecurityPkg/TcgStorageOpalLib: Add supports for pyrite 2.0 spec.
Eric Dong [Mon, 7 May 2018 05:31:43 +0000 (13:31 +0800)]
SecurityPkg/TcgStorageOpalLib: Add supports for pyrite 2.0 spec.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoMdePkg: Add Feature definitions added in pyrite 2.0 spec.
Eric Dong [Thu, 3 May 2018 03:07:10 +0000 (11:07 +0800)]
MdePkg: Add Feature definitions added in pyrite 2.0 spec.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoNetworkPkg/NetworkPkg.dsc: Add the instance of library class [SafeIntLib].
Jiaxin Wu [Fri, 4 May 2018 03:48:43 +0000 (11:48 +0800)]
NetworkPkg/NetworkPkg.dsc: Add the instance of library class [SafeIntLib].

This patch is to add the instance of library class [SafeIntLib] to fix the
NetworkPkg build error, which is caused by the commit of 2167c7f7 that the
TlsLib will always consume SafeIntLib.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Long Qin <qin.long@intel.com>
Cc: Bi Dandan <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
5 years agoBaseTools/Conf: Add /Gw optimisation option for VS2017 IA32 and X64
Pete Batard [Tue, 24 Apr 2018 16:10:11 +0000 (00:10 +0800)]
BaseTools/Conf: Add /Gw optimisation option for VS2017 IA32 and X64

This option, which is used in VS2015 and earlier toolchains, was missing
for VS2017. Applying it greatly reduces the size of generated binaries.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Ecc - add dict for config file to internal translation
Carsey, Jaben [Fri, 4 May 2018 20:25:16 +0000 (04:25 +0800)]
BaseTools: Ecc - add dict for config file to internal translation

Commit eece4292acc80 changed a variable name, which was tied directly to
a config file entry. This seperates the internal variable names from
the config file entries by having the internal dict accessed through a
translation of key words.

added a test when this is run straight from command line.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: dont make iterator into list if not needed
Carsey, Jaben [Fri, 27 Apr 2018 22:32:54 +0000 (06:32 +0800)]
BaseTools: dont make iterator into list if not needed

functions (like join) can use the iterator just as easily.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: use set instead of list
Carsey, Jaben [Fri, 27 Apr 2018 22:32:56 +0000 (06:32 +0800)]
BaseTools: use set instead of list

as we only do membership (in) testing for this, set is better

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: create base expression class
Carsey, Jaben [Fri, 27 Apr 2018 22:32:55 +0000 (06:32 +0800)]
BaseTools: create base expression class

this class has a fucntion to share between Exception and RangeExpression
change both classes to call this function init in their init

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: refactor Depex optomization
Carsey, Jaben [Fri, 27 Apr 2018 22:32:53 +0000 (06:32 +0800)]
BaseTools: refactor Depex optomization

No need to make a list from the set.  just pop the item off.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Remove lists form set construction
Carsey, Jaben [Fri, 27 Apr 2018 22:32:52 +0000 (06:32 +0800)]
BaseTools: Remove lists form set construction

There is no need to make a list to make a set.  remove lists
that are only used in constructing sets.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: missed a copyright update
Carsey, Jaben [Fri, 27 Apr 2018 22:32:51 +0000 (06:32 +0800)]
BaseTools: missed a copyright update

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: GenFds - use existing shared string
Carsey, Jaben [Fri, 27 Apr 2018 22:32:50 +0000 (06:32 +0800)]
BaseTools: GenFds - use existing shared string

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: remove unused variable
Carsey, Jaben [Fri, 27 Apr 2018 22:32:49 +0000 (06:32 +0800)]
BaseTools: remove unused variable

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: standardize GUID and pack size
Carsey, Jaben [Fri, 27 Apr 2018 22:32:48 +0000 (06:32 +0800)]
BaseTools: standardize GUID and pack size

currently GUID packing and pack size determination is spread
throughout the code. This introduces a shared function and dict and
routes all code paths through them.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - add Opcode constants
Carsey, Jaben [Fri, 27 Apr 2018 22:32:47 +0000 (06:32 +0800)]
BaseTools: AutoGen - add Opcode constants

add constants for dependency expression opcode strings
use these new opcode string constants

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: remove redundant content in InfSectionParser
Carsey, Jaben [Fri, 27 Apr 2018 22:32:45 +0000 (06:32 +0800)]
BaseTools: remove redundant content in InfSectionParser

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: remove unused member variable
Carsey, Jaben [Fri, 27 Apr 2018 22:32:44 +0000 (06:32 +0800)]
BaseTools: remove unused member variable

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - refactor more functions only called in __init__
Carsey, Jaben [Fri, 27 Apr 2018 22:32:43 +0000 (06:32 +0800)]
BaseTools: AutoGen - refactor more functions only called in __init__

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - refactor function to remove extra variables
Carsey, Jaben [Fri, 27 Apr 2018 22:32:42 +0000 (06:32 +0800)]
BaseTools: AutoGen - refactor function to remove extra variables

we dont need to keep data we already have in different formats...

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Refactor to share GUID packing function
Carsey, Jaben [Fri, 27 Apr 2018 22:32:41 +0000 (06:32 +0800)]
BaseTools: Refactor to share GUID packing function

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - remove another function no one calls
Carsey, Jaben [Fri, 27 Apr 2018 22:32:40 +0000 (06:32 +0800)]
BaseTools: AutoGen - remove another function no one calls

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - move function to clean file namespace
Carsey, Jaben [Fri, 27 Apr 2018 22:32:39 +0000 (06:32 +0800)]
BaseTools: AutoGen - move function to clean file namespace

the function is only used in one other function.
just move it there.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - remove function no one calls
Carsey, Jaben [Fri, 27 Apr 2018 22:32:38 +0000 (06:32 +0800)]
BaseTools: AutoGen - remove function no one calls

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: refactor __init__ functions to not compute temporary variable
Carsey, Jaben [Fri, 27 Apr 2018 22:32:37 +0000 (06:32 +0800)]
BaseTools: refactor __init__ functions to not compute temporary variable

just assign correct value to member variable in __init__ or call
parent __init__

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - no need to recompute
Carsey, Jaben [Fri, 27 Apr 2018 22:32:36 +0000 (06:32 +0800)]
BaseTools: AutoGen - no need to recompute

looping over a list and recomputing the same value has no impact on final value

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - refactor out a useless class
Carsey, Jaben [Fri, 27 Apr 2018 22:32:35 +0000 (06:32 +0800)]
BaseTools: AutoGen - refactor out a useless class

this class was never instantiated.  the static function was called.
save the function, remove the rest.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - refactor out a list
Carsey, Jaben [Fri, 27 Apr 2018 22:32:34 +0000 (06:32 +0800)]
BaseTools: AutoGen - refactor out a list

the lists were used in __init__ then converted to sets
instead just use the sets from the begining

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - refactor out functions only called in __init__
Carsey, Jaben [Fri, 27 Apr 2018 22:32:33 +0000 (06:32 +0800)]
BaseTools: AutoGen - refactor out functions only called in __init__

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: move PCD size calculation functions to PcdClassObject
Carsey, Jaben [Fri, 27 Apr 2018 22:32:32 +0000 (06:32 +0800)]
BaseTools: move PCD size calculation functions to PcdClassObject

move both GetPcdMaxSize and GetPcdSize to the PcdClassObject.
fix MAX_SIZE_TYPE to have int values

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Workspace - refactor a dict
Carsey, Jaben [Fri, 27 Apr 2018 22:32:31 +0000 (06:32 +0800)]
BaseTools: Workspace - refactor a dict

change a dict to a set since we never examine the contents, just the keys.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: remove Compound statements
Carsey, Jaben [Fri, 27 Apr 2018 22:32:30 +0000 (06:32 +0800)]
BaseTools: remove Compound statements

split them into 2 seperate lines.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: eliminate {} from dictionary contructor call
Carsey, Jaben [Fri, 27 Apr 2018 22:32:29 +0000 (06:32 +0800)]
BaseTools: eliminate {} from dictionary contructor call

no need to construct 2 dictionaries.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: refactor to use list not dict
Carsey, Jaben [Fri, 27 Apr 2018 22:32:28 +0000 (06:32 +0800)]
BaseTools: refactor to use list not dict

since we never access the values in the copied dict, just use a list instead.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - UniClassObject refactor static methods
Carsey, Jaben [Fri, 27 Apr 2018 22:32:27 +0000 (06:32 +0800)]
BaseTools: AutoGen - UniClassObject refactor static methods

change methods which do not use self to @staticmethod
change their calls to use class name instead of instance

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - remove global line
Carsey, Jaben [Fri, 27 Apr 2018 22:32:26 +0000 (06:32 +0800)]
BaseTools: AutoGen - remove global line

this serves no purpose since we dont change the global or assign to it.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Eot - refactor global data
Carsey, Jaben [Fri, 27 Apr 2018 22:32:25 +0000 (06:32 +0800)]
BaseTools: Eot - refactor global data

remove unused lists, dicts, and duplicate variables

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Eot - remove unused lists
Carsey, Jaben [Fri, 27 Apr 2018 22:32:24 +0000 (06:32 +0800)]
BaseTools: Eot - remove unused lists

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - refactor class factory
Carsey, Jaben [Fri, 27 Apr 2018 22:32:23 +0000 (06:32 +0800)]
BaseTools: AutoGen - refactor class factory

since instances are not added to cache, the factory does nothing.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - share StripComments API
Carsey, Jaben [Fri, 27 Apr 2018 22:32:22 +0000 (06:32 +0800)]
BaseTools: AutoGen - share StripComments API

add the API root in one class file.
delete the static API out of both classes.
share it in the single location.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - GenVar refactor static methods
Carsey, Jaben [Fri, 27 Apr 2018 22:32:21 +0000 (06:32 +0800)]
BaseTools: AutoGen - GenVar refactor static methods

change methods which do not use self to @staticmethod
change their calls to use class name instead of instance

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - refactor dictionary access
Carsey, Jaben [Fri, 27 Apr 2018 22:32:20 +0000 (06:32 +0800)]
BaseTools: AutoGen - refactor dictionary access

dont use dict.get() inside loops of dictionary contents. its not needed.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - refactor assemble_variable
Carsey, Jaben [Fri, 27 Apr 2018 22:32:19 +0000 (06:32 +0800)]
BaseTools: AutoGen - refactor assemble_variable

make this function @staticmethod since self parameter is not used.
change valuelist to valuedict since it is a dictionary.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: this function has no purpose.
Carsey, Jaben [Fri, 27 Apr 2018 22:32:18 +0000 (06:32 +0800)]
BaseTools: this function has no purpose.

it looks like a old POC of the concepts then used to make the classes
in the 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: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: check before accessing members in __eq__
Carsey, Jaben [Fri, 27 Apr 2018 22:32:17 +0000 (06:32 +0800)]
BaseTools: check before accessing members in __eq__

minimize risk for exceptions.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>