Commit Graph

5361 Commits

Author SHA1 Message Date
Jian J Wang 2af2988f3a MdeModulePkg/DxeIpl: disable paging before creating new page table
PEI Stack Guard needs to enable paging before DxeIpl. This might cause
#GP in the transition from 32-bit PEI to 64-bit DXE due to the code
trying to write CR3 register with PML4 page table while the processor
is enabled with PAE paging.

Simply disabling paging before updating CR3 can solve this conflict.
There's no such issue for 64-bit PEI so this change applies only to
32-bit code.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: "Ware, Ryan R" <ryan.r.ware@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2018-09-10 09:28:26 +08:00
Liming Gao 40a7b235e4 MdeModulePkg PeiCore: Always use PeiImageRead() function to load PEI image
In V2, Remove GetImageReadFunction(), directly use PeiImageRead().

The copy PeiImageReadForShadow function doesn't improve the boot performance.
This patch removes this copy logic to simplify the code logic.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-09-07 21:39:26 +08:00
Laszlo Ersek b48ec0e8ab MdeModulePkg/EhciDxe: factor out EhcIsDebugPortInUse()
The EhcReset(), EhcGetRootHubPortStatus() and EhcDriverBindingStart()
functions need to see whether the host controller (or a specific port on
the host controller) can be accessed, dependent on the controller having
(or the specific port being) an in-use debug port. Because the condition
isn't simple, extract it to a separate function.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Suggested-by: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-09-06 14:07:50 +02:00
Chen A Chen de005223b7 MdeModulePkg: Removing ipf which is no longer supported from edk2.
Removing rules for Ipf sources file:
* Remove the source file which path with "ipf" and also listed in
  [Sources.IPF] section of INF file.
* Remove the source file which listed in [Components.IPF] section
  of DSC file and not listed in any other [Components] section.
* Remove the embedded Ipf code for MDE_CPU_IPF.

Removing rules for Inf file:
* Remove IPF from VALID_ARCHITECTURES comments.
* Remove DXE_SAL_DRIVER from LIBRARY_CLASS in [Defines] section.
* Remove the INF which only listed in [Components.IPF] section in DSC.
* Remove statements from [BuildOptions] that provide IPF specific flags.
* Remove any IPF sepcific sections.

Removing rules for Dec file:
* Remove [Includes.IPF] section from Dec.

Removing rules for Dsc file:
* Remove IPF from SUPPORTED_ARCHITECTURES in [Defines] section of DSC.
* Remove any IPF specific sections.
* Remove statements from [BuildOptions] that provide IPF specific flags.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-09-06 15:25:16 +08:00
Star Zeng 4a76d9b9a3 MdeModulePkg: Remove trailing white space
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1144

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
2018-09-06 09:17:03 +08:00
Laszlo Ersek c3d5d800d7 MdeModulePkg/EhciDxe: fix host controller reset condition in BindingStart
Commit 09943f5ecc ("MdeModulePkg: Skip to manage usb debug port in EDKII
EHCI driver if it's used by usb debug port driver", 2012-04-28) made the
host controller reset in EhcDriverBindingStart() conditional. The intent
was to avoid the reset when
- one of the USB ports on the host controller was a Debug Port, AND
- the Debug Port was in use.

This translates to the following positive condition: reset the controller
only if:
- no USB port on the host controller is a Debug Port, OR
- the Debug Port is not in use.

Commit 09943f5ecc failed to implement the first subcondition, and thus
the result is too strict now (for resetting the host controller). Relax it
to the correct condition.

This issue was found by Steven Shi on QEMU. QEMU's EHCI device model does
not have a Debug Port. In repeated disconnect / connect cycles, the
controller is never reset in EhcDriverBindingStart(), therefore the
devices on the controller are never re-enumerated after a disconnect.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Reported-by: Steven Shi <steven.shi@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1129
Fixes: 09943f5ecc
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Tested-by: Steven Shi <steven.shi@intel.com>
2018-09-05 14:00:12 +02:00
Star Zeng 8a204b2aca MdeModulePkg PeiCore: Fix VS2012 build failure
fwvol.c(1572) : warning C4701: potentially uninitialized
local variable 'Status' used

The build failure is caused by
0e042d0ad7 for
https://bugzilla.tianocore.org/show_bug.cgi?id=1131

This patch initializes Status to fix the build failure.

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jian J Wang <jian.j.wang@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>
2018-09-05 13:17:10 +08:00
Bi, Dandan 04722cfa30 MdeModulePkg/Setup: Fix incorrect size used in AllocateCopyPool
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1115

When the type of HiiValue is EFI_IFR_TYPE_BUFFER,
its question type is EFI_IFR_ORDERED_LIST_OP.
And the buffer size allocated for Statement->BufferValue
of orderedList is "Statement->StorageWidth"
in IfrParse.c.

So here when backup the buffer value and copy the size of
"Statement->StorageWidth + sizeof(CHAR16)" is incorrect.

This patch is to fix this issue.

Cc: Eric Dong <eric.dong@intel.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>
2018-09-04 09:14:46 +08:00
Star Zeng e3b9ab433a MdeModulePkg DxeCore: Handle multiple FV images in one FV file
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1131

PI spec and BaseTools support to generate multiple FV images
in one FV file.
This patch is to update DxeCore to handle the case.

Cc: Liming Gao <liming.gao@intel.com>
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: Liming Gao <liming.gao@intel.com>
2018-09-03 17:04:58 +08:00
Star Zeng 0e042d0ad7 MdeModulePkg PeiCore: Handle multiple FV images in one FV file
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1131

PI spec and BaseTools support to generate multiple FV images
in one FV file.
This patch is to update PeiCore to handle the case.

Cc: Liming Gao <liming.gao@intel.com>
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: Liming Gao <liming.gao@intel.com>
2018-09-03 17:04:57 +08:00
Fu Siyuan 12ae56cf28 MdeModulePkg/Network: Add 32bit subnet mask support for IP4 PXE boot.
This patch updates IP4 stack to support 32bit subnet mask in PXE boot process.
When 32bit subnet mask is used, the IP4 driver couldn't use the subnet mask to determine
whether destination IP address is on-link or not, so it will always try to send all the
packets to the destination IP address directly first, if failed it will continue
to try the default gateway.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
2018-09-03 08:36:55 +08:00
shenglei 36faa23c46 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>
2018-08-30 14:44:03 +08:00
Jian J Wang 8f2613628a 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>
2018-08-30 07:22:29 +08:00
Eric Dong f965b772fc 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>
2018-08-28 10:24:25 +08:00
Star Zeng 17da1b9108 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>
2018-08-28 10:13:33 +08:00
Ruiyu Ni 983f5abb9a 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>
2018-08-27 09:40:22 +08:00
Ruiyu Ni 06da1e310b 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>
2018-08-27 09:40:21 +08:00
Bi, Dandan e0c93c9b76 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>
2018-08-22 10:29:28 +08:00
shenglei cc69390670 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>
2018-08-21 16:29:11 +08:00
shenglei ae195de0a3 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>
2018-08-21 16:29:11 +08:00
shenglei 4750f754fc 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>
2018-08-21 16:29:10 +08:00
shenglei d7bcd4c1b9 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>
2018-08-21 16:29:09 +08:00
shenglei 3028d73e5a 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>
2018-08-21 16:29:08 +08:00
shenglei f787da363b 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>
2018-08-21 16:29:08 +08:00
shenglei a2a6f9f61d 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>
2018-08-21 16:29:07 +08:00
shenglei 2394f31c55 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>
2018-08-21 16:29:06 +08:00
shenglei 6e5676b380 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>
2018-08-21 16:29:06 +08:00
shenglei c575d091bb 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>
2018-08-21 16:29:05 +08:00
shenglei d637282efe 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>
2018-08-21 16:29:04 +08:00
shenglei 5bde6c2019 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>
2018-08-21 16:29:04 +08:00
shenglei 0ffa23c0f4 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>
2018-08-21 16:29:03 +08:00
shenglei 880cc3ebef 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>
2018-08-21 16:29:02 +08:00
shenglei 2104e989cf 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>
2018-08-21 16:29:01 +08:00
shenglei 78a6d34fa6 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>
2018-08-21 16:29:01 +08:00
shenglei d270c1dea2 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>
2018-08-21 16:29:00 +08:00
shenglei 349b08d6ad 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>
2018-08-21 16:28:59 +08:00
shenglei 2ed6c872f3 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>
2018-08-21 16:28:59 +08:00
shenglei a829f08684 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>
2018-08-21 16:28:58 +08:00
shenglei 11237cf147 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>
2018-08-21 16:28:57 +08:00
shenglei 66d3c76b8a 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>
2018-08-21 16:28:57 +08:00
shenglei 442d4dde72 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>
2018-08-21 16:28:56 +08:00
shenglei f210a43391 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>
2018-08-21 16:28:55 +08:00
shenglei 385fd1b846 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>
2018-08-21 16:28:54 +08:00
shenglei 0629ae291a 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>
2018-08-21 16:28:54 +08:00
shenglei d82ebaa340 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>
2018-08-21 16:28:53 +08:00
shenglei 131818ba5a 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>
2018-08-20 14:53:45 +08:00
Laszlo Ersek 5b080845a1 MdeModulePkg/RamDiskDxe: replace OpenFileByDevicePath() with UefiLib API
Replace the OpenFileByDevicePath() function with EfiOpenFileByDevicePath()
from UefiLib, correcting the following issues:

- imprecise comments on OpenFileByDevicePath(),
- code duplication between this module and other modules,
- local variable name "EfiSimpleFileSystemProtocol" starting with "Efi"
  prefix,
- bogus "FileHandle = NULL" assignments,
- passing a potentially unaligned "FILEPATH_DEVICE_PATH.PathName" field to
  a protocol member function (forbidden by the UEFI spec),
- leaking "Handle1" when the device path type/subtype check fails in the
  loop,
- stale SHELL_FILE_HANDLE reference in a comment.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1008
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2018-08-16 20:02:50 +02:00
Star Zeng a9ae5b37bf MdeModulePkg SmmLockBox: Return actual data length in SmmLockBoxRestore
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1082

Current code only returns actual data length in case of return status
buffer too small.
If caller provided a buffer that's large enough to restore data from
lock box, actual data length is not returned. It needs to be updated
in case of return status as success as well.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Anbazhagan Baraneedharan <anbazhagan@hp.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>
2018-08-16 09:02:14 +08:00
Star Zeng 6ec4d300fe MdeModulePkg ErstFmpDxe: Create ESRT in ReadyToBoot event
Current code just creates ESRT entry in FMP notification
and installs ESRT configuration table in ReadyToBoot event.

The LastAttemptVersion and LastAttemptStatus in ESRT will
be out of date after system continues to boot without reset
after capsule update (reset is not required or capsule update
is failed).

This patches updates the code to create ESRT based on all
FMP instances in ReadyToBoot event.

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: Michael D Kinney <michael.d.kinney@intel.com>
2018-08-08 19:18:25 +08:00
Dandan Bi d3bc33731f MdeModulePkg: Remove DxeSmmPerformanceLib
DxeSmmPerformanceLib previously is used by DP tool.
But in new pweformance infrastructure, we have updated
Dp tool to get the performance data from firmware
performance data table in ACPI.
Now the DxeSmmPerformanceLib is not used by
any module. So remove it from edk2 code base to
avoid being used by mistake.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2018-08-06 13:58:54 +08:00