summaryrefslogtreecommitdiff
path: root/Core/MdeModulePkg
AgeCommit message (Collapse)Author
2018-04-25Remove Core PackageGuo Mang
Remove Core Package since we will use EDK2 code from edk2 repository: https://github.com/tianocore/edk2 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Guo Mang <mang.guo@intel.com>
2017-07-12MdeModulePkg/BMMUiLib: Fix incorrect variable nameDandan Bi
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=592 In function UpdateConsoleContent, we compare console name with "ErrOut" string to check whether the content in console Error device page has been changed. But when call function UpdateConsoleContent, we pass console name as "ConErr" by mistake. This patch is to fix the inconsistent issue. Cc: Eric Dong <eric.dong@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> (cherry picked from commit 983f59932db28ae37b9f9e545c1258bc59aa71ca)
2017-07-12MdeModulePkg/Xhci: Correct the indention of commentsRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit b0b626ea2f16faca9f864599384fd184a89e0195)
2017-07-12MdeModulePkg/Xhci: Remove TRB when canceling Async Int TransferRuiyu Ni
Some USB devices don't report data periodically through Int Transfer. They report data only when be asked. If the TRB is not removed from the XHCI HW, when next time HOST asks data again, the data is reported but consumed by the previous TRB, which results the HOST thinks data never comes. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit b33b1055b0026f36be97fb5ec6826436088e9a23)
2017-07-12MdeModulePkg/MnpDxe: Fix EBC build hang issue.Fu Siyuan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> (cherry picked from commit 54d7177c78dc35919a631c8baa533d287bf0ae57)
2017-07-12MdeModulePkg/UsbBus: Correct debug messageRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit 76d1c752cb6629262bb999204f574e274be00500)
2017-07-12MdeModulePkg/UsbBus: Fix system hang when failed to uninstall UsbIoRuiyu Ni
When "reconnect -r" is typed in shell, UsbFreeInterface() is called to uninstall the UsbIo and DevicePath. But When a UsbIo is opened by a driver and that driver rejects to close the UsbIo in Stop(), the uninstall doesn't succeed. But UsbFreeInterface () frees the DevicePath memory without check whether the uninstall succeeds. It leads to the DXE core database contain a DevicePath instance but that instance's memory is freed. Assertion happens when someone calls InstallProtocol(DevicePath) because the InstallProtocol() checks all DevicePath instance to find whether the same one exits in database. We haven't seen any USB device driver which rejects to close UsbIo in Stop(), but it's very likely. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> (cherry picked from commit b659b503fa7c43677ccab40d311dbab33366ee97)
2017-07-12MdeModulePkg/LogoDxe: Return error if HII Package not presentMichael Kinney
https://bugzilla.tianocore.org/show_bug.cgi?id=554 Update LogoDxe module to print a DEBUG() message and exit with an error instead of ASSERT_EFI_ERROR() if the HII Image Package with the logo image is not present. If a tool chain does not support generation of PE/COFF resource sections, then this module can not produce the logo from an HII Image Package. XCODE5 is an example of a tool chain that does not currently support generation of PE/COFF resource sections. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Andrew Fish <afish@apple.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit 1c020add31d9ba5f556d97bad174e80d7325d973)
2017-07-12MdeModulePkg SmiHandlerProfile: Use fixed data type in data structureStar Zeng
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=568 Use fixed data type in data structure and make the structure be natural aligned. Without this update, the code must assume DXE and SMM are using same data type (same size of UINTN), but it may be not true at some case, for example, after standalone SMM feature is enabled. With this update, the data structure will be phase independent and convenient for consumer to parse the data. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> (cherry picked from commit f248539538efd522a71c1e9bf63c622e02d443f4)
2017-07-12MdeModulePkg SmiHandlerProfile: Fix no PDB case handling incorrectlyStar Zeng
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=569 The PdbStringOffset should be set to 0 for no PDB case, then SmiHandlerProfileInfo can use it to know whether there is PCD info or not. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> (cherry picked from commit 8ced192d5cf1e8ccd56fa5daed2c2ca28fb04cff)
2017-07-12MdeModulePkg/BDS: Fix a buffer overflow bugRuiyu Ni
KeyOption points to a buffer holding the content of Key####. So its size is smaller than EFI_BOOT_MANAGER_KEY_OPTION. Old code to assign value to KeyOption->OptionNumber modifies the memory outside of the KeyOption buffer. The patch fixes this bug. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Steven Shi <steven.shi@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> (cherry picked from commit 7320b8ed1879b31657a8d6a62e6cd0ff1f645754)
2017-07-12MdeModulePkg PCD: Fix TmpTokenSpaceBufferCount not assigned correctlyStar Zeng
When DynamicEx PCD is only used in PEI code, but not DXE code, current implementation of DxePcdGetNextTokenSpace does not assign TmpTokenSpaceBufferCount correctly, but leaves it as initial value, then DxePcdGetNextTokenSpace may return incorrect token space guid and status. This patch is to fix this issue. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> (cherry picked from commit da0df6ca8f8f118866e53c7fb770598c199993a6)
2017-07-12MdeModulePkg/UfsPassThruDxe: Fix typo in UfsPassThruGetTargetLun()Hao Wu
For function UfsPassThruGetTargetLun(), the length of the input device node specified by 'DevicePath' should be compared with the size of 'UFS_DEVICE_PATH' rather than the size of 'SCSI_DEVICE_PATH'. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit a8321feebb6af978478e0da559806602bd2dcc7d)
2017-07-12MdeModulePkg SmiHandlerProfile: Fix memory leak in DumpSmiChildContextStar Zeng
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=530 In DumpSmiChildContext() of SmiHandlerProfile.c and SmiHandlerProfileInfo.c, the return buffer from ConvertDevicePathToText() should be freed after used. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> (cherry picked from commit fb1c81a1e5d299c0cb0783cbfe7e727202c2c471)
2017-07-12MdeModulePkg CapsuleApp: Fix mixed EOL format issueStar Zeng
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit 8ecb1e9befbf9a049f74486274288c1bc677ebf3)
2017-07-12MdeModulePkg/FormDisplay: Make the LineWidth of option consistentDandan Bi
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=529 LineWidth of option in funcrion UpdateSkipInfoForMenu and DisplayOneMenu are inconsistent. Now fix this issue to avoid incorrect UI display. Cc: Eric Dong <eric.dong@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> (cherry picked from commit df5914993c9d4db87e4132bcc3b88efb48db5c6e)
2017-07-12MdeModulePkg: Addressing TCP Window Retraction when window scale factor is used.Fu Siyuan
The RFC1323 which defines the TCP window scale option has been obsoleted by RFC7323. This patch is to follow the RFC7323 to address the TCP window retraction problem when a non-zero scale factor is used. The changes has been test in high packet loss rate network by using HTTP boot and iSCSI file read/write. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> (cherry picked from commit ca12a0c83b7b889fc807cb2dd47356f0fd1253d6)
2017-07-12MdeModulePkg: Add wnd scale check before shrinking window.Fu Siyuan
Moving Right window edge to the left on sender side without additional check can lead to the TCP deadlock, when receiver ACKs proper segment, while sender discards it for future ACK. To prevent this add check if usable window (or shrink amount in this case) is bigger then receiver's window scale factor. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Andrey Tepin <atepin@kraftway.ru> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> (cherry picked from commit 207b3d2b0b7db33bd65e1943a66d7ee9b7132697)
2017-07-12MdeModulePkg: Update DEC/DSC version from 0.96 to 0.97Tian, Feng
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit 717ba86de74f2970d57ac68616a5a8e86cf4770f)
2017-07-12MdeModulePkg: Fix issue the iSCSI client can not send reset packet correctly.Zhang, Lubo
if we already established a iSCSI connection from initiator to target based on IPv4 stack, after using reconnect -r command, we can not rebuild the session with the windows target, since the server thought the session is still exist. This issue is caused by wrong place of acquire ownership of sock lock which lead the iSCSI can not reset the connection correctly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> (cherry picked from commit e3793f9834fe9dcec6fda53fbe8df76d32c6f2fa)
2017-07-12MdeModulePkg/Ip4Dxe: Fix the incorrect RemoveEntryListJiaxin Wu
Cc: Subramanian Sriram <sriram-s@hpe.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> (cherry picked from commit ad18ec95437e6947ba4190f2b281659999db880b)
2017-07-12MdeModulePKg/BDS: Build meaningful description for Wi-Fi boot optionRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Fan Wang <fan.wang@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> (cherry picked from commit 6bbd4a8f5f2a538e5017045ab75674ec106f7b54)
2017-07-12MdeModulePkg/Ip4Dxe: Refine the IPv4 configuration help infoJiaxin Wu
Below value indicate whether network address configured successfully or not: Network Device List->MAC->IPv4 Network Configuration->Configured. This patch is to refine its help info. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> (cherry picked from commit d7dd4f0a0678c458005ea40acba70984c58bcb20)
2017-07-12MdeModulePkg: Update PiSmmCore to set correct ImageAddress into LoadedImageLiming Gao
Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit d5a67b3da18f815c83593d9329a353ec3a739d66)
2017-07-12MdeModulePkg PiSmmIpl: Fix the issue in LMFA featureLiming Gao
SmramBase should be got from mLMFAConfigurationTable. Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit c2aeb66fff90e7326d095aed0876d1f67f94f75e)
2017-07-12MdeModulePkg/UfsPciHc: Avoid overriding return value in BindingStartHao Wu
In function UfsHcDriverBindingStart(), the return value 'Status' may be overridden during the original PCI attributes restore process. This commit refines the logic to avoid such override. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit 1a5ae661754625b8f4bba39214006e87216747e9)
2017-07-12MdeModulePkg/UfsPciHc: Remove unused field in UfsHc private structHao Wu
The commit removes the unused field 'EFI_HANDLE Handle' in Ufs host controller private data structure 'UFS_HOST_CONTROLLER_PRIVATE_DATA'. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit c36ea72ebd4c0fd2c73f881d4708fa623c20c320)
2017-07-12MdeModulePkg/NvmExpressDxe: Handling return of write to sq and cq dbSuman Prakash
In case of an async command if updating the submission queue tail doorbell fails then the command will not be picked up by device and no completion response will be created. This scenario has to be handled. Also if we create an AsyncRequest element and insert in the async queue, it will never receive a completion so in the timer routine this element won't be freed, resulting in memory leak. Also in case of blocking calls we should capture the status of updating completion queue head doorbell register and return it to caller of PassThru. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Suman Prakash <suman.p@samsung.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> (cherry picked from commit f6b139bde7e0a39f83ffad30af58136d5b0738a7)
2017-07-12MdeModulePkg: Discard received broadcast message in DxeIpIoLib.Fu Siyuan
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> (cherry picked from commit dd29d8b3565ba8ae2e71c097a95b22af5d1d90a4)
2017-07-12MdeModulePkg/PiSmmCore: Remove redundant PoolTail pointer assignmentHao Wu
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit f8f931f632f7d7ff12a1cfdec36ebefe19085e83)
2017-07-12MdeModulePkg/DeviceManagerUiLib: Fix the network device MAC display issueJiaxin Wu
v3: * Add NULL string check. v2: * Define new STR_FORM_NETWORK_DEVICE_TITLE_HEAD for L" Network Device " instead of hard code in the code. Network device tile (STR_FORM_NETWORK_DEVICE_TITLE) is dynamic adjusted according the different MAC value. So, the string value shouldn't be treated as a constant string (Network Device). Otherwise, the display will be incorrect. Reproduce: Device Manager->Network Device List, select to enter MAC, then to press ESC back to previous page, then re-enter, found each enter/ESC operation, the MAC address display +1. Cc: Eric Dong <eric.dong@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> (cherry picked from commit 205a4b0c15372c004a947b6873f711805415f542)
2017-07-12MdeModulePkg/Mtftp4Dxe: Add invalid ServerIp check during MTFTP configurationJiaxin Wu
Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> (cherry picked from commit 17b25f520302f813a50f7876edc2e8fc901e7a7c)
2017-07-12MdeModulePkg/FirmwarePerformanceDxe: Error Level is not used correctlyJeff Fan
Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit d3d562b90419596a1c7dec75d1b49a89b968ead1)
2017-07-12MdeModulePkg/UefiBootManagerLib: Avoid buggy USB short-form expandingRuiyu Ni
When a load option points to a physical UsbIo controller, whose device path contains UsbClass or UsbWwid node, old logic unconditionally treats it as a short-form device path and expands it. But the expanding gets the exactly same device path, and the device path is passed to BmGetNextLoadOptionDevicePath() which then passes this device path to BmExpandUsbDevicePath() again. This causes a infinite recursion. The patch avoids the USB short-form expanding when the device path points to a physical UsbIo controller. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Feng Tian <feng.tian@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Michael Turner <Michael.Turner@microsoft.com> (cherry picked from commit 21e359dccab7f3cd7b527721be042d034349417d)
2017-07-12MdeModulePkg PiSmmCore: Enhance SMM FreePool to catch buffer overflowStar Zeng
This solution is equivalent to DXE core. AllocatePool() allocates POOL_TAIL after the buffer. This POOL_TAIL is checked at FreePool(). If the there is buffer overflow, the issue can be caught at FreePool(). This patch could also handle the eight-byte aligned allocation requirement. The discussion related to the eight-byte aligned allocation requirement is at https://lists.01.org/pipermail/edk2-devel/2017-April/009995.html. According to the PI spec (Vol 4, Section 3.2 SmmAllocatePool()): The SmmAllocatePool() function ... All allocations are eight-byte aligned. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> (cherry picked from commit 861c8dff2f506d602f8612ace12d244c29e63f31)
2017-07-12MdeModulePkg/Ufs: Wait fDeviceInit be cleared by devices during initHao Wu
In the origin codes, the host sets the fDeviceInit flag to initiate device initialization, but does not check whether the device resets this flag to indicate the device initialization is completed. Details can be referred at UFS 2.0 Spec Section 14.2 - Flags. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Mateusz Albecki <mateusz.albecki@intel.com> Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> (cherry picked from commit 95ad8f7f6a6c84ef46a96a8ba852afed805d1ca3)
2017-07-12MdeModulePkg/UfsPassThruDxe: Replace 'EFI_D_XXX' with 'DEBUG_XXX'Hao Wu
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> (cherry picked from commit edd94e74c81bc416403b7f19ca80730387ddd4c1)
2017-07-12MdeModulePkg/TerminalDxe: Avoid always append device path to *DevRuiyu Ni
When TerminalDxe Start() is called multiple times, the old logic unconditionally appended the terminal device path candidates to *Dev (ConInDev/ConOutDev/ErrOutDev), resulting the volatile storage is full. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit b9c04b88a148d6a4d618e176c9a35d9b15ce9954)
2017-07-12MdeModulePkg DxeCore: Fix issue to print GUID value %g without pointerLiming Gao
https://bugzilla.tianocore.org/show_bug.cgi?id=474 Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit e06179889586c37101e2900e7f52be9f0da12cda)
2017-07-12MdeModulePkg/HiiDB: Avoid incorrect results of multiplicationDandan Bi
An example: The codes in function Output8bitPixel in Image.c: OffsetY = BITMAP_LEN_8_BIT ((UINT32) Image->Width, Ypos); Both Image->Width and Ypos are of type UINT16. They will be promoted to int (signed) first, and then perform the multiplication defined by macro BITMAP_LEN_8_BIT. If the result of multiplication between Image->Width and Ypos exceeds the range of type int, a potential incorrect results will be assigned to OffsetY. This commit adds explicit UINT32 type cast for 'Image->Width' to avoid possible overflow in the int range. And also fix similar issues in HiiDatabase. Cc: Eric Dong <eric.dong@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> (cherry picked from commit f76bc44362e5f0a2ea509c07b2f6846bd9833ee8)
2017-07-12MdeModulePkg/BMMUiLib: Update codes of initializing ConsoleXXXCheck arrayDandan Bi
When initializing ConsoleOutCheck/ConsoleInCheck/ConsoleErrCheck array in BMM_FAKE_NV_DATA structure, also need to consider whether the terminal device is ConOut/ConIn/ConErr or not. Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> (cherry picked from commit d508fe87fe73f1e99c5e71ff2aa49459cbe68d2f)
2017-07-12MdeModulePkg/BootManagerMenu: Add assertion to indicate no DIV by 0Ruiyu Ni
BootMenuSelectItem() contains code to DIV BootMenuData->ItemCount. When BootMenuData->ItemCount can be 0, the DIV operation may trigger CPU exception. But in logic, this case won't happen. So add assertion to indicate it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> (cherry picked from commit 51a1db9b24d850c785d240da599c4bf9ba1c0fd3)
2017-07-12MdeModulePkg CapsuleApp: Add directory supportStar Zeng
Current CapsuleApp only supports input/output file from rootdirectory. If the CapsuleApp and related file are put into subdirectory, below message will be shown when running the CapsuleApp in shell. "CapsuleApp: capsule image (Capsule image file name) is not found." This patch is to add directory support for CapsuleApp by using shell protocol. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> (cherry picked from commit 8b17683a27cfef7e70008dfccbc17a358ae33df1)
2017-07-12MdeModulePkg/DxeCore: Add ASSERT to ensure no subtract underflowHao Wu
For function SplitRecord() in file PropertiesTable.c, there is a potential subtract underflow case for line: return TotalNewRecordCount - 1; However, such case will not happen since the logic in function SplitTable() ensure that when calling SplitRecord(), the variable 'TotalNewRecordCount' will not be zero when performing the subtraction. It will be handled in the previous if statement: if (MaxSplitRecordCount == 0) { CopyMem (NewRecord, OldRecord, DescriptorSize); return 0; } Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> (cherry picked from commit 1860cb00c18c6f0c58336ea15a63889dabd31d15)
2017-07-12MdeModulePkg/PiSmmCore: Fix potentially uninitialized local variableHao Wu
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> (cherry picked from commit 89558f1653e1820f0f824d3299122100b0a6d82c)
2017-04-27MdeModulePkg: Move to new locationGuo Mang
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Guo Mang <mang.guo@intel.com>