summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal
Commit message (Collapse)AuthorAgeFilesLines
* MdeModulePkg/S3SaveState: cast Position for S3BootScriptLib explicitlyLaszlo Ersek2019-10-092-4/+4
| | | | | | | | | | | | | | | | | | | | | The BootScriptInsert() and BootScriptLabel() functions take the in/out parameter "Position" as (EFI_S3_BOOT_SCRIPT_POSITION*), and pass it to S3BootScriptMoveLastOpcode() and S3BootScriptLabel(), respectively. The callees take the in/out parameter "Position" as (VOID**). Add explicit casts for clarity. There is no change in functionality. Cc: Dandan Bi <dandan.bi@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: stop abusing EFI_HANDLE for keystroke notify registrationLaszlo Ersek2019-10-092-3/+3
| | | | | | | | | | | | | | | | | | | | EFI_REGISTER_KEYSTROKE_NOTIFY and EFI_UNREGISTER_KEYSTROKE_NOTIFY require the notification handle to have type (VOID*). The notification handle has nothing to do with the EFI_HANDLE type. This change is a semantic fix; functionally, it's a no-op. Cc: Dandan Bi <dandan.bi@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: stop abusing EFI_EVENT for protocol notify registrationLaszlo Ersek2019-10-094-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | EfiCreateProtocolNotifyEvent() takes a (VOID**) for "Registration", similarly to gBS->RegisterProtocolNotify(). We should pass the address of an actual pointer-to-VOID, and not the address of an EFI_EVENT. EFI_EVENT just happens to be specified as (VOID*), and has nothing to do with the registration. The same applies to gMmst->MmRegisterProtocolNotify(). "mFtwRegistration", "mFvRegistration", and "mFvbRegistration" are used for nothing else. This change is a no-op in practice; it's a semantic improvement. Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
* MdeModulePkg/BdsDxe: Also call PlatformBootManagerWaitCallback on 0Pete Batard2019-10-081-0/+1
| | | | | | | | | | | | The existing loop is set to call PlatformBootManagerWaitCallback every second except the last one. We believe this is a mistake as it prevents the called code from performing timeout expiration tasks such as, for instance, ensuring that the last segment of a progress bar is displayed before continuing (which is a current issue for the RPi3 platform). Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* MdeModulePkg: strip trailing whitespaceLeif Lindholm2019-10-045-8/+8
| | | | | | | | | | | | 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 <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/TerminalDxe: Enhance the arrow keys supportGao, Zhichao2019-09-271-2/+6
| | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2219 First previous patch remove the VT100Plus's arrow keys' support. Add it back. The arrow keys would send ESC [A through to ESC [D. Add this support for the new introduced terminal type. 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: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* MdeModulePkg/PlatformDriOverride: Unload image on EFI_SECURITY_VIOLATIONDandan Bi2019-09-251-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | For the LoadImage() boot service, with EFI_SECURITY_VIOLATION retval, the Image was loaded and an ImageHandle was created with a valid EFI_LOADED_IMAGE_PROTOCOL, but the image can not be started right now. This follows UEFI Spec. But if the caller of LoadImage() doesn't have the option to defer the execution of an image, we can not treat EFI_SECURITY_VIOLATION like any other LoadImage() error, we should unload image for the EFI_SECURITY_VIOLATION to avoid resource leak. This patch is to do error handling for EFI_SECURITY_VIOLATION explicitly for the caller in PlatformDriOverrideDxe which don't have the policy to defer the execution of the image. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Philippe Mathieu-Daude <philmd@redhat.com> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1992 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
* MdeModulePkg/TerminalDxe: Extend the terminal console support typesZhichao Gao2019-09-245-26/+320
| | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2186 Extend the support types of terminal console driver. New added types are Linux, XtermR6, VT400 and SCO. Refer to https://www.ssh.com/ssh/putty/putty-manuals/0.68/Chapter4.html#config-funkeys Add the missing VT100+ function keys map. Add F1-F12 function keys map for Linux, XtermR6, VT400 and SCO. 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: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* MdeModulePkg SerialDxe.inf: Fix wrong FILE_GUID formatLiming Gao2019-09-171-1/+1
| | | | | | | | | Fix regression issue caused by 0d85e67714e31e0dbe4241ab2ebb7c423aba174d Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/SerialDxe: Update the file Guid in SerialDxe.infShenglei Zhang2019-09-171-1/+1
| | | | | | | | | | | | FILE GUID in MdeModulePkg\Universal\SerialDxe\SerialDxe.inf is same to the one gEdkiiSerialPortLibVendorGuid. Its FILE GUID should be updated to another value. https://bugzilla.tianocore.org/show_bug.cgi?id=2144 Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: Add missing header files in INF filesShenglei Zhang2019-08-133-2/+11
| | | | | | | | | | The header files are used but missing in INF,which causes generating warning message when building them. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/RegularExpressionDxe: Add two missing null pointer checksLiming Gao2019-08-131-0/+2
| | | | | | | | | | | After update Oniguruma from v6.9.0 to v6.9.3, two null pointer check should be added. This change bases on the patch https://edk2.groups.io/g/devel/message/45183. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg RegularExpressionDxe: Update Oniguruma from v6.9.0 to v6.9.3Liming Gao2019-08-1325-11282/+14041
| | | | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2066 Update Oniguruma to the latest version v6.9.3. Oniguruma https://github.com/kkos/oniguruma This release is the security fix release. It includes the changes: Fixed CVE-2019-13224 Fixed CVE-2019-13225 Fixed many problems (found by libfuzzer programs) Verify VS2015, GCC5 build. Verify RegularExpressionProtocol GetInfo() and Match() function. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Cinnamon Shia <cinnamon.shia@hpe.com> Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/EsrtFmpDxe: Enhance ESRT to support multiple controllersJin, Eric2019-08-071-137/+257
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525 The patch is to merge multiple FMP instances into single ESRT entry when they have the same GUID. The policy to LastAttemptStatus/LastAttemptVersion of ESRT entry is: If all the LastAttemptStatus are LAST_ATTEMPT_STATUS_SUCCESS, then LastAttemptVersion should be the smallest of LastAttemptVersion. If any of the LastAttemptStatus is not LAST_ATTEMPT_STATUS_SUCCESS, then the LastAttemptVersion/LastAttemptStatus should be the values of the first FMP instance whose LastAttemptStatus is not LAST_ATTEMPT_STATUS_SUCCESS. To detect possible duplicated GUID/HardwareInstance, a table of GUID/HardwareInstance pairs from all the EFI_FIRMWARE_IMAGE_DESCRIPTORs from all FMP instances is built. If a duplicate is found, then generate a DEBUG_ERROR message, generate an ASSERT(), and ignore the duplicate EFI_FIRMWARE_IMAGE_DESCRIPTOR. Add an internal worker function called FmpGetFirmwareImageDescriptor() that retrieves the list of EFI_FIRMWARE_IMAGE_DESCRIPTORs from a single FMP instance and returns the descriptors in an allocated buffer. This function is used to get the descriptors used to build the table of unique GUID/HardwareInstance pairs. It is then used again to generate the ESRT Table from all the EFI_FIRMWARE_IMAGE_DESCRIPTORs from all the FMP instances. 2 passes are performed so the total number of descriptors is known. This allows the correct sized buffers to always be allocated. Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Jian J Wang <jian.j.wang@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Eric Jin <eric.jin@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: Fix typos and add periodsShenglei Zhang2019-08-021-2/+2
| | | | | | | | | | | | 1.Update @parm to @param in function comments in Presentation.c. 2.Add missing period (.) in some function comments. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
* MdeModulePkg/Setup: Check ConfigAccess protocol in case it's destroyedGregX Yeh2019-07-101-0/+34
| | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1920 Check ConfigAccess protocol is available before process user input. Signed-off-by: GregX Yeh <gregx.yeh@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Ted Kuo <ted.kuo@intel.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
* MdeModulePkg SmbiosMeasurementDxe: Add Type4 Voltage field to blacklistStar Zeng2019-07-011-0/+1
| | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1922 The Type4 Voltage field may be various. So this patch adds it into the blacklist. Signed-off-by: Star Zeng <star.zeng@intel.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: Donald Kuo <donald.kuo@intel.com> Cc: Chasel Chiu <chasel.chiu@intel.com> Reviewed-by: Chasel Chiu <chasel.chiu@intel.com> Acked-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/BdsDxe: Use a pcd to control PlatformRecoveryZhichao Gao2019-07-012-25/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1678 Use the PcdPlatformRecoverySupport to control the function of platform recovery in BDS. First, set the variable's ("OsIndicationsSupported") EFI_OS_INDICATIONS_START_PLATFORM_RECOVERY bit base on the pcd. It would affect the variable "OsIndications". While the platform does not support the platform recovery, it is inappropriate to set a PlatformRecovery#### variable. So skip setting the variable. But it should remain the behavior of booting from a default file path (such as \EFI\BOOT\BOOTX64.EFI) to be compatible with the previous version UEFI spec. Add memory check before build platform default boot option. If fail to allocate memory for the defualt boot file path, put the system into dead loop to indicate it is unable to boot. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/CapsulePei: Add memory pointer checkGao, Zhichao2019-06-261-1/+5
| | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1935 Before use the memory that is allocated through AllocateZeroPool, we should check the memory pointer is valid to avoid using the NULL pointer. Add check for VariableArrayAddress that is returned from GetScatterGatherHeadEntries. If it is NULL, directly return the error status. 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: Star Zeng <star.zeng@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: Add CapsuleOnDiskLoadPei PEIM.Wei6 Xu2019-06-264-0/+530
| | | | | | | | | | | | | | | | REF: https://github.com/tianocore/tianocore.github.io/wiki/ UEFI-Capsule-on-Disk-Introducation This module provides PPI to load Capsule On Disk temp relocation file from Root Directory file system, retrieve the capsules from the temp file and create capsule hobs for these capsules. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Chao B Zhang <chao.b.zhang@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com> Acked-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.Wei6 Xu2019-06-262-1/+12
| | | | | | | | | | | | | | | | REF: https://github.com/tianocore/tianocore.github.io/wiki/ UEFI-Capsule-on-Disk-Introducation Introduce PcdCapsuleInRamSupport to turn on/off Capsule In Ram feature. Platform could choose to drop CapsulePei/CapsuleX64 and not to support Capsule In Ram. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Chao B Zhang <chao.b.zhang@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com> Acked-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/BdsDxe: Support Capsule On Disk.Wei6 Xu2019-06-262-2/+7
| | | | | | | | | | | | | | | | REF: https://github.com/tianocore/tianocore.github.io/wiki/ UEFI-Capsule-on-Disk-Introducation Set EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED bit of "OsIndicationsSupported" variable to indicate the Capsule On Disk is supported or not, according to PcdCapsuleOnDiskSupport. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Chao B Zhang <chao.b.zhang@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com> Acked-by: Hao A Wu <hao.a.wu@intel.com>
* MdeMoudlePkg/CapsulePei: No need to remain space for null-terminateZhichao Gao2019-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1853 UnicodeValueToStringS would remain two bytes for the first parameter to set the null- terminate. So remove this change in Mu. 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: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Zhichao gao <zhichao.gao@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeMoudlePkg/CapsulePei: Optimize GetScatterGatherHeadEntriesZhichao Gao2019-06-241-14/+37
| | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1853 Rename the MACRO from MAX_SG_LIST_HEADS to DEFAULT_SG_LIST_HEADS. GetScatterGatherHeadEntries: use allocated buffer instead of fixed array to handle the condition which the SG list is larger then the array size. 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: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Zhichao gao <zhichao.gao@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeMoudlePkg/CapsulePei: Optimize AreCapsulesStagedZhichao Gao2019-06-241-29/+13
| | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1853 AreCapsulesStaged do not need to return the status, only boolean result is useful. So directly return a boolean value. Cannot initialize the variable at its definition. 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: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Zhichao gao <zhichao.gao@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeMoudlePkg/CapsulePei: Fix coding style issueZhichao Gao2019-06-241-5/+3
| | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1853 Remove API specifier AreCapsulesStaged and GetScatterGatherHeadEntries because they are internal used. Add space between function name and bracket. 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: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Zhichao gao <zhichao.gao@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/CapsulePei: Optimize the CapsulePeiBret Barkelew2019-06-243-155/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1853 Code change form Mu project: https://github.com/microsoft/mu_basecore/blob/release/201903/ MdeModulePkg/Universal/CapsulePei/UefiCapsule.c#L801 Separate the capsule check function from GetCapsuleDescriptors to AreCapsulesStaged. The original one is unclear. Avoid querying the capsule variable twice. Use a fixed array to cache the SG list during count the number of SG list. Then allocate memory buffer to save the SG list from array. Using MemoryAllocationLib instead of memory function in Pei services. 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: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Zhichao gao <zhichao.gao@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* Revert "Capsule-on-Disk entire PatchZhang, Chao B2019-06-218-554/+3
| | | | | | | | | | | | | | | | This reverts commit 0d4aa276d1f6e0cb9d71a7fb88b30c416ba6d5a3, 6470a43160183cd48cad8901c912a48811f18b13, fd7286089542ee7a98cfea00be45ceb3561e0b20, 7837d1249807b4248079699097bc993254235d7a, 6b32af2e105f9b5454a55b581f2dc365c5eb6397, 8636f70b5a763ed1c03b292708f9c5543e531ea9, f17935321a5b818a66e999632ef371b374b98f0c due to incorrect review process. Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Zhang, Chao B <chao.b.zhang@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: Add CapsuleOnDiskLoadPei PEIM.Wei6 Xu2019-06-204-0/+535
| | | | | | | | | | | | | | | | https://github.com/tianocore/tianocore.github.io/wiki/UEFI-Capsule- on-Disk-Introducation This module provides PPI to load Capsule On Disk temp relocation file from Root Directory file system, retrieve the capsules from the temp file and create capsule hobs for these capsules. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Chao B Zhang <chao.b.zhang@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
* MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.Wei6 Xu2019-06-202-1/+12
| | | | | | | | | | | | | | | | https://github.com/tianocore/tianocore.github.io/wiki/UEFI-Capsule- on-Disk-Introducation Introduce PcdCapsuleInRamSupport to turn on/off Capsule In Ram feature. Platform could choose to drop CapsulePei/CapsuleX64 and not to support Capsule In Ram. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Chao B Zhang <chao.b.zhang@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
* MdeModulePkg/BdsDxe: Support Capsule On Disk.Wei6 Xu2019-06-202-2/+7
| | | | | | | | | | | | | | | | https://github.com/tianocore/tianocore.github.io/wiki/UEFI-Capsule- on-Disk-Introducation Set EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED bit of "OsIndicationsSupported" variable to indicate the Capsule On Disk is supported or not, according to PcdCapsuleOnDiskSupport. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Chao B Zhang <chao.b.zhang@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
* MdeModulePkg: Introduce EDKII_SERIAL_PORT_LIB_VENDOR_GUIDAnthony PERARD2019-06-142-1/+3
| | | | | | | | | | | | | | | SERIAL_DXE_FILE_GUID is used in different places, create a single define that other can use. Also fix SerialDxe to actually use EDKII_SERIAL_PORT_LIB_VENDOR_GUID in the device path instead of the FILE_GUID. Suggested-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Message-Id: <20190606131459.1464-2-anthony.perard@citrix.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* MdeModulePkg/GraphicsConsoleDxe: Initialize the output modeZhichao Gao2019-06-132-10/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1412 Original logic: Connect the graphics device -> connect it as graphics consoles and initialize its parameters(Mode = -1, invalid) -> connect it as console spliter and add the device to the list(use SetMode to set mode to the user defined mode or the best mode the devices supported if the mode is invalid. *clear the screen at this phase*) Changed logic: Connect the graphics device -> connect it as graphics consoles and initialize its parameters(initialize the mode to the user defined mode or the best mode. *directly set the mode value without using SetMode, that would not clear the screen) -> connect it as console spliter and add the device to the list(use SetMode to set mode to the user defined mode or the best mode the devices supported if the mode is invalid. *now the mode is already set, so it would not clear the screen*). Also remove the section of SetMode for debug version. Impact: as the text mode may not be an invalid value, the SetMode may have no chance to be called during reconnect the graphics device. That means the screen may not be cleaned after finishing reconnect operation. There is one common condition: shell command "recoonect -r". Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/ConSplitterDxe: Optimize the ConSplitterTextOutSetModeAaron Antone2019-06-132-12/+25
| | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1412 For Console Out device, it would always set all present devices' text out mode again through ConSplitterTextOutSetMode while adding devices. That may cause the screen cleared for serval times. So add a BOOLEAN to judge if it is adding device then we will not set the same text mode again for same console out device. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkgLiming Gao2019-05-27124-52538/+0
| | | | | | | | Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
* MdeModulePkg: Remove BootInRecoveryMode PPIxuwei62019-05-091-1/+1
| | | | | | | | | | | | | | | | | | DEPEX from PEI storage stack. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1777 BootInRecoveryMode Ppi dependency should be removed from PEI storage stack drivers. Besides recovery, more features are using the storage stack. Platform can apply Ppi dependency in Recovery FV which contains full storage driver stack. Platform storage stack modules, such as host controller init PEI module, should also remove this dependency. Cc: Ray Ni <ray.ni@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
* MdeModulePkg/Setup: Remove PcdFrameworkCompatibilitySupport usageDandan Bi2019-05-092-90/+2
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1464 Currently Framework compatibility support is not needed and PcdFrameworkCompatibilitySupport will be removed from edk2. So remove the usage of this PCD firstly. Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
* MdeModulePkg/CdExpress: Remove PcdFrameworkCompatibilitySupport usageDandan Bi2019-05-092-13/+2
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1464 Currently Framework compatibility is not needed and PcdFrameworkCompatibilitySupport will be removed from edk2. So remove the usage of this PCD firstly. Cc: Hao Wu <hao.a.wu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* MdeModulePkg/StatusCodeHandlerRuntimeDxe: make global variable staticZhichao Gao2019-04-281-2/+2
| | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1740 Add a 'static' storage-class specifier to the global variables that only used in a single file to minimize the name collisions. This is only for the variable named 'mExitBootServicesEvent'. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/FirmwarePerformanceDxe: make global variable staticZhichao Gao2019-04-281-2/+2
| | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1740 Add a 'static' storage-class specifier to the global variables that only used in a single file to minimize the name collisions. This is only for the variable named 'mExitBootServicesEvent'. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/ResetSystemPei: Change comments of ResetSystem2Zhichao Gao2019-04-282-9/+3
| | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1460 Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific or not. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* MdeModulePkg/ResetSystemRuntimeDxe: Change commentsZhichao Gao2019-04-282-8/+2
| | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1460 Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific or not. So change the comments of RuntimeServiceResetSystem. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* MdeModulePkg/HiiDB: Minimize memory allocation times after ReadyToBootDandan Bi2019-04-281-7/+17
| | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1597 Currently RTData are allocated at/after ReadyToBoot to store the contents in HiiDatabase and the HII configurations for OS runtime utilization. Some platforms may meet S4 resume issue since the allocation after ReadyToBoot cause memory map change. Now this patch is to do some overallocation to minimize the number of memory allocations after ReadyToBoot and also add warning message when do allocation after ReadyToBoot. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
* MdeModulePkg/HiiDatabaseDxe: Release lock on all error return pathDandan Bi2019-04-241-1/+6
| | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1652 Commit ffe5f7a6b4e9 "MdeModulePkg/HiiDatabase: Fix potential integer overflow " added some new error paths, but it missed releasing the mHiiDatabaseLock lock on those paths. This patch releases mHiiDatabaseLock on those paths. Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> (cherry picked from commit 927c516f9557f2f36319fe5d2508af29e3375fb8)
* MdeModulePkg/CapsulePei: Update the debug code to print 64bit dataBret Barkelew2019-04-161-9/+9
| | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1677 For some pointer and UINT64 data, the debug code print with '%x'. Which would loss the upper 32bit data. So update '%x' to '%lx' for these data. And change the pointer value from '%x' to '%p'. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* MdeModulePkg/CapsulePei: Change debug MACROZhichao Gao2019-04-162-68/+68
| | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1677 Change debug printlevel from EFI_D_ to DEBUG_. DEBUG_ version is recommanded to use. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* MdeModulePkg/EbcDxe: implement the PE/COFF emulator protocolArd Biesheuvel2019-04-144-4/+126
| | | | | | | | | | Implement the new EDK2 PE/COFF image emulator protocol so that we can remove the EBC specific handling in the DXE core and other places in the core code. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* MdeModulePkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-09656-4566/+656
| | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg: Add a PEIM to install Debug PPIZhichao Gao2019-04-024-0/+227
| | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1549 Add a PEIM to install Debug PPI so that PEI debug library instance can locate gEdkiiDebugPpiGuid to implement the debug functions. Using this PPI can reduce the size of PEIMs which consume the debug library. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/ResetSystemRuntimeDxe: Remove DoS3 in warm resetBret Barkelew2019-04-021-38/+0
| | | | | | | | | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1462 Original logic is that checking the CapsuleUpdate variable and do the EnterS3WithImmediateWake if the system require a capsule update. The EnterS3WithImmediateWake is usually implemented in Platform ResetSystemLib instance and it may do some operation for capsule update. For now, thess preparations of capsule are platform reset notify functions' duty. Most platforms need flush cache to memory before warm reset during capsule update and this operation is added to capsule flow. So it is safe to remove it and do not affect the capsule update function. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>