summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
Commit message (Collapse)AuthorAgeFilesLines
* MdeModulePkg: Reproduce builds across source format changesMichael D Kinney2021-11-082-2/+2
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3688 Use DEBUG_LINE_NUMBER instead of __LINE__. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Tested-by: Michael Kubacki <michael.kubacki@microsoft.com>
* MdeModulePkg/XhciSched: Fix missing DEBUG argumentsMichael Kubacki2021-11-081-2/+2
| | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3662 Two DEBUG macros in XhciDxe/XhciSched.c are missing the argument that should be passed for the print specifier. In addition, this change updates the print level to "DEBUG_ERROR" and prints the status as well. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg/Variable/RuntimeDxeUnitTest: Fix 32-bit GCC buildsMichael D Kinney2021-11-051-3/+3
| | | | | | | | | | | | | | | | When using will_return() on a pointer value, it must be cast to UINTN to be compatible with 32-bit GCC builds. This uses the same approach in samples provided in the UnitTestFramworkPkg when passing pointer values to UT_ASSERT_EQUAL(). Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/SortLib: Add QuickSort function on BaseLibIanX Kuo2021-10-212-223/+8
| | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3675 Use QuickSort instead of QuickSortWorker Cc: Ray Ni <ray.ni@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: IanX Kuo <ianx.kuo@intel.com>
* MdeModulePkg/Core/Dxe: Acquire a lock when iterating gHandleListHua Ma2021-10-144-41/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3680 This patch fixes the following issue: The global variable gHandleList is a linked list. This list is locked when a entry is added or removed from the list, but there is no lock when iterating this list in function CoreValidateHandle(). It can lead to "Handle.c (76): CR has Bad Signature" assertion if the iterated entry in the list is just removed by other task during iterating. Currently some caller functions of CoreValidateHandle() have CoreAcquireProtocolLock(), but some caller functions of CoreValidateHandle() do not CoreAcquireProtocolLock(). Add CoreAcquireProtocolLock() always when CoreValidateHandle() is called, Also, A lock check is added in the CoreValidateHandle(). Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Hua Ma <hua.ma@intel.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg/Sd: Corrections for Extra.uni filesKonstantin Aladyshev2021-10-143-5/+8
| | | | | | | | | Add correct content to the 'SdDxeExtra.uni' file. Include 'EmmcDxeExtra.uni' and 'SdDxeExtra.uni' files to their appropriate INF files. Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/Core/Dxe: Add lock protection in CoreLocateHandleBuffer()Hua Ma2021-10-081-13/+51
| | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3666 Currently, CoreLocateHandleBuffer() follows three steps: 1) get the size of protocol database firstly 2) allocate the buffer based on the size 3) get the protocol database into the buffer There is no lock protection for the whole three steps. If a new protocol added in step 2) by other task, e.g. (event timer handle USB device hotplug). The size of protocol database may be increased and cannot fit into the previous buffer in step 3). The protocol database cannot be returned successfully, EFI_BUFFER_TOO_SMALL error will be returned. This patch adds the lock to protect the whole three steps. It can make sure the correct protocol database be returned. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Hua Ma <hua.ma@intel.com> Reviewed-by: Dandan Bi dandan.bi@intel.com Reviewed-by: Liming Gao gaoliming@byosoft.com.cn
* MdeModulePkg: CI YAML: Added new GUID to ignore duplicate listKun Qin2021-09-301-0/+1
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3629 SMM Communication PPI GUID from MdeModulePkg is defined the same as MM Communication PPI GUID from MdePkg, according to PI Spec v1.5 and onward. After introduction of MM Communication PPI definitions, an update in the ignore duplicate list is needed to avoid breaking CI build. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Kun Qin <kuqin12@gmail.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg/BootManagerMenuApp: Limit string drawing within one lineZhichao Gao2021-09-291-3/+69
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3590 Limit the draw box always within the screen's column and row. Limit the string drawing within one line. For the incompleted string the last 3 characters in one line would be replaced with "...". Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg/PciBusDxe: Improve the flow of testing support attributesxueshengfeng2021-09-261-2/+5
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=3635 Currently, in order to test the supported attributes, the PciTestSupportedAttribute() will set the command register to 0x27 (EFI_PCI_COMMAND_IO_SPACE, EFI_PCI_COMMAND_MEMORY_SPACE, EFI_PCI_COMMAND_BUS_MASTER, EFI_PCI_COMMAND_VGA_PALETTE_SNOOP) firstly, and then read back to check whether these attributes are set successfully in the device. This will cause the other enabled bits (other than EFI_PCI_COMMAND_IO_SPACE,EFI_PCI_COMMAND_MEMORY_SPACE, EFI_PCI_COMMAND_BUS_MASTER,EFI_PCI_COMMAND_VGA_PALETTE_SNOOP) be cleared for a short of time This patch fixes this issue by keeping the origina enabled bits when setting 0x27. Signed-off-by: xueshengfeng <xueshengfeng@byosoft.com.cn> Reviewed-by: Ray <ray.ni@intel.com>
* MdeModulePkg/Core/Pei: Fix pointer size mismatch in EvacuateTempRam()Michael Kubacki2021-09-161-2/+5
| | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3512 In 32-bit PEI, the local variable pointers MigratedFvHeader and RawDataFvHeader in EvacuateTempRam() will be 32-bit in size. The pointers are currently passed to PeiServicesAllocatePages() which expects a 64-bit output buffer of type EFI_PHYSICAL_ADDRESS. When PeiServicesAllocatePages() writes to the buffer, the data can overflow. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg/Core/Pei: Make migrated PEIM message verboseMichael Kubacki2021-09-161-1/+1
| | | | | | | | | | | | | Currently, the debug message that prints the name of a PEIM being migrated is DEBUG_INFO while similar messages are DEBUG_VERBOSE. This change updates the print level to DEBUG_VERBOSE for consistency. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg/Core/Pei: Fix typo in function descriptionsMichael Kubacki2021-09-162-3/+3
| | | | | | | | | | | | Corrects a typo in the return value description of MigratePeim() and EvacuateTempRam(): "Succesfully" to "Successfully" Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg: Fix typo of "memory" in RamDiskDxe debug messageRebecca Cran2021-09-031-1/+1
| | | | | | | | Fix a typo of "memory" in a debug message in RamDiskProtocol.c. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
* MdeModulePkg/HiiDatabaseDxe:remove dead code blockWenyi Xie2021-09-021-3/+0
| | | | | | | | | | | | | As the if statement outside has confirmed that BlockData->Name == NULL, so the if statement inside is always false. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Eric Dong <eric.dong@intel.com> Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
* MdeModulePkg/PiSmmCore: Drop deprecated image profiling commandsMarvin H?user2021-09-012-83/+12
| | | | | | | | | | | | | The legacy codebase allowed SMM images to be registered for profiling from DXE. Support for this has been dropped entirely, so remove the remaining handlers. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Eric Dong <eric.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Vitaly Cheptsov <vit9696@protonmail.com> Signed-off-by: Marvin H?user <mhaeuser@posteo.de>
* MdeModulePkg:Increase Nvme capacity displayzhoucheng2021-08-301-0/+2
| | | | | | | | | | | Displays the Nvme total capacity. Signed-off-by: Cheng Zhou <zhoucheng@phytium.com.cn> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg: Add BootDiscoveryPolicyOld variable.Grzegorz Bernacki2021-08-301-0/+1
| | | | | | | | | | | This variable is needed to track the change to BootDiscoveryPolicy variable. Boot options should be refreshed only if BootDiscoveryPolicy has been changed. Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com> Reviewed-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com> Acked-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/EbcDxe: Mitigate memcpy intrinsicsMarvin H?user2021-08-303-3/+15
| | | | | | | | | | | | Assignments of structure values cause the emission of memcpy() intrinsics by the CLANG38 toolchain. Substitute the assignments with calls to CopyMem() to mitigate the issue. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Vitaly Cheptsov <vit9696@protonmail.com> Signed-off-by: Marvin H?user <mhaeuser@posteo.de> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/PeiCore: Remove MigrateSecModulesInFv()Michael Kubacki2021-08-271-96/+0
| | | | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3564 This function has not been called since it was added in commit 9bedaec. If the function were to remain, it would need to be re-evaluated and tested. This change removes the function since it is not being used. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Debkumar De <debkumar.de@intel.com> Cc: Harry Han <harry.han@intel.com> Cc: Catharine West <catharine.west@intel.com> Cc: Marvin H?user <mhaeuser@posteo.de> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg PCD: Reinstall PCD service PPIS when memory availableedk2-stable202108-rc1Yeh, GregX2021-08-131-1/+70
| | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=3525 After PciSegmentLib using Dynamic PCD for Pcie base address such long delay found in FSP. The root cause is some of the PCD service PPIs not shadowed to memory and flash cache may have been disabled in NotifyPhase stage. Solution is to shadow all PCD service PPIs to memory. Signed-off-by: GregX Yeh <gregx.yeh@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg/UefiSortLib:Add UefiSortLib unit testWenyi Xie2021-08-124-0/+246
| | | | | | | | | | | | | Adding two unit test case for UefiSortLib. One is a test on sorting an array of UINT32 by using PerformQuickSort, another is a test on comparing the same buffer by using StringCompare. Add 'main' function name to ECC exception list to avoid ECC error. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: Add BootDiscoveryPolicyUiLib.Grzegorz Bernacki2021-08-038-0/+336
| | | | | | | | | | | This library extends Boot Maintenance Menu and allows to select Boot Discovery Policy. When choice is made BootDiscoveryPolicy variable is set. Platform code can use this variable to decide which class of device shall be connected. Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Sunny Wang <sunny.wang@arm.com>
* MdeModulePkg/CapsuleApp: Fix typo in error messageSeonghyun Park2021-08-021-1/+1
| | | | | | | Fix typo in error message in CapsuleApp. Signed-off-by: Seonghyun Park <shpark1@protonmail.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg PiSmmCore: Change MemoryAttributes message to DEBUG_VERBOSEYang Gang2021-07-221-13/+13
| | | | | | | | | | | 1. Reduce the debug message during boot. 2. Update SmmCore debug level of MemoryAttributesTable align to DxeCore. Signed-off-by: Yang Gang <yanggang@byosoft.com.cn> Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg PCD: Print which PCD was unable to be foundDaniel Schaefer2021-07-211-1/+2
| | | | | | | | | | | | When reaching the assert, it can't be debugged because the PCD is unknown. Therefore the PCD's GUID and token number should be printed. Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/RamDiskDxe: Init list head before registering RamDisk protocolTrammell Hudson2021-07-141-5/+6
| | | | | | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3483 This patch initializes the linked list RegisteredRamDisks in RamDiskDxeEntryPoint before the registration of gEfiRamDiskProtocolGuid with InstallMultipleProtocolInterfaces, allowing ramdisks to be created via a callback installed with RegisterProtocolNotify as soon as the protocol is registered. Without this, calling RamDisk->Register() in the callback causes a crash: ASSERT [RamDiskDxe] MdePkg/Library/BaseLib/LinkedList.c(75): List->ForwardLink != ((void *) 0) Signed-off-by: Trammell Hudson <hudson@trmm.net> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: Change the PldHeader to Header in ExtraData.hTan, Dun2021-07-131-1/+3
| | | | | | | | | | | | | | | Change the PldHeader to Header in UNIVERSAL_PAYLOAD_EXTRA_DATA The meaning of Pld is too general Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com> Acked-by: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: DunTan <dun.tan@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* MdeModulePkg: Update YAML file to fix CI errorNickle Wang2021-07-071-1/+4
| | | | | | | | Add OnigurumaUefiPort.h and OnigurumaUefiPort.c into ECC exception in MdeModulePkg.ci.yaml in order to fix CI error. Signed-off-by: Nickle Wang <nickle.wang@hpe.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg/RegularExpressionDxe: Fix memory assert in FreePool()Nickle Wang2021-07-072-13/+20
| | | | | | | | | | | Memory buffer that is allocated by malloc() and realloc() will be shifted by 8 bytes because Oniguruma keeps its memory signature. This 8 bytes shift is not handled while calling free() to release memory. Add free() function to check Oniguruma signature before release memory because memory buffer is not touched when using calloc(). Signed-off-by: Nickle Wang <nickle.wang@hpe.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg/PartitionDxe: Ignore PMBR BootIndicator per UEFI specNeal Gompa2021-07-061-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Per UEFI Spec 2.8 (UEFI_Spec_2_8_final.pdf, page 114) 5.2.3 Protective MBR Table 20. Protective MBR Partition Record protecting the entire disk The description for BootIndicator states the following: > Set to 0x00 to indicate a non-bootable partition. If set to any > value other than 0x00 the behavior of this flag on non-UEFI > systems is undefined. Must be ignored by UEFI implementations. Unfortunately, we have been incorrectly assuming that the BootIndicator value must be 0x00, which leads to problems when the 'pmbr_boot' flag is set on a disk containing a GPT (such as with GNU parted). When the flag is set, the value changes to 0x01, causing this check to fail and the system is rendered unbootable despite it being valid from the perspective of the UEFI spec. To resolve this, we drop the check for the BootIndicator so that we stop caring about the value set there, which restores the capability to boot such disks. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3474 Cc: Chris Murphy <chrismurphy@fedoraproject.org> Cc: David Duncan <davdunc@amazon.com> Cc: Lazlo Ersek <lersek@redhat.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Neal Gompa <ngompa@fedoraproject.org> Message-Id: <20210705093603.575707-1-ngompa@fedoraproject.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: Add new structure for the Universal Payload Serial Port InfoZhiguang Liu2021-06-242-0/+33
| | | | | | | | | | | | Add Universal Payload Serial Port Info definition header file according to Universal Payload's documentation as below: https://universalpayload.github.io/documentation/ Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* MdeModulePkg/BdsDxe: Update BdsEntry to use Variable PolicyKen Lautner2021-06-223-7/+17
| | | | | | | | | | | | | | Changed BdsEntry.c to use Variable Policy instead of Variable Lock as Variable Lock will be Deprecated eventually Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Kenneth Lautner <kenlautner3@gmail.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg PciBusDxe: Increase the width of data read during oprom shadowSumana Venur2021-06-171-2/+2
| | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2989 Long times spent on shadowing oprom from graphics card to system memory. We are currently using 8 bit read cycles. This needs to be wider, at least 32bit reads to reduce the time for oprom shadow. Signed-off-by: Sumana Venur <sumana.venur@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* PeiCore: Remove assertion when failing to load PE imageRay Ni2021-06-161-4/+1
| | | | | | | | | | | | EFI_PEI_LOAD_FILE_PPI is invoked by DxeIpl for loading DxeCore. It's possible that the instance produced by PeiCore fails to load but other instances of EFI_PEI_LOAD_FILE_PPI can load. Signed-off-by: Ray Ni <ray.ni@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Acked-by: Hao A Wu <hao.a.wu@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg/UniversalPayload: Add definition for extra info in payloadRay Ni2021-06-163-0/+55
| | | | | | | | | | | | | | The payload is in ELF format per the universal payload spec. UNIVERSAL_PAYLOAD_INFO_HEADER is stored in the ELF payload as a separate section named ".upld_info". Extra data needed by payload is stored in sections whose name starts with ".upld.". Signed-off-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/ACPI: Install ACPI table from HOB.Zhiguang Liu2021-06-164-38/+271
| | | | | | | | | | | | | | | | | | | | If HOB contains APCI table information, entry point of AcpiTableDxe.inf should parse the APCI table from HOB, and install these tables. We assume the whole ACPI table (starting with EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER) is contained by a single gEfiAcpiTableGuid HOB. If error happens when installing ACPI table, stop installing and removing all the tables that are already added. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Ray Ni <ray.ni@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Tested-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* MdeModulePkg: Add new structure for the Universal Payload ACPI Table HobZhiguang Liu2021-06-162-0/+33
| | | | | | | | | | Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Tested-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* MdeModulePkg/Universal/SmbiosDxe: Scan for existing tablesZhiguang Liu2021-06-163-3/+360
| | | | | | | | | | | | | | | | | | | | | | The default EfiSmbiosProtocol operates on an empty SMBIOS table. The SMBIOS tables are provided by the bootloader on UefiPayloadPkg. Scan for existing tables in SmbiosDxe and load them if they seem valid. This fixes the settings menu not showing any hardware information, instead only "0 MB RAM" was displayed. Tests showed that the OS can still see the SMBIOS tables. SmbiosDxe will get the SMBIOS from a guid Hob. Also will keep the SmbiosHandle if it is available. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Tested-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* MdeModulePkg: Add new structure for the Universal Payload SMBios Table HobZhiguang Liu2021-06-162-0/+36
| | | | | | | | | | Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Tested-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* MdeModulePkg: Add new structure for the PCI Root Bridge Info HobZhiguang Liu2021-06-163-0/+99
| | | | | | | | | | | | | | Also add ExceptionList in MdeModulePkg\MdeModulePkg.ci.yaml, to avoid open CI issue, because UID and HID are terms which are already used in current source code. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Tested-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* MdeModulePkg: Add Universal Payload general definition header fileZhiguang Liu2021-06-161-0/+35
| | | | | | | | | | | | | | Add Universal Payload general definition header file according to Universal Payload's documentation as below: https://universalpayload.github.io/documentation/ Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Tested-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* MdeModulePkg: Fix device path when boot manager menu is from different FVZhiguang Liu2021-06-151-25/+3
| | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3441 When the boot manager menu is from different FV, the current logic still use the device path of the FV as the module links to this library Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Acked-by: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* MdePkg/MdeModulePkg: Move AML_NAME_SEG_SIZE definitionPierre Gondois2021-06-021-1/+0
| | | | | | | | | | | | | | | | | | | | A NameSeg is made 4 chars. Cf. ACPI 6.4 s20.2.2 "Name Objects Encoding": NameSeg := <leadnamechar namechar namechar namechar> Notice that NameSegs shorter than 4 characters are filled with trailing underscores (‘_’s). AML_NAME_SEG_SIZE is currently defined in: - DynamicTablesPkg/Library/Common/AmlLib/AmlDefines.h - MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiSdt.h Since the value can be inferred from the ACPI specification and to avoid multiple definitions, move it to MdePkg/Include/IndustryStandard/ Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* MdeModulePkg/Xhci: Fix TRT when data length is 0Wenyi Xie2021-06-022-8/+18
| | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3418 According to xhci spec, at USB packet level, a Control Transfer consists of multiple transactions partitioned into stages: a setup stage, an optional data stage, and a terminating status stage. If Data Stage does not exist, the Transfer Type flag(TRT) should be No Data Stage. So if data length equals to 0, TRT is set to 0. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/VariableLock: downgrade compatibility warnings to DEBUG_WARNLaszlo Ersek2021-05-231-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit a18a9bde36d2 ("MdeModulePkg/Variable/RuntimeDxe: Restore Variable Lock Protocol behavior", 2020-12-15), for bug 3111, added two such sets of debug messages that: (a) are relevant for developers, (b) yet should not necessarily poke end-users, because no functionality suffers in practice. Both message sets are in function VariableLockRequestToLock(): the first is a generic interface deprecation warning; the second is the double-locking situation, which we permit for compatibility (return status EFI_SUCCESS). Both message sets should be emitted with the DEBUG_WARN mask, not the most serious DEBUG_ERROR mask. On some platforms, the serial console carries both terminal traffic, and grave (DEBUG_ERROR-only) log messages. On such platforms, both message sets may be perceived as a nuisance by end-users, as there is nothing they can do, and there's nothing they *should* do -- in practice, nothing malfunctions. (Such a platform is ArmVirtQemu, built with "-D DEBUG_PRINT_ERROR_LEVEL=0x80000000".) Cc: Bret Barkelew <bret.barkelew@microsoft.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3410 Fixes: a18a9bde36d2ffc12df29cdced1efa1f8f9f2021 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210521204037.11980-1-lersek@redhat.com> Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg/PlatformDriOverrideDxe: Fix overflow condition checkLi, Walon2021-05-211-1/+1
| | | | | | | | Code mistake, VariableIndex is smaller normally than buffer+buffersize so should not break loop. Signed-off-by: Walon Li <walon.li@hpe.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg/PciBusDxe: Fix possible uninitialized useSergei Dmitrouk2021-05-191-3/+2
| | | | | | | | | | | If the function gets invalid value for the `ResizableBarOp` parameter and asserts are disabled, `Bit` can be used uninitialized. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Sergei Dmitrouk <sergei@posteo.net> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: Retrieve boot manager menu from any fvZhiguang Liu2021-05-181-4/+5
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3384 Currently, UefiBootManagerLib has the below assumption: Assume the BootManagerMenuFile is in the same FV as the module links to this library. It has some limitation now, so remove the assumption. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
* MdeModulePkg: Fix various typosRebecca Cran2021-05-1712-35/+35
| | | | | | | | Fix various typos throughout MdeModulePkg. Signed-off-by: Rebecca Cran <rebecca@nuviainc.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>