summaryrefslogtreecommitdiff
path: root/MdeModulePkg
AgeCommit message (Collapse)AuthorFilesLines
2018-06-27MdeModulePkg UsbBusPei: Fix wrong buffer length used to read hub descStar Zeng2-74/+38
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=973 Bug 973 just mentions UsbBusDxe, but UsbBusPei has similar issue. HUB descriptor has variable length. But the code uses stack (HubDescriptor in PeiDoHubConfig) with fixed length sizeof(EFI_USB_HUB_DESCRIPTOR) to hold HUB descriptor data. It uses hard code length value (12) for SuperSpeed path. And it uses HubDesc->Length for none SuperSpeed path, then there will be stack overflow when HubDesc->Length is greater than sizeof(EFI_USB_HUB_DESCRIPTOR). The patch updates the code to use a big enough buffer to hold the descriptor data. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Bret Barkelew <bret.barkelew@microsoft.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>
2018-06-27MdeModulePkg UsbBusDxe: Fix wrong buffer length used to read hub descStar Zeng2-78/+32
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=973 HUB descriptor has variable length. But the code uses stack (HubDesc in UsbHubInit) with fixed length sizeof(EFI_USB_HUB_DESCRIPTOR) to hold HUB descriptor data. It uses hard code length value (32 that is greater than sizeof(EFI_USB_HUB_DESCRIPTOR)) for SuperSpeed path, then there will be stack overflow when IOMMU is enabled because the Unmap operation will copy the data from device buffer to host buffer. And it uses HubDesc->Length for none SuperSpeed path, then there will be stack overflow when HubDesc->Length is greater than sizeof(EFI_USB_HUB_DESCRIPTOR). The patch updates the code to use a big enough buffer to hold the descriptor data. The definition EFI_USB_SUPER_SPEED_HUB_DESCRIPTOR is wrong (HubDelay field should be UINT16 type) and no code is using it, the patch removes it. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Bret Barkelew <bret.barkelew@microsoft.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>
2018-06-26MdeModulePkg: Use new added Perf macrosBi, Dandan11-76/+53
Replace old Perf macros with the new added ones. Cc: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2018-06-26MdeModulePkg: Update performance library instancesBi, Dandan8-720/+1565
Update the performance library instances in MdeModulePkg to implement the APIs used for new added Perf macros. V2: Share the common logics of creating FPDT record for new added Perf macros and existing Perf macros. 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-06-26MdeModulePkg/ExtendedFirmwarePerf: Remove PerfId definitionsBi, Dandan1-25/+0
Remove the definitions of performance identifier since they have been added into PerformanceLib.h. 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-06-26MdeModulePkg: Update Performance instances to use new protocolBi, Dandan10-1078/+283
Update Performance instances in MdeModulePkg to use new PerformanceMeasurement protocol. 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-06-26MdeModulePkg: Add PERFORMANCE_MEASUREMENT_PROTOCOLBi, Dandan2-0/+94
Add PerformanceMeasurement protocol to log performance info. 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-06-26MdeModulePkg/CapsuleRuntimeDxe: Fix ECC issueDandan Bi2-1/+6
Add guard macro for new added header file. 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-06-25MdeModulePkg BootMaintenanceManagerUiLib: Move refresh boot option laterLiming Gao1-2/+1
Constructor is too early that ConnectAll() may not do. Move refresh boot option in form open. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Xu WeiX <weix.xu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
2018-06-25MdeModulePkg BdsDxe: Correct VariableLockProtocol usage to match code logicLiming Gao1-1/+1
BdsEntry marks the read-only variables if the Variable Lock protocol exists. So, this protocol usage is updated from CONSUMES to SOMETIMES_CONSUMES. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2018-06-25MdeModulePkg: Add GUID for recovery capsule on NVM Express devicesHao Wu2-0/+12
Cc: Eric Dong <eric.dong@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-06-25MdeModulePkg/NvmExpressPei: Add the NVME device PEI BlockIo supportHao Wu13-0/+3424
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=256 This commit adds the PEI BlockIo support for NVM Express devices. The driver will consume the EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI for NVM Express host controllers within the system. And then produces the BlockIo(2) PPIs for each controller. The implementation of this driver is currently based on the NVM Express 1.1 Specification, which is available at: http://nvmexpress.org/resources/specifications/ Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-06-25MdeModulePkg: Add definitions for EDKII PEI NVME host controller PPIHao Wu2-0/+95
Introduces the below PPI: struct EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI { EDKII_NVM_EXPRESS_HC_GET_MMIO_BAR GetNvmeHcMmioBar; EDKII_NVM_EXPRESS_HC_GET_DEVICE_PATH GetNvmeHcDevicePath; }; The GetNvmeHcMmioBar service will provide the caller with the MMIO BAR address of each NVMe HC within the system; The GetNvmeHcDevicePath service will provide the caller with the device path information of each NVMe HC. Cc: Eric Dong <eric.dong@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2018-06-21MdeModulePkg: Enable SATA Controller PCI mem spaceSami Mujawar2-1/+86
The SATA controller driver crashes while accessing the PCI memory [AHCI Base Registers (ABAR)], as the PCI memory space is not enabled. Enable the PCI memory space access to prevent the SATA Controller driver from crashing. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-06-21MdeModulePkg/NetworkPkg: Checking for NULL pointer before use.Fu Siyuan1-2/+5
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sivaraman Nainar <sivaramann@amiindia.co.in> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2018-06-19MdeModulePkg/Core: remove SMM check for Heap Guard feature detectionJian J Wang1-10/+0
CpuDxe driver is updated to be able to access DXE page table in SMM mode, which means Heap Guard can get correct memory paging attributes in what environment. It's not necessary to exclude SMM from detecting Heap Guard feature support. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.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: Star Zeng <star.zeng@intel.com>
2018-06-19MdeModulePkg/AtaAtapiPassThru: Fix VS2010/VS2012 build failureRuiyu Ni1-1/+1
The patch doesn't have functionality impact. It is just to make VS2010/VS2012 happy. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
2018-06-15MdeModulePkg/DxeCapsuleLibFmp: pass progress callback only if it worksArd Biesheuvel1-3/+10
If the first call to UpdateImageProgress() fails, there is no point in passing a pointer to it to Fmp->SetImage(), since it is highly unlikely to succeed on any subsequent calls. This permits the FMP implementation to fall back to an alternate means of providing feedback to the user, e.g., via the console. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-06-15MdeModulePkg/CapsuleRuntimeDxe: clean the capsule payload to DRAMArd Biesheuvel5-29/+213
When capsule updates are staged for processing after a warm reboot, they are copied into memory with the MMU and caches enabled. When the capsule PEI gets around to coalescing the capsule, the MMU and caches may still be disabled, and so on architectures where uncached accesses are incoherent with the caches (such as ARM and AARCH64), we need to ensure that the data passed into UpdateCapsule() is written back to main memory before performing the warm reboot. Unfortunately, on ARM, the only type of cache maintenance instructions that are suitable for this purpose operate on virtual addresses only, and given that the UpdateCapsule() prototype includes the physical address of a linked list of scatter/gather data structures that are mapped at an address that is unknown to the firmware (and may not even be mapped at all when UpdateCapsule() is invoked), we can only perform this cache maintenance at boot time. Fortunately, both Windows and Linux only invoke UpdateCapsule() before calling ExitBootServices(), so this is not a problem in practice. In the future, we may propose adding a secure firmware service that permits performing the cache maintenance at OS runtime, in which case this code may be enhanced to call that service if available. For now, we just fail any UpdateCapsule() calls performed at OS runtime on ARM. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2018-06-14MdeModulePkg/IncompPciDeviceSupport: Use correct descriptor lengthRuiyu Ni1-2/+2
Per PI spec, the Length value is the length of the ACPI descriptor in bytes, excluding the first two fields. The patch fixes the code to report the correct descriptor length by excluding 3-byte first two fields. 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-06-13MdeModulePkg/SdDxe: Demote DEBUG print to DEBUG_BLKIOHao Wu1-2/+2
Similar to commit 9dca2105ad960c9946d7cc2ece40f65e1999dac7, lower the priority of the DEBUG print in SDReadWrite() to DEBUG_BLKIO. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-06-13MdeModulePkg/NvmExpressDxe: Adjust R/W DEBUG prints to BLKIO levelHao Wu1-5/+5
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=980 Adjust the DEBUG prints within function: NvmeRead(), NvmeWrite(), AsyncNvmeRead() and AsyncNvmeWrite() to DEBUG_BLKIO for the consistency with other storage device drivers (e.g. ATA, USB and etc.). Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-06-12MdeModulePkg Variable: Use comparison logic to check UINTN parameterLiming Gao2-14/+14
Commit 180ac200da84785989443b06bcfa5db343c0bf7e changes the input parameter from BOOLEAN to UINTN. Its comparison logic should be updated. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-06-11MdeModulePkg/EmmcDxe: demote DEBUG print to DEBUG_BLKIOArd Biesheuvel1-1/+4
Lower the priority of the DEBUG print in EmmcReadWrite(), which is emitted for each read or write operation to the eMMC device, which clutters up the log output of builds created with DEBUG_INFO enabled. Suggested-by: Pipat Methavanitpong <methavanitpong.pipat@socionext.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-06-11MdeModulePkg/Library/BaseSerialPortLib16550: Ensure FIFO Polled ModeLeo Duran1-4/+12
Put the UART in FIFO Polled Mode by clearing IER after setting FCR. Also, add comments to show DLAB state for registers 0 and 1. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Leo Duran <leo.duran@amd.com> Cc: Star Zeng <star.zeng@intel.com> CC: Eric Dong <eric.dong@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-06-08MdeModulePkg/DxeCapsuleLibFmp: Add progress bar supportKinney, Michael D5-36/+131
https://bugzilla.tianocore.org/show_bug.cgi?id=801 Based on content from the following branch/commits: https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport * Change Update_Image_Progress() to UpdateImageProcess() * Call DisplayUpdateProgressLib from UpdateImageProgress(). * Split out a boot service and runtime version of UpdateImageProgress() so the DisplayUpdateProgressLib is not used at runtime. * If gEdkiiFirmwareManagementProgressProtocolGuid is present, then use its progress bar color and watchdog timer value. * If gEdkiiFirmwareManagementProgressProtocolGuid is not present, then use default progress bar color and 5 min watchdog timer. * Remove Print() calls during capsule processing. Instead, the DisplayUpdateProgressLib is used to inform the user of progress during a capsule update. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-06-08MdeModulePkg/Ata/AtaAtapiPassThru: Enable/disable DEVSLP per policyRuiyu Ni2-2/+235
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Chasel Chiu <chasel.chiu@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-06-08MdeModulePkg/AtaAtapiPassThru: enable/disable PUIS per policyRuiyu Ni4-2/+71
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Chasel Chiu <chasel.chiu@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2018-06-08MdeModulePkg: Add AtaAtapiPolicy protocol definitionRuiyu Ni2-0/+61
The patch adds AtaAtapiPolicy protocol which is produced by platform and consumed by AtaAtapiPassThruDxe driver. 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-06-08MdeModulePkg/AtaAtapiPassThru: Spin up Power up in Standby devicesRuiyu Ni2-5/+128
The patch adds support to certain devices that support PUIS (Power up in Standby). For those devices that supports SET_FEATURE spin up, SW needs to send SET_FEATURE subcommand to spin up the devices. For those devices that doesn't support SET_FEATURE spin up, SW needs to send read sectors command to spin up the devices. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Chasel Chiu <chasel.chiu@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2018-06-07MdeModulePkg: Remove X86 ASM and S filesLiming Gao22-3510/+6
NASM has replaced ASM and S files. 1. Remove ASM from all modules. 2. Remove S files from the drivers only. 3. https://bugzilla.tianocore.org/show_bug.cgi?id=881 After NASM is updated, S files can be removed from Library. 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-06-07MdeModulePkg/DisplayUpdateProgressLib: Fix ECC issuesDandan Bi2-4/+4
Make the comment align with Edk2 coding style. Cc: Star Zeng <star.zeng@intel.com> 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: Star Zeng <star.zeng@intel.com>
2018-06-05MdeModulePkg BootManagerMenuApp: Update usage info for BootLogo protocolLiming Gao1-2/+2
BootLogo protocol is not always required. If it not is installed, BootManagerMenuApp can work. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-06-05MdeModulePkg: Make sure ResetSystemRuntimeDxe uses ResetSystemLibNullRuiyu Ni1-1/+4
Because the DxeResetSystemLib calls gRT->ResetSystem(), make sure the gRT->ResetSystem() implementation doesn't call into DxeResetSystemLib to avoid chicken-egg issue. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com>
2018-06-05MdeModulePkg/DxeResetSystemLib: Avoid depending on UefiRuntimeLibRuiyu Ni2-8/+7
Current DxeResetSystemLib depends on UefiRuntimeLib because it calls EfiResetSystem() API exposed by UefiRuntimeLib. Due to the commit: "MdePkg/UefiRuntimeLib: Do not allow to be linked by DXE driver" which reverts UefiRuntimeLib to only support DXE_RUNTIME_DRIVER, removing UefiRuntimeLib dependency makes the DxeResetSystemLib can be used by DXE drivers. The patch also disallows the DxeResetSystemLib to be linked by runtime driver, SMM drivers. Runtime driver cannot link to this library because the gRT is not converted when entering to RT. SMM driver cannot link to this library because calling RT services from SMM after EndOfDxe violates security guideline. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com>
2018-06-04MdeModulePkg PeiCore: Check error status when processing boot FVMarcin Wojtas1-6/+7
Until now the possible errors returned from processing boot firmware volume were not checked, which could cause misbehavior in further booting stages. Add relevant assert. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas <mw@semihalf.com> Signed-off-by: Jan Dabros <jsd@semihalf.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-05-29MdeModulePkg/FirmwarePerformanceDataTableDxe: use AllocatePeiAccessiblePagesArd Biesheuvel2-42/+10
Replace the call to and implementation of the function FpdtAllocateReservedMemoryBelow4G() with a call to AllocatePeiAccessiblePages, which boils down to the same on X64, but does not crash non-X64 systems that lack memory below 4 GB. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-05-29MdeModulePkg/DxeCorePerformanceLib: use AllocatePeiAccessiblePagesArd Biesheuvel1-41/+7
Replace the call to and implementation of the function FpdtAllocateReservedMemoryBelow4G() with a call to AllocatePeiAccessiblePages, which boils down to the same on X64, but does not crash non-X64 systems that lack memory below 4 GB. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-05-28MdeModulePkg: Add DisplayUpdateProgressLib instancesMichael D Kinney7-0/+801
https://bugzilla.tianocore.org/show_bug.cgi?id=801 Based on content from the following branch/commits: https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport Add DisplayUpdateProgressLib instances for text consoles and graphical consoles. Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2018-05-28MdeModulePkg: Add DisplayUpdateProgressLib classMichael D Kinney3-0/+131
https://bugzilla.tianocore.org/show_bug.cgi?id=801 Based on content from the following branch/commits: https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport Add the DisplayUpdateProgressLib class that is used to inform the user of progress during updates of firmware images in firmware devices. A platform specific instance of this library can be used to customize how the user is informed of progress. Add the EDK II Firmware Management Progress Protocol. This is an optional protocol that must be installed onto the same handle as a Firmware Management Protocol. This new protocol provides the color of a progress bar that allows different firmware devices to use different colors during a firmware update. It also provides a watchdog timer value in seconds that is armed each time the Progress() service passed into Firmware Management Protocol SetImage() is called. Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2018-05-28MdeModulePkg/PciBus: Do not enable MemWriteAndInvalidate bit for PCIERuiyu Ni1-4/+6
Per PCIE spec, Memory Write and Invalidate is hardwired to 0b so PciBus driver shouldn't write 1b to it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
2018-05-28MdeModulePkg/PciBus: Remove unnecessary PCIE detectionRuiyu Ni1-16/+1
CreatePciIoDevice() detects whether the PCI device is a PCI Express device and remembers the device type in PciIoDevice->IsPciExp. RegisterPciDevice() detects the device type again which is unnecessary. The detection logic can be removed. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com>
2018-05-25MdeModulePkg/PciBus: Use actual max bus # for subordinary bus #Ruiyu Ni1-1/+38
Current code assumes the max bus(0xFF) is under this P2P bridge and temporarily set it as subordinate bus. It may cause silicon hangs during PCI enumeration in some specific case. Instead, it should get the max bus number from the bus number resources returned from PCI_HOST_BRIDGE_RESOURCE_ALLOCATION.StartBusEnumeration() and set it as subordinate bus. 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-05-23MdeModulePkg Variable: Fix XCODE5 varargs warningLiming Gao2-2/+2
https://bugzilla.tianocore.org/show_bug.cgi?id=741 Change VariableGetBestLanguage() parameter type from BOOLEAN to UINTN Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Steven Shi <steven.shi@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2018-05-17MdeModulePkg PeiCore: FvCount to be checked for the registered for shadow PEIMLiming Gao1-1/+1
The PEIM in all cached FV image may be in registered for shadow status. Current logic CurrentPeimFvCount is not enough. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-05-14MdeModulePkg Variable: Fix the returned status in UpdateVariableStorecinnamon shia1-3/+5
If Fvb is a NULL, return EFI_UNSUPPORTED. If the remaining size is not enough, return EFI_OUT_OF_RESOURCES. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: cinnamon shia <cinnamon.shia@hpe.com> Signed-off-by: Ansen Huang <ansen.huang@hpe.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-05-14MdeModulePkg Variable: Fix a corner case issue about setting a variablecinnamon shia1-3/+3
Fix the issue that failed to update or add a UEFI variable if the remaining size is equal to the data size of the variable. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: cinnamon shia <cinnamon.shia@hpe.com> Signed-off-by: Ansen Huang <ansen.huang@hpe.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-05-09MdeModulePkg/PciHostBridge: Count the (mm)io overhead when pollingRuiyu Ni5-54/+114
RootBridgeIo.PollMem()/PollIo() originally don't count the IO/MMIO access overhead when delaying. The patch changes the implementation to count the access overhead so that the actually delay equals to user required delay. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Cc: Chasel Chiu <chasel.chiu@intel.com>
2018-05-08MdeModulePkg/AcpiPlatformDxe: Unload after execution.Marvin.Haeuser@outlook.com1-2/+5
AcpiPlatformDxe solely performs one-time tasks and does not expose any services or create any events. Hence it can safely be unloaded after the Entry Point execution by returning an error code. V2: Return EFI_REQUEST_UNLOAD_IMAGE. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-05-08MdeModulePkg CapsuleApp: Check Buffer against NULL before freeing itStar Zeng1-2/+5
If the capsule from command line is not present, Buffer will be random value when freeing it in DumpCapsule(), then ASSERT will happen or other memory pool may be freed. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>