]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
5 years agoEmulatorPkg/AutoScanPei: Report the correct CPU address size
Ruiyu Ni [Fri, 24 Aug 2018 05:20:32 +0000 (13:20 +0800)]
EmulatorPkg/AutoScanPei: Report the correct CPU address size

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

Today's implementation reports CPU address size as 36 through CPU
HOB. But when WinHost is running at 64bit, the system memory might
be allocated above 2^36.

It causes system asserts when DxeCore code tries to find the
corresponding GCD entry for a given valid address.

The patch uses 57 as the CPU address size which is maximum linear
address size when 5-level paging is enabled in host OS.

Using 64 seems more proper and a one-time change even 6-level
paging might be invented. But it causes CoreInitializeGcdServices()
assertion on following code:
  Entry->EndAddress = LShiftU64 (1, SizeOfMemorySpace) - 1;
Because LShiftU64 expects SizeOfMemorySpace < 64.

So to be practical, I didn't report 64 and change
CoreInitializeGcdServices().

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Cc: Andrew Fish <afish@apple.com>
5 years agoEmulatorPkg/Win: Enable 64bit (SEC,PEI,DXE all run at 64bit)
Ruiyu Ni [Fri, 24 Aug 2018 05:16:57 +0000 (13:16 +0800)]
EmulatorPkg/Win: Enable 64bit (SEC,PEI,DXE all run at 64bit)

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Cc: Andrew Fish <afish@apple.com>
5 years agoEmulatorPkg/Win: ReadKeyStrokeEx() always returns correct KeyState
Ruiyu Ni [Fri, 24 Aug 2018 03:47:25 +0000 (11:47 +0800)]
EmulatorPkg/Win: ReadKeyStrokeEx() always returns correct KeyState

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

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Cc: Andrew Fish <afish@apple.com>
5 years agoEmulatorPkg/Win: Use FrameBufferBltLib for BLT operation
Ruiyu Ni [Fri, 24 Aug 2018 03:45:37 +0000 (11:45 +0800)]
EmulatorPkg/Win: Use FrameBufferBltLib for BLT operation

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Cc: Andrew Fish <afish@apple.com>
5 years agoEmulatorPkg/EmuGopDxe: Clear screen to black in GOP.SetMode
Ruiyu Ni [Fri, 24 Aug 2018 03:22:57 +0000 (11:22 +0800)]
EmulatorPkg/EmuGopDxe: Clear screen to black in GOP.SetMode

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

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Cc: Andrew Fish <afish@apple.com>
5 years agoEmulatorPkg/EmuGopDxe: Fix TxtInEx.SetState SCT conformance failure
Ruiyu Ni [Fri, 24 Aug 2018 03:22:05 +0000 (11:22 +0800)]
EmulatorPkg/EmuGopDxe: Fix TxtInEx.SetState SCT conformance failure

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

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Cc: Andrew Fish <afish@apple.com>
5 years agoBaseTools: Clarify a DSC parsing error about PCDs
Carsey, Jaben [Wed, 29 Aug 2018 15:15:55 +0000 (23:15 +0800)]
BaseTools: Clarify a DSC parsing error about PCDs

This error needs the information about which DEC files were searched.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Lee Hamel <lee.m.hamel@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: minimize assignment processing
Carsey, Jaben [Tue, 28 Aug 2018 22:50:34 +0000 (06:50 +0800)]
BaseTools: minimize assignment processing

Reverse the checking and only assign once to each variable.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@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 remove functionally equivalent functions
Carsey, Jaben [Wed, 29 Aug 2018 14:42:21 +0000 (22:42 +0800)]
BaseTools: Refactor to remove functionally equivalent functions

IsSupportedArch and IsBinaryModule return the same value under the same
curcimstances.  Remove newer one with fewer callers and send them to the
other function.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@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: include variable namespace GUIDs of HII PCDs in Guid.xref
zhijufan [Tue, 28 Aug 2018 02:08:08 +0000 (10:08 +0800)]
BaseTools: include variable namespace GUIDs of HII PCDs in Guid.xref

[PcdsDynamicHii]
gFooTokenSpaceGuid.PcdBar|L"Variable"|gVarNameSpaceGuid|0x0|FALSE|NV,BS

This patch add the variable namespace GUIDs in "Guid.xref" that are
used with dynamic HII PCDs.

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=452
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoMdeModulePkg EhciPei: Remove a redundant function
shenglei [Wed, 22 Aug 2018 01:46:41 +0000 (09:46 +0800)]
MdeModulePkg EhciPei: Remove a redundant function

The function UsbHcUnlinkMemBlock that is never called
and its related comments have been removed.
It is missed in the patch series according to the log in
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

v2:Update the title.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoShellPkg/SmbiosView: Update SmbiosView for SMBIOS3.2.0
Dandan Bi [Mon, 27 Aug 2018 05:21:48 +0000 (13:21 +0800)]
ShellPkg/SmbiosView: Update SmbiosView for SMBIOS3.2.0

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

Update SmbiosView to parse the new definitions which
are introduced in SMBIOS3.2.0

V2:
1. Add structure length check before dump the fileds in
Type 9 and Type 17 in case some fileds are not organized
and reported by drivers.
2. Dump the InterfaceTypeSpecificData in Type 42.

V3:
1. Correct the structure length in Type17.
2. Remove the redundant check "if (PeerGroupCount > 0)" in Type 9.
3. Use the Uint16 filed instead of Bits field in union
MEMORY_DEVICE_OPERATING_MODE_CAPABILITY to dump data.

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: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoEmulatorPkg: formalize line endings
Ruiyu Ni [Wed, 29 Aug 2018 03:39:06 +0000 (11:39 +0800)]
EmulatorPkg: formalize line endings

The patch is the result of running
"BaseTools/Scripts/FormatDosFiles.py EmulatorPkg/"

No functionality impact.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
5 years agoMaintainers.txt: Update maintainer of MdeModulePkg
Star Zeng [Tue, 28 Aug 2018 05:34:03 +0000 (13:34 +0800)]
Maintainers.txt: Update maintainer of MdeModulePkg

Add Jian J Wang <jian.j.wang@intel.com> and
remove Eric Dong <eric.dong@intel.com>.
Eric is focusing on UefiCpuPkg.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
5 years agoBaseTools: Create and use a shared value for 'MSFT' from DataType
Carsey, Jaben [Fri, 24 Aug 2018 16:33:17 +0000 (00:33 +0800)]
BaseTools: Create and use a shared value for 'MSFT' from DataType

I see lots of 'MSFT' throughout code and this can reduce them.

Cc: Bob Feng <Bob.c.Feng@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@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 agoUefiCpuPkg/CpuDxe: change level of DEBUG message
Jian J Wang [Mon, 20 Aug 2018 09:04:11 +0000 (17:04 +0800)]
UefiCpuPkg/CpuDxe: change level of DEBUG message

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

It's reported the debug message in CpuDxe driver is quite annoying in
boot and shell, and slow down the boot process. To solve this issue,
this patch changes the DEBUG_INFO to DEBUG_VERBOSE. On a typical Intel
real platform, at least 16s boot time can be saved.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoUefiCpuPkg/PiSmmCpuDxeSmm: implement non-stop mode for SMM
Jian J Wang [Mon, 20 Aug 2018 03:35:58 +0000 (11:35 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: implement non-stop mode for SMM

Since SMM profile feature has already implemented non-stop mode if #PF
occurred, this patch just makes use of the existing implementation to
accommodate heap guard and NULL pointer detection feature.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
5 years agoUefiCpuPkg/CpuDxe: implement non-stop mode for uefi
Jian J Wang [Mon, 20 Aug 2018 03:31:00 +0000 (11:31 +0800)]
UefiCpuPkg/CpuDxe: implement non-stop mode for uefi

Same as SMM profile feature, a special #PF is used to set page attribute
to 'present' and a special #DB handler to reset it back to 'not-present',
right after the instruction causing #PF got executed.

Since the new #PF handler won't enter into dead-loop, the instruction
which caused the #PF will get chance to re-execute with accessible pages.

The exception message will still be printed out on debug console so that
the developer/QA can find that there's potential heap overflow or null
pointer access occurred.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
5 years agoUefiCpuPkg/CpuExceptionHandlerLib: Setup single step in #PF handler
Jian J Wang [Thu, 9 Aug 2018 08:17:19 +0000 (16:17 +0800)]
UefiCpuPkg/CpuExceptionHandlerLib: Setup single step in #PF handler

Once the #PF handler has set the page to be 'present', there should
be a way to reset it to 'not-present'. 'TF' bit in EFLAGS can be used
for this purpose. 'TF' bit will be set in interrupted function context
so that it can be triggered once the cpu control returns back to the
instruction causing #PF and re-execute it.

This is an necessary step to implement non-stop mode for Heap Guard
and NULL Pointer Detection feature.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
5 years agoMdeModulePkg/MdeModulePkg.dec: add new settings for PCDs
Jian J Wang [Mon, 20 Aug 2018 06:35:57 +0000 (14:35 +0800)]
MdeModulePkg/MdeModulePkg.dec: add new settings for PCDs

The change is part of requirement tracked by #BZ1095

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

Background:
Heap Guard and NULL Pointer Detection are very useful features to detect
code flaw in EDK II. If an issue is detected, #PF exception will be
triggered and the BIOS will enter into dead loop, which is the default
behavior of exception handling. From QA perspective, this default behavior
will block them to collect all tests result in reasonable time.

The solution is to introduce non-stop mode to Heap Guard and NULL Pointer
Detection features. This needs to update CpuDxe, PiSmmCpuDxeSmm and
CpuExceptionHandlerLib to allow the code to continue execution after #PF.
The mechanism behind it is the same as SMM Profile feature, in which a
special #PF handler is registered to set the page causing #PF to be
'present' and setup single steop trap, then return the control back to
the instruction accessing that page. Once the instruction is re-executed,
a #DB is triggered and a special handler for it will be called to reset
the page back to 'not-present'.

The non-stop mode is controlled by BIT6 of following PCDs

  gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPropertyMask
  gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask

BIT6 of PcdHeapGuardPropertyMask is used to enable/disable non-stop mode
of Heap Guard feature. It applies to both UEFI and SMM heap guard, if
any of them is enabled.

BIT6 of PcdNullPointerDetectionPropertyMask is used to enable/disable
non-stop mode of NULL Pointer Detection feature. It applies to both
UEFI and SMM NULL Pointer Detection, if any of them is enabled.

The default setting is 'disable', meaning the boot will stop at #PF
exception.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
5 years agoMdePkg: Add the missing spec version information for header files
shenglei [Mon, 20 Aug 2018 07:52:53 +0000 (15:52 +0800)]
MdePkg: Add the missing spec version information for header files

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: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: AutoGen.py remove unused import
Carsey, Jaben [Mon, 27 Aug 2018 22:08:08 +0000 (06:08 +0800)]
BaseTools: AutoGen.py remove unused import

AutoGen does not use anything defined in BuildClassObject

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@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: Fix one expression bug to support ~ operate
Yonghong Zhu [Wed, 22 Aug 2018 02:11:23 +0000 (10:11 +0800)]
BaseTools: Fix one expression bug to support ~ operate

current use (0x41>=~0x0&0x41|0x0) as Pcd value cause build failure
because the ~ is not correctly recognized.

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: Add check only VOID* type Pcd need the maxsize info
zhijufan [Thu, 23 Aug 2018 04:40:37 +0000 (12:40 +0800)]
BaseTools: Add check only VOID* type Pcd need the maxsize info

Add check for the datum type keyword "VOID*", only the VOID* type
Pcd need the additional maxsize info.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoMdeModulePkg/PiSmmCore: Check valid memory range.
Eric Dong [Tue, 21 Aug 2018 06:44:41 +0000 (14:44 +0800)]
MdeModulePkg/PiSmmCore: Check valid memory range.

Call BS.AllocatePages in DXE driver and call SMM FreePages with the address of the buffer allocated in the DXE driver. SMM FreePages success and add a non-SMRAM range into SMM heap list. This is not an expected behavior. SMM FreePages should return error for this case and not free the pages.

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

Change-Id: Ie5ffa1ac62c558aa418a8a3d7d0e8158b846e13b
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg: Update SMBIOS PCDs to 3.2.0
Star Zeng [Fri, 13 Jul 2018 02:29:24 +0000 (10:29 +0800)]
MdeModulePkg: Update SMBIOS PCDs to 3.2.0

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

Cc: Liming Gao <liming.gao@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
5 years agoMdePkg SmBios.h: Add SMBIOS 3.2.0 definitions
Star Zeng [Fri, 13 Jul 2018 02:28:34 +0000 (10:28 +0800)]
MdePkg SmBios.h: Add SMBIOS 3.2.0 definitions

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

Add SMBIOS 3.2.0 definitions according to
www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.2.0.pdf.

Processor Information (Type 4):
- SMBIOSCR00163: add socket LGA2066
- SMBIOSCR00173: add Intel Core i9
- SMBIOSCR00176: add new processor sockets
Port Connector Information (Type 8):
- SMBIOSCR00168: add USB Type-C
System Slots (Type 9):
- SMBIOSCR00164: add "unavailable" to current usage field
- SMBIOSCR00167: add support for PCIe bifurcation
Memory Device (Type 17):
- SMBIOSCR00162: add support for NVDIMMs
- SMBIOSCR00166: extend support for NVDIMMs and add support for logical memory type
- SMBIOSCR00172: rename "Configured Memory Clock Speed" to "Configured Memory Speed"
- SMBIOSCR00174: add new memory technology value (Intel Persistent Memory, 3D XPoint)
IPMI Device Information (Type 38):
- SMBIOSCR00171: add SSIF
Management Controller Host Interface (Type 42)
- SMBIOSCR00175: fix structure data parsing issue

V2: Add missing update to MISC_PORT_TYPE and SMBIOS_TABLE_TYPE9.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoEmulatorPkg/DSC: Remove FS mapping to EDK Shell bin directory
Ruiyu Ni [Thu, 23 Aug 2018 09:40:30 +0000 (17:40 +0800)]
EmulatorPkg/DSC: Remove FS mapping to EDK Shell bin directory

The EDK Shell is end of line so the FS mapping to old EDK
Shell bin directory is better to be removed.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Cc: Andrew Fish <afish@apple.com>
5 years agoEmulatorPkg/EmuFileSystem: Fix a bug that causes Close() assertion
Ruiyu Ni [Thu, 23 Aug 2018 09:38:42 +0000 (17:38 +0800)]
EmulatorPkg/EmuFileSystem: Fix a bug that causes Close() assertion

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

The root cause is when a file is opened through File.Open(), the
private data for the File is not allocated, so when later
when File.Close() is called, the signature check in CR() causes
the assertion.

The private data for the File is allocated properly when the file
is opened from FS.OpenVolume().

The patch also fixes a minor issue that wrongly assigns
revision number to File.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Cc: Andrew Fish <afish@apple.com>
5 years agoEmulatorPkg/PlatformBds: Signal EndOfDxe in platform BDS
Ruiyu Ni [Thu, 23 Aug 2018 09:35:14 +0000 (17:35 +0800)]
EmulatorPkg/PlatformBds: Signal EndOfDxe in platform BDS

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

Without signal of EndOfDxe, the 3rd party code (.efi from non-flash
storage) cannot run. It's forbidden by
8be37a5cee700777ca8e8e8a34cc2225b21931a7
*MdeModulePkg/SecurityStubDxe: Defer 3rd party image before EndOfDxe

The patch enables running of SCT from internal shell.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Cc: Andrew Fish <afish@apple.com>
5 years agoEmulatorPkg/Win: Add BlockIo support
Ruiyu Ni [Thu, 23 Aug 2018 07:36:15 +0000 (15:36 +0800)]
EmulatorPkg/Win: Add BlockIo support

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Cc: Andrew Fish <afish@apple.com>
5 years agoEmulatorPkg/Win: Add SimpleFileSystem support
Ruiyu Ni [Thu, 23 Aug 2018 05:43:00 +0000 (13:43 +0800)]
EmulatorPkg/Win: Add SimpleFileSystem support

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Cc: Andrew Fish <afish@apple.com>
5 years agoEmulatorPkg/Win: Add RTC support
Ruiyu Ni [Thu, 23 Aug 2018 05:37:37 +0000 (13:37 +0800)]
EmulatorPkg/Win: Add RTC support

Now firmware can display the time correctly.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Cc: Andrew Fish <afish@apple.com>
5 years agoEmulatorPkg/Win: Add timer and interrupt support
Ruiyu Ni [Thu, 23 Aug 2018 05:36:14 +0000 (13:36 +0800)]
EmulatorPkg/Win: Add timer and interrupt support

Now the firmware can boot to Shell and count down 5 seconds to
command prompt.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Cc: Andrew Fish <afish@apple.com>
5 years agoEmulatorPkg/Win: Add input/output support
Ruiyu Ni [Thu, 23 Aug 2018 05:33:54 +0000 (13:33 +0800)]
EmulatorPkg/Win: Add input/output support

The patch adds GOP and SimpleTextIn[Ex] support.
Now firmware can boot to UI and Shell but timer doesn't work.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Andrew Fish <afish@apple.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
5 years agoEmulatorPkg/Win: Enable native OS console as firmware console
Ruiyu Ni [Thu, 23 Aug 2018 05:13:21 +0000 (13:13 +0800)]
EmulatorPkg/Win: Enable native OS console as firmware console

The patch implements Stdin/Stdout/Stderr access so that
the native OS console (cmd.exe) can be used as the firmware
console and debug message can also be routed to it.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Cc: Andrew Fish <afish@apple.com>
5 years agoEmulatorPkg/Win: Enable source level debugging
Ruiyu Ni [Thu, 23 Aug 2018 05:07:05 +0000 (13:07 +0800)]
EmulatorPkg/Win: Enable source level debugging

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Andrew Fish <afish@apple.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
5 years agoEmulatorPkg/Win: Add Windows host support
Ruiyu Ni [Thu, 23 Aug 2018 05:02:52 +0000 (13:02 +0800)]
EmulatorPkg/Win: Add Windows host support

This is the initial patch to make it boot to early DXE
phase without display (only debug message).

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Cc: Andrew Fish <afish@apple.com>
5 years agoEmulatorPkg/ThunkProtocolList: Fix VS build failure
Ruiyu Ni [Thu, 23 Aug 2018 05:01:06 +0000 (13:01 +0800)]
EmulatorPkg/ThunkProtocolList: Fix VS build failure

VS compiler complains converting UINTN to UINT16 causes data lost.
Add typecast to fix the build failure.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Andrdw Fish <afish@apple.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
5 years agoMdeModulePkg/PciBus: Restrict one VGA per HostBridge not Segment
Ruiyu Ni [Thu, 23 Aug 2018 02:50:16 +0000 (10:50 +0800)]
MdeModulePkg/PciBus: Restrict one VGA per HostBridge not Segment

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

Today's restriction of VGA device is to have only one VGA device
enabled per PCI segment. It's not correct because several segments
may share one IO / MMIO address space.
We should restrict to have one VGA per Host Bridge because each
Host Bridge has its only IO / MMIO address space.

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 agoMdeModulePkg/PciBus: Refine ActiveVGADeviceOnTheRootBridge
Ruiyu Ni [Thu, 23 Aug 2018 02:34:33 +0000 (10:34 +0800)]
MdeModulePkg/PciBus: Refine ActiveVGADeviceOnTheRootBridge

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1109
The patch doesn't change any behavior of this function.
It just renames the function to LocateVgaDevice() and renames
some parameters and local variables.

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 agoEmbeddedPkg/AndroidFastbootApp: only use ENTER or SPACE to exit
Haojian Zhuang [Thu, 23 Aug 2018 06:14:33 +0000 (14:14 +0800)]
EmbeddedPkg/AndroidFastbootApp: only use ENTER or SPACE to exit

Since hotkey 'f' is used to start AndroidFastbootApp. If user
press 'f' key too long, it may be recognized pressing 'f' key
multiple times. Then AndroidFastbootApp exists since it delcares
any key press could make it exit.

So only use ENTER or SPACE key to exit AndroidFastbootApp.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoIntelFrameworkModulePkg BdsDxe: Remove redundant functions
shenglei [Wed, 8 Aug 2018 02:29:00 +0000 (10:29 +0800)]
IntelFrameworkModulePkg BdsDxe: Remove redundant functions

The redundant functions which are never called have been
removed. They are GetProducerString,ChangeVariableDevicePath,
EfiReallocatePool,Var_UpdateAllConsoleOption and BOpt_IsEfiApp.
https://bugzilla.tianocore.org/show_bug.cgi?id=1063

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoIntelFrameworkModulePkg LegacyBiosDxe: Remove redundant LibraryClasses
shenglei [Wed, 8 Aug 2018 02:19:40 +0000 (10:19 +0800)]
IntelFrameworkModulePkg LegacyBiosDxe: Remove redundant LibraryClasses

The redundant LibraryClasses which are PeCoffLib and CacheMaintenanceLib
have been removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1063

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoIntelFrameworkModulePkg Snp16Dxe: Remove redundant functions
shenglei [Wed, 8 Aug 2018 02:17:34 +0000 (10:17 +0800)]
IntelFrameworkModulePkg Snp16Dxe: Remove redundant functions

The redundant functions which are never called have been removed.
They are PxeUndiSetMcastAddr, PxeUndiInitiateDiags,PxeUndiGetState
PxeUndiForceInterrupt and PxeUndiSetPacketFilter.
https://bugzilla.tianocore.org/show_bug.cgi?id=1063

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoIntelFrameworkModulePkg IdeBusDxe: Remove redundant functions
shenglei [Wed, 8 Aug 2018 01:22:10 +0000 (09:22 +0800)]
IntelFrameworkModulePkg IdeBusDxe: Remove redundant functions

The redundant functions which are never called have been removed.
They are AtaNonDataCommandInExt,IDEBusDriverConfigurationSetOptions,
GetResponse,IDEBusDriverConfigurationOptionsValid and
IDEBusDriverConfigurationForceDefaults.
https://bugzilla.tianocore.org/show_bug.cgi?id=1063

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoIntelFrameworkModulePkg Ps2KeyboardDxe: Remove a redundant function
shenglei [Wed, 8 Aug 2018 00:54:08 +0000 (08:54 +0800)]
IntelFrameworkModulePkg Ps2KeyboardDxe: Remove a redundant function

The redundant function DisableKeyboard which is never called
has been removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1063

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoIntelFrameworkModulePkg IsaIoDxe: Remove a redundant protocol
shenglei [Tue, 7 Aug 2018 08:54:47 +0000 (16:54 +0800)]
IntelFrameworkModulePkg IsaIoDxe: Remove a redundant protocol

Remove a redundant protocol which is gEfiGenericMemTestProtocolGuid.
https://bugzilla.tianocore.org/show_bug.cgi?id=1063

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
5 years agoArmPkg/PlatformBootManagerLib: fix hotkey of boot option
Haojian Zhuang [Thu, 23 Aug 2018 05:51:42 +0000 (13:51 +0800)]
ArmPkg/PlatformBootManagerLib: fix hotkey of boot option

Fix the parameter in EfiBootManagerAddKeyOptionVariable (). Otherwise,
the hotkey of boot option won't be registered correctly.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoNetworkPkg: UefiPxeBcDxe: Remove the redundant code.
Songpeng Li [Thu, 16 Aug 2018 00:59:01 +0000 (08:59 +0800)]
NetworkPkg: UefiPxeBcDxe: Remove the redundant code.

The function PxeBcFreeBootFileOption that is never called
have been removed.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1064
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Songpeng Li <songpeng.li@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
5 years agoNetworkPkg: TcpDxe: Remove the redundant code.
Songpeng Li [Thu, 16 Aug 2018 00:58:04 +0000 (08:58 +0800)]
NetworkPkg: TcpDxe: Remove the redundant code.

The function TcpPawsOK that is never called have been removed.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1064
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Songpeng Li <songpeng.li@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
5 years agoNetworkPkg: IpSecDxe: Remove the redundant code.
Songpeng Li [Thu, 16 Aug 2018 00:57:14 +0000 (08:57 +0800)]
NetworkPkg: IpSecDxe: Remove the redundant code.

The functions that are never called have been removed.
They are Ikev2OnPacketAccepted, Ikev2SaSessionOnDeleting,
Ikev2ChildSaSessionLookupByMid, Ikev2ChildSaSessionOnDeleting
and Ikev2ChildExchangeRekeySpi.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1064
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Songpeng Li <songpeng.li@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
5 years agoNetworkPkg: IScsiDxe: Remove the redundant code and definition.
Songpeng Li [Thu, 9 Aug 2018 08:01:00 +0000 (16:01 +0800)]
NetworkPkg: IScsiDxe: Remove the redundant code and definition.

The function IScsiFindTcbByITT that is never called have been removed.
The definition gEfiAcpi20TableGuid has been removed.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1064
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Songpeng Li <songpeng.li@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
5 years agoBaseTools: Use hashlib instead of md5
Feng, YunhuaX [Wed, 8 Aug 2018 06:56:55 +0000 (14:56 +0800)]
BaseTools: Use hashlib instead of md5

Use from hashlib import md5 instead of import md5
due to md5 deprecated in python3

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: remove cmp due to deprecated in python3
Feng, YunhuaX [Wed, 8 Aug 2018 06:56:14 +0000 (14:56 +0800)]
BaseTools: remove cmp due to deprecated in python3

remove cmp due to deprecated in python3

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: Modify class OrderedListDict
Feng, YunhuaX [Wed, 8 Aug 2018 06:55:35 +0000 (14:55 +0800)]
BaseTools: Modify class OrderedListDict

class OrderedListDict(OrderedDict, defaultdict) will
encounter multiple bases have instance lay-out
conflict error on python3

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: Update Makefile for ECC tool
Yonghong Zhu [Wed, 22 Aug 2018 07:47:49 +0000 (15:47 +0800)]
BaseTools: Update Makefile for ECC tool

V2: Add --target-name to specify the file name to create

Because Ecc.py was renamed to EccMain.py

Cc: Liming Gao <liming.gao@intel.com>
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/VfrCompile: honor EXTRA_LDFLAGS
Laszlo Ersek [Fri, 17 Aug 2018 02:38:02 +0000 (19:38 -0700)]
BaseTools/VfrCompile: honor EXTRA_LDFLAGS

In commit 81502cee20ac ("BaseTools/Source/C: take EXTRA_LDFLAGS from the
caller", 2018-08-16), I missed that "VfrCompile/GNUmakefile" does not use
BUILD_LFLAGS in the APPLICATION linking rule, unlike "app.makefile" does.
Instead, "VfrCompile/GNUmakefile" uses the (undefined) LFLAGS macro.
Therefore commit 81502cee20ac did not cover the linking step of
VfrCompile.

Thankfully, the structure of the linking rules is the same, between
"app.makefile" and "VfrCompile/GNUmakefile". Rename the undefined LFLAGS
macro in "VfrCompile/GNUmakefile" to VFR_LFLAGS (for consistency with
VFR_CXXFLAGS), and set it to EXTRA_LDFLAGS.

As a result, we have:

             | compilation                    | linking
  -----------+--------------------------------+----------------------
  VfrCompile | VFR_CXXFLAGS =                 | VFR_LFLAGS =
             | BUILD_OPTFLAGS =               | EXTRA_LDFLAGS
             | '-O2' + EXTRA_OPTFLAGS         |
  -----------+--------------------------------+----------------------
  other apps | BUILD_CFLAGS/BUILD_CXXFLAGS =  | BUILD_LFLAGS =
             | [...] + BUILD_OPTFLAGS =       | [...] + EXTRA_LDFLAGS
             | [...] + '-O2' + EXTRA_OPTFLAGS |

This table shows
- that the VfrCompile compilation and linking flags are always a subset of
  the corresponding flags used by the other apps,
- and that the EXTRA flags are always at the end.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1540244
Fixes: 81502cee20ac4046f08bb4aec754c7091c8808dc
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoUefiCpuPkg/PiSmmCpuDxeSmm: clear exec file mode bits on "PiSmmCpuDxeSmm.c"
Laszlo Ersek [Fri, 17 Aug 2018 13:21:34 +0000 (15:21 +0200)]
UefiCpuPkg/PiSmmCpuDxeSmm: clear exec file mode bits on "PiSmmCpuDxeSmm.c"

Commit 241f914975d5 ("UefiCpuPkg/PiSmmCpuDxeSmm: Add support for PCD
PcdPteMemoryEncryptionAddressOrMask", 2017-03-01) unintentionally set the
executable file mode bits on "PiSmmCpuDxeSmm.c"; clear them now.

Cc: Eric Dong <eric.dong@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1092
Fixes: 241f914975d50e34f6da57d1e5ac60eedb5d52de
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoNetworkPkg/TlsAuthConfigDxe: fix TlsCaCertificate attributes retrieval
Laszlo Ersek [Fri, 17 Aug 2018 13:12:38 +0000 (15:12 +0200)]
NetworkPkg/TlsAuthConfigDxe: fix TlsCaCertificate attributes retrieval

Per spec, the GetVariable() runtime service is not required to populate
(*Attributes) on output when it fails with EFI_BUFFER_TOO_SMALL.

Therefore we have to fetch the full contents of the TlsCaCertificate
variable temporarily, just so we can (a) get the current attributes, and
(b) add EFI_VARIABLE_APPEND_WRITE to them for the subsequent SetVariable()
call.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Songpeng Li <songpeng.li@intel.com>
Reported-by: Songpeng Li <songpeng.li@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1090
Fixes: b90c335fbbb674470fbf09601cc522bf61564c30
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Songpeng Li <songpeng.li@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
5 years agoIntelFrameworkPkg/FrameworkUefiLib: don't special-case EFI_FILE_MODE_CREATE
Laszlo Ersek [Fri, 17 Aug 2018 13:06:35 +0000 (15:06 +0200)]
IntelFrameworkPkg/FrameworkUefiLib: don't special-case EFI_FILE_MODE_CREATE

Synchronize EfiOpenFileByDevicePath() with the MdePkg/UefiLib instance, as
described in the previous patch.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Suggested-by: Ruiyu Ni <ruiyu.ni@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1074
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdePkg/UefiLib: don't special-case EFI_FILE_MODE_CREATE in OpenMode
Laszlo Ersek [Fri, 17 Aug 2018 12:55:23 +0000 (14:55 +0200)]
MdePkg/UefiLib: don't special-case EFI_FILE_MODE_CREATE in OpenMode

While reviewing the patch that would land as 768b611136d0
("MdePkg/UefiLib: introduce EfiOpenFileByDevicePath()", 2018-08-16), Ray
pointed out that distinguishing EFI_FILE_MODE_CREATE was wasteful. Per
spec, if the file to create exists, then EFI_FILE_MODE_CREATE is ignored
by EFI_FILE_PROTOCOL.Open(), and the existent file is opened.

Therefore we don't need an attempt to "open-but-not-create" first, and a
fallback to "open-and-create-too" second -- that behavior is internal to
EFI_FILE_PROTOCOL.Open(). Remove the special-casing of
EFI_FILE_MODE_CREATE.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Suggested-by: Ruiyu Ni <ruiyu.ni@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1074
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoMdeModulePkg/SmmCorePerfLib: Add DxeServicesLib library class in INF
Bi, Dandan [Tue, 21 Aug 2018 08:56:39 +0000 (16:56 +0800)]
MdeModulePkg/SmmCorePerfLib: Add DxeServicesLib library class in INF

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

SmmCorePerformanceLib consume the DxeServicesLib, but miss to
add the library class in INF file.
This patch is to fix this issue.

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>
5 years agoIntelFsp2WrapperPkg: Add EFIAPI to AsmExecute32BitCode
Chasel, Chiu [Wed, 22 Aug 2018 01:41:25 +0000 (09:41 +0800)]
IntelFsp2WrapperPkg: Add EFIAPI to AsmExecute32BitCode

AsmExecute32BitCode is assembly code and needs EFIAPI

Cc: Jiewen Yao <Jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
5 years agoMdeModulePkg UiApp: Remove a redundant function and a variable
shenglei [Thu, 9 Aug 2018 06:38:24 +0000 (14:38 +0800)]
MdeModulePkg UiApp: Remove a redundant function and a variable

1.After the cleanup at "MdeModulePkg UiApp: Remove redundant functions",
  the function "IsResetReminderFeatureEnable()" and the variable
  "mFeaturerSwitch" become redundant so they have been removed.
2.Therefore, the "IF" expression has also been removed, whose judgment condition
  is "IsResetReminderFeatureEnable()".
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg SetupBrowserDxe: Remove a redundant function
shenglei [Wed, 8 Aug 2018 08:30:11 +0000 (16:30 +0800)]
MdeModulePkg SetupBrowserDxe: Remove a redundant function

The function IsDevicePathExist that is never called
has been removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoMdeModulePkg Tcp4Dxe: Remove redundant functions
shenglei [Wed, 8 Aug 2018 08:28:31 +0000 (16:28 +0800)]
MdeModulePkg Tcp4Dxe: Remove redundant functions

The functions that are never called have been removed.
They are SockRcvdErr,SockGroup and TcpPawsOK.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoMdeModulePkg IScsiDxe: Remove a redundant function
shenglei [Wed, 8 Aug 2018 08:21:09 +0000 (16:21 +0800)]
MdeModulePkg IScsiDxe: Remove a redundant function

The function IScsiFindTcbByITT that is never called
has been removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoMdeModulePkg Ip4Dxe: Remove a redundant function
shenglei [Wed, 8 Aug 2018 08:19:52 +0000 (16:19 +0800)]
MdeModulePkg Ip4Dxe: Remove a redundant function

The function Ip4Config2OnDhcp4Event that is never called
has been removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5 years agoMdeModulePkg HiiDatabaseDxe: Remove a redundant function
shenglei [Wed, 8 Aug 2018 08:19:09 +0000 (16:19 +0800)]
MdeModulePkg HiiDatabaseDxe: Remove a redundant function

The function GetStorageWidth that is never called
has been removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoMdeModulePkg TerminalDxe: Remove a redundant function
shenglei [Wed, 8 Aug 2018 08:18:22 +0000 (16:18 +0800)]
MdeModulePkg TerminalDxe: Remove a redundant function

The function UnicodeFiFoGetKeyCount that is never called
has been removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@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>
5 years agoMdeModulePkg SdBlockIoPei: Remove a redundant function
shenglei [Wed, 8 Aug 2018 08:17:14 +0000 (16:17 +0800)]
MdeModulePkg SdBlockIoPei: Remove a redundant function

The function SdPeimUnlinkMemBlock that is never called
has been removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

v2: Remove the comment that mentioned 'SdPeimUnlinkMemBlock'
within function SdPeimFreeMemPool().

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg EmmcBlockIoPei: Remove a redundant function
shenglei [Wed, 8 Aug 2018 08:16:30 +0000 (16:16 +0800)]
MdeModulePkg EmmcBlockIoPei: Remove a redundant function

The function EmmcPeimUnlinkMemBlock that is never called
has been removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

v2: Remove the comment that mentioned 'EmmcPeimUnlinkMemBlock'
within function EmmcPeimFreeMemPool().

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg Ps2KeyboardDxe: Remove a redundant function
shenglei [Wed, 8 Aug 2018 08:15:18 +0000 (16:15 +0800)]
MdeModulePkg Ps2KeyboardDxe: Remove a redundant function

The function DisableKeyboard that is never called
has been removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg PiSmmCore: Remove redundant functions
shenglei [Wed, 8 Aug 2018 07:52:21 +0000 (15:52 +0800)]
MdeModulePkg PiSmmCore: Remove redundant functions

The functions that are never called have been removed.
They are IsImageInsideSmram,FindImageRecord,SmmRemoveImageRecord,
SmmMemoryAttributesTableConsistencyCheck,DumpSmmMemoryMapEntry,
SmmMemoryMapConsistencyCheckRange,SmmMemoryMapConsistencyCheck,
DumpSmmMemoryMap,ClearGuardMapBit,SetGuardMapBit,AdjustMemoryA,
AdjustMemoryS,IsHeadGuard and IsTailGuard.
FindImageRecord() is called by SmmRemoveImageRecord(); however,
nothing calls SmmRemoveImageRecord().
SmmMemoryMapConsistencyCheckRange() is called by
SmmMemoryMapConsistencyCheck(); however, nothing calls
SmmMemoryMapConsistencyCheck().
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

v2:append the following to the commit message.
- FindImageRecord() is called by SmmRemoveImageRecord(); however,
nothing calls SmmRemoveImageRecord().
- SmmMemoryMapConsistencyCheckRange() is called by
SmmMemoryMapConsistencyCheck(); however, nothing calls
SmmMemoryMapConsistencyCheck().

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg Core/Dxe: Remove redundant functions
shenglei [Wed, 8 Aug 2018 07:49:14 +0000 (15:49 +0800)]
MdeModulePkg Core/Dxe: Remove redundant functions

The functions that are never called have been removed.
They are ClearGuardMapBit,SetGuardMapBit,IsHeadGuard,
IsTailGuard and CoreEfiNotAvailableYetArg0.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg UsbBusPei: Remove redundant functions
shenglei [Wed, 8 Aug 2018 07:41:25 +0000 (15:41 +0800)]
MdeModulePkg UsbBusPei: Remove redundant functions

The functions that are never called have been removed.
They are PeiHubSetHubFeature,IsPortConnectChange and
PeiUsbClearDeviceFeature.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg UsbBusDxe: Remove redundant functions
shenglei [Wed, 8 Aug 2018 07:39:50 +0000 (15:39 +0800)]
MdeModulePkg UsbBusDxe: Remove redundant functions

The functions that are never called have been removed.
They are UsbHubCtrlSetHubFeature,UsbHubCtrlResetTT,UsbHcReset,
UsbHcAsyncIsochronousTransfer,UsbHcGetState,UsbHcSetState and
UsbHcIsochronousTransfer.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg UsbBotPei: Remove redundant functions
shenglei [Wed, 8 Aug 2018 07:38:33 +0000 (15:38 +0800)]
MdeModulePkg UsbBotPei: Remove redundant functions

The functions that are never called have been removed.
They are PeiUsbSetConfiguration,PeiUsbSetDeviceAddress,
IsPortConnect,IsPortConnectChange,IsPortLowSpeedDeviceAttached
and PeiUsbGetDescriptor.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg UfsPassThruDxe: Remove redundant functions
shenglei [Wed, 8 Aug 2018 07:37:05 +0000 (15:37 +0800)]
MdeModulePkg UfsPassThruDxe: Remove redundant functions

The functions that are never called have been removed.
They are UfsClearFlag and UfsFindAvailableSlotInTmrl.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg UfsBlockIoPei: Remove redundant functions
shenglei [Wed, 8 Aug 2018 07:35:14 +0000 (15:35 +0800)]
MdeModulePkg UfsBlockIoPei: Remove redundant functions

The functions that are never called have been removed.
They are UfsPeimUnlinkMemBlock,UfsPeimRequestSense,
UfsPeimInquiry,UfsRwAttributes,UfsClearFlag,UfsReadFlag
and UfsFindAvailableSlotInTmrl.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

v2: Remove the comment that mentioned 'UfsPeimUnlinkMemBlock'
within function UfsPeimFreeMemPool().

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg XhciPei: Remove redundant functions
shenglei [Wed, 8 Aug 2018 05:55:06 +0000 (13:55 +0800)]
MdeModulePkg XhciPei: Remove redundant functions

The functions that are never called have been removed.
They are XhcPeiReadDoorBellReg and UsbHcUnlinkMemBlock.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg XhciDxe: Remove redundant functions
shenglei [Wed, 8 Aug 2018 05:53:35 +0000 (13:53 +0800)]
MdeModulePkg XhciDxe: Remove redundant functions

The functions that are never called have been removed.
They are XhcReadDoorBellReg and XhcWriteOpReg16.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg UhciPei: Remove redundant functions
shenglei [Wed, 8 Aug 2018 05:52:02 +0000 (13:52 +0800)]
MdeModulePkg UhciPei: Remove redundant functions

The functions that are never called have been removed.
They are IoMmuFreeBuffer,DelinkMemoryBlock,IsMemoryBlockEmptied
,IsTDLinkPtrQHOrTD,GetCurrentFrameNumber,GetQHHorizontalLinkPtr
and GetQHHorizontalValidorInvalid.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg SdMmcPciHcDxe: Remove redundant functions
shenglei [Wed, 8 Aug 2018 05:49:06 +0000 (13:49 +0800)]
MdeModulePkg SdMmcPciHcDxe: Remove redundant functions

The functions that are never called have been removed.
They are SdCardGetCsd and SdCardGetScr.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoMdeModulePkg PciBusDxe: Remove redundant functions
shenglei [Wed, 8 Aug 2018 05:47:20 +0000 (13:47 +0800)]
MdeModulePkg PciBusDxe: Remove redundant functions

The functions that are never called have been removed.
They are UpStreamBridgesAttributes and GetHpcPciAddressFromRootBridge.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg NvmExpressDxe: Remove redundant functions
shenglei [Wed, 8 Aug 2018 05:43:30 +0000 (13:43 +0800)]
MdeModulePkg NvmExpressDxe: Remove redundant functions

The functions that are never called have been removed.
They are ReadNvmeAdminSubmissionQueueBaseAddress,
ReadNvmeAdminCompletionQueueBaseAddress and ReadNvmeAdminQueueAttributes
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoMdeModulePkg EhciDxe: Remove redundant functions
shenglei [Wed, 8 Aug 2018 05:41:17 +0000 (13:41 +0800)]
MdeModulePkg EhciDxe: Remove redundant functions

The functions that are never called have been removed.
They are EhcDumpRegs,EhcDisableAsyncSchd and EhcDisablePeriodSchd
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg AtaAtapiPassThru: Remove redundant functions
shenglei [Wed, 8 Aug 2018 05:37:18 +0000 (13:37 +0800)]
MdeModulePkg AtaAtapiPassThru: Remove redundant functions

The functions that are never called have been removed.
They are AhciCheckDeviceStatus,AhciPortReset,DRDYReady,
DRDYReady2,WaitForBSYClear2 and AtaSoftReset.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

v2: DRDYReady, DRDYReady2, WaitForBSYClear2 and AtaSoftReset
are added to the commit message.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoMdeModulePkg UiApp: Remove redundant functions
shenglei [Wed, 8 Aug 2018 05:35:22 +0000 (13:35 +0800)]
MdeModulePkg UiApp: Remove redundant functions

The functions that are never called have been removed.
They are EnableResetReminderFeature,
DisableResetReminderFeature and DisableResetRequired.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoMdeModulePkg CapsuleApp: Remove a redundant function
shenglei [Wed, 8 Aug 2018 05:31:46 +0000 (13:31 +0800)]
MdeModulePkg CapsuleApp: Remove a redundant function

The function DumpImageAuthentication that is never called
has been removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoUefiCpuPkg/SmmCpuFeaturesLib: [CVE-2017-5715] Stuff RSB before RSM
Hao Wu [Thu, 16 Aug 2018 02:38:10 +0000 (10:38 +0800)]
UefiCpuPkg/SmmCpuFeaturesLib: [CVE-2017-5715] Stuff RSB before RSM

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

Return Stack Buffer (RSB) is used to predict the target of RET
instructions. When the RSB underflows, some processors may fall back to
using branch predictors. This might impact software using the retpoline
mitigation strategy on those processors.

This commit will add RSB stuffing logic before returning from SMM (the RSM
instruction) to avoid interfering with non-SMM usage of the retpoline
technique.

After the stuffing, RSB entries will contain a trap like:

@SpecTrap:
    pause
    lfence
    jmp     @SpecTrap

A more detailed explanation of the purpose of commit is under the
'Branch target injection mitigation' section of the below link:
https://software.intel.com/security-software-guidance/insights/host-firmware-speculative-execution-side-channel-mitigation

Please note that this commit requires further actions (BZ 1091) to remove
the duplicated 'StuffRsb.inc' files and merge them into one under a
UefiCpuPkg package-level directory (such as UefiCpuPkg/Include/).

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

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoUefiCpuPkg/PiSmmCpuDxeSmm: [CVE-2017-5715] Stuff RSB before RSM
Hao Wu [Thu, 16 Aug 2018 01:32:10 +0000 (09:32 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: [CVE-2017-5715] Stuff RSB before RSM

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

Return Stack Buffer (RSB) is used to predict the target of RET
instructions. When the RSB underflows, some processors may fall back to
using branch predictors. This might impact software using the retpoline
mitigation strategy on those processors.

This commit will add RSB stuffing logic before returning from SMM (the RSM
instruction) to avoid interfering with non-SMM usage of the retpoline
technique.

After the stuffing, RSB entries will contain a trap like:

@SpecTrap:
    pause
    lfence
    jmp     @SpecTrap

A more detailed explanation of the purpose of commit is under the
'Branch target injection mitigation' section of the below link:
https://software.intel.com/security-software-guidance/insights/host-firmware-speculative-execution-side-channel-mitigation

Please note that this commit requires further actions (BZ 1091) to remove
the duplicated 'StuffRsb.inc' files and merge them into one under a
UefiCpuPkg package-level directory (such as UefiCpuPkg/Include/).

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

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoBaseTools: Fix regression issue by b23414f6540d
Feng, YunhuaX [Tue, 21 Aug 2018 00:48:38 +0000 (08:48 +0800)]
BaseTools: Fix regression issue by b23414f6540d

V2: Renaming function DepexExpressionTokenList to  DepexExpressionDict
instead of changing the callers

Fix regression issue by b23414f6540d4f336b6f00b44681911d469f9a04
AttributeError: 'ModuleAutoGen' object has no attribute
'DepexExpressionDict'

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 agoMdeModulePkg: Remove redundant library classes and GUIDs
shenglei [Thu, 2 Aug 2018 05:24:31 +0000 (13:24 +0800)]
MdeModulePkg: Remove redundant library classes and GUIDs

Some redundant library classes and GUIDs
have been removed in inf, .c and .h files.
https://bugzilla.tianocore.org/show_bug.cgi?id=1044
https://bugzilla.tianocore.org/show_bug.cgi?id=1045
https://bugzilla.tianocore.org/show_bug.cgi?id=1047
https://bugzilla.tianocore.org/show_bug.cgi?id=1049
https://bugzilla.tianocore.org/show_bug.cgi?id=1051
https://bugzilla.tianocore.org/show_bug.cgi?id=1052
https://bugzilla.tianocore.org/show_bug.cgi?id=1053
https://bugzilla.tianocore.org/show_bug.cgi?id=1054
https://bugzilla.tianocore.org/show_bug.cgi?id=1055
https://bugzilla.tianocore.org/show_bug.cgi?id=1056
https://bugzilla.tianocore.org/show_bug.cgi?id=1017
https://bugzilla.tianocore.org/show_bug.cgi?id=1035
https://bugzilla.tianocore.org/show_bug.cgi?id=1033
https://bugzilla.tianocore.org/show_bug.cgi?id=1012
https://bugzilla.tianocore.org/show_bug.cgi?id=1011
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

v2:
1. Correct copyright year.
2. Fix alignment issue in AcpiPlatformDxe.inf.
3. Add DevicePathLib which is removed before in I2cHostDxe.inf.
4. Update NvmExpressPei.inf, NvmExpressPei.h, IScsiDxe.inf,
   IScsiDxe.inf, IScsiDxe.h, DxeMain.inf, DxeMain.h, PiSmmCore.inf
   and PiSmmCore.h for https://bugzilla.tianocore.org/show_bug.cgi?id=1062.

v3:
1. Add https://bugzilla.tianocore.org/show_bug.cgi?id=1062 to the
   link list.
2. Remove DevicePathLib from I2cHostDxe.inf.
3. Update NvmExpressPei.inf, NvmExpressPei.h, UfsPciHcDxe.inf,
   UfsPciHcDxe.h, I2cHostDxe.inf, AtaBusDxe.inf, IScsiDxe.inf,
   IScsiDxe.h, DxeMain.inf, DxeMain.h, PiSmmCore.inf and PiSmmCore.h
   for https://bugzilla.tianocore.org/show_bug.cgi?id=1062.
   (Forget to add UfsPciHcDxe.inf, UfsPciHcDxe.h, AtaBusDxe.inf,
   and I2cHostDxe.inf previously.)

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoShellPkg/edit: Fix heap access out-of-bounds
Ruiyu Ni [Thu, 16 Aug 2018 06:31:57 +0000 (14:31 +0800)]
ShellPkg/edit: Fix heap access out-of-bounds

The issue was found when heap guard is turned on.
PrintLib somehow receives a non-null terminated string in var-arg.
When the PrintLib implementation reads the string it keeps
reading because no null-terminator is met, which triggers the page
fault set by the heap guard.

The issue is caused by a bug in FileBufferPrintLine().
When "edit" opens a binary file, in FileBufferPrintLine(),
the Line->Buffer may start with \x00 \x00, but the Line->Size is
larger than MainEditor.ScreenSize.Column, it causes the PrintLine is
set to an empty string by below call:
    StrnCpyS (
      PrintLine, BufLen/sizeof(CHAR16), Buffer,
      MIN(Limit, MainEditor.ScreenSize.Column)
      );
But since Limit (equals to Line->Size) is larger than
MainEditor.ScreenSize.Column, below for-loop doesn't successfully
set the whole PrintLine to all-empty-space.
    for (; Limit < MainEditor.ScreenSize.Column; Limit++) {
      PrintLine[Limit] = L' ';
    }
So after the for-loop, PrintLine is still an empty string.
Later in below call, the PrintLine2 is created based on PrintLine.
    ShellCopySearchAndReplace (
      PrintLine, PrintLine2,
      BufLen * 2, L"%", L"^%", FALSE, FALSE
      );
But due to the implementation of ShellCopySearchAndReplace(),
PrintLine2 is untouched and INVALID_PARAMETER is returned.
Finally an uninitialized string is passed to ShellPrintEx()
which causes the #PF exception.

The fix is to reset Limit to StrLen(PrintLine) before for-loop.
So that PrintLine can be converted from an empty string to a
string containing all spaces.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Jian Wang <jian.j.wang@intel.com>
5 years agoSignedCapsulePkg: Remove redundant things in inf,.h and .c files
shenglei [Fri, 10 Aug 2018 06:07:18 +0000 (14:07 +0800)]
SignedCapsulePkg: Remove redundant things in inf,.h and .c files

Two redundant library classes have been removed.
The redundant function "IsSystemFmp" has been removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1067

v2: Remove DxeServicesLib from SystemFirmwareUpdateDxe.inf.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoBaseTools: remove unused setter functions
Jaben Carsey [Fri, 17 Aug 2018 16:17:40 +0000 (00:17 +0800)]
BaseTools: remove unused setter functions

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@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 code
Jaben Carsey [Thu, 16 Aug 2018 23:24:14 +0000 (07:24 +0800)]
BaseTools: remove unused code

the if statment just has pass statement.
invert if condition and just use do the else work.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@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 to iterate less
Jaben Carsey [Fri, 3 Aug 2018 15:11:08 +0000 (23:11 +0800)]
BaseTools: AutoGen refactor to iterate less

Don't iterate over new dictionaries with one item

Create the data and then add to dictionary.

Note: if you diff ignoring whitespace changes you
can more easily see the relevant changes.

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>