summaryrefslogtreecommitdiff
path: root/Core
AgeCommit message (Collapse)Author
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-12NetworkPkg: 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 2d5afbdad1bbe2663917c0b3ad06753bbf128c6c)
2017-07-12UefiCpuPkg/MtrrLib: Don't report OutOfResource when MTRR is enoughRuiyu Ni
The MTRR calculation algorithm contains a bug that when left subtraction cannot produce better MTRR solution, it forgets to restore the BaseAddress/Length so that MtrrLibGetMtrrNumber() returns bigger value of actual required MTRR numbers. As a result, the MtrrLib reports OutOfResource but actually the MTRR is enough. MEMORY_RANGE mC[] = { 0, 0x100000, CacheUncacheable, 0x100000, 0x89F00000, CacheWriteBack, 0x8A000000, 0x75000000, CacheUncacheable, 0xFF000000, 0x01000000, CacheWriteProtected, 0x100000000, 0x7F00000000, CacheUncacheable, 0xFC240000, 0x2000, CacheWriteCombining // <-- trigger the error }; Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> (cherry picked from commit 3654c4623c9b37ddc64426995fa399d8626b7ced)
2017-07-12UefiCpuPkg: Update package version to 0.80Jeff Fan
Cc: Feng Tian <feng.tian@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> (cherry picked from commit 007b51e180d2202637dfc6d2afbe8a34704c423f)
2017-07-12UefiCpuPkg: Update package version to 0.80Jeff Fan
Cc: Feng Tian <feng.tian@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> (cherry picked from commit 93041972617af5f538fac8291e7a57b7766c6e10)
2017-07-12MdePkg DxeServicesLib: Handle potential NULL FvHandleStar Zeng
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=514 The FvHandle input to InternalGetSectionFromFv() may be NULL, then ASSERT will appear. It is because the LoadedImage->DeviceHandle returned from InternalImageHandleToFvHandle() may be NULL. For example for DxeCore, there is LoadedImage protocol installed for it, but the LoadedImage->DeviceHandle could not be initialized before the FV2 (contain DxeCore) protocol is installed. This patch is to update InternalGetSectionFromFv() to return EFI_NOT_FOUND directly for NULL FvHandle. Cc: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Michael Turner <Michael.Turner@microsoft.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 d7b96017ccf5922b798f496fbcdcac4067d04c6d)
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-12SecurityPkg/Pkcs7VerifyDxe: Add format check in DB list contentsLong Qin
Add the size check for invalid format detection in AllowedDb, RevokedDb and TimeStampDb list contents. Cc: Chao Zhang <chao.b.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qin Long <qin.long@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com> (cherry picked from commit 76b35710b955fbba087d7e2c9029e2d78dbd0e7b)
2017-07-12SecurityPkg: Update package version to 0.97Zhang, Chao B
Update package version of SecurityPkg to 0.97. Cc: Qin Long <qin.long@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Qin Long <qin.long@intel.com> (cherry picked from commit de8e4dc4dfc228def7e270d43db6d0eff0cff1d4)
2017-07-12NetworkPkg: Update package version to 0.97.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> (cherry picked from commit 9ee3283bfb466c44afa5692591445cd377f08377)
2017-07-12CryptoPkg: Update package version to 0.97Long Qin
Update package version of CryptoPkg to 0.97. Cc: Ting Ye <ting.ye@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qin Long <qin.long@intel.com> Reviewed-by: Ting Ye <ting.ye@intel.com> (cherry picked from commit b5a9dc8beb659a016eb2eaae3e596b04ed9a753f)
2017-07-12MdePkg: Update DEC and DSC version from 1.06 to 1.07Liming Gao
UEFI2.6 have been added in MdePkg. Update DEC and DSC version to reflect those changes in MdePkg. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> (cherry picked from commit 908a47c5f657ced2fe7ae0b190baa09b06ecef5b)
2017-07-12ShellPkg: Update package version to 1.01Ruiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit cc432448426cb63b3948703da873d22debc69e79)
2017-07-12ShellPkg/UefiHandleParsingLib: Fix memory leakRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Signed-off-by: Chen A Chen <chen.a.chen@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 00324f3fce83b8d813ca3ec6b6eb663a88a8675e)
2017-07-12ShellPkg/Shell: eliminate double-free in RunSplitCommand()Laszlo Ersek
Commit bd3fc8133b2b ("ShellPkg/App: Fix memory leak and save resources.", 2016-05-20) added a FreePool() call for Split->SplitStdIn, near end of the RunSplitCommand(), right after the same shell file was closed with CloseFile(). The argument was: > 1) RunSplitCommand() allocates the initial SplitStdOut via > CreateFileInterfaceMem(). Free SplitStdIn after the swap to fix > the memory leak. There is no memory leak actually, and the FreePool() call in question constitutes a double-free: (a) This is how the handle is established: ConvertEfiFileProtocolToShellHandle ( CreateFileInterfaceMem (Unicode), NULL ); CreateFileInterfaceMem() allocates an EFI_FILE_PROTOCOL_MEM object and populates it fully. ConvertEfiFileProtocolToShellHandle() allocates some administrative structures and links the EFI_FILE_PROTOCOL_MEM object into "mFileHandleList". (b) EFI_SHELL_PROTOCOL.CloseFile() is required to close the SHELL_FILE_HANDLE and to release all associated data. Accordingly, near the end of RunSplitCommand(), we have: EfiShellClose() ShellFileHandleRemove() // // undoes the effects of ConvertEfiFileProtocolToShellHandle() // ConvertShellHandleToEfiFileProtocol() // // note that this does not adjust the pointer value; it's a pure // type cast // FileHandleClose() FileInterfaceMemClose() // // tears down EFI_FILE_PROTOCOL_MEM completely, undoing the // effects of CreateFileInterfaceMem () // The FreePool() call added by bd3fc8133b2b conflicts with SHELL_FREE_NON_NULL(This); in FileInterfaceMemClose(), so remove it. This error can be reproduced for example with: > Shell> map | more > 'more' is not recognized as an internal or external command, operable > program, or script file. which triggers: > ASSERT MdeModulePkg/Core/Dxe/Mem/Pool.c(624): CR has Bad Signature with the following stack dump: > #0 0x000000007f6dc094 in CpuDeadLoop () at > MdePkg/Library/BaseLib/CpuDeadLoop.c:37 > #1 0x000000007f6dd1b4 in DebugAssert (FileName=0x7f6ed9f0 > "MdeModulePkg/Core/Dxe/Mem/Pool.c", LineNumber=624, > Description=0x7f6ed9d8 "CR has Bad Signature") at > OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c:153 > #2 0x000000007f6d075d in CoreFreePoolI (Buffer=0x7e232c98, > PoolType=0x7f6bc1c4) at MdeModulePkg/Core/Dxe/Mem/Pool.c:624 > #3 0x000000007f6d060e in CoreInternalFreePool (Buffer=0x7e232c98, > PoolType=0x7f6bc1c4) at MdeModulePkg/Core/Dxe/Mem/Pool.c:529 > #4 0x000000007f6d0648 in CoreFreePool (Buffer=0x7e232c98) at > MdeModulePkg/Core/Dxe/Mem/Pool.c:552 > #5 0x000000007d49fbf8 in FreePool (Buffer=0x7e232c98) at > MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:818 > #6 0x000000007d4875c3 in RunSplitCommand (CmdLine=0x7d898398, > StdIn=0x0, StdOut=0x0) at ShellPkg/Application/Shell/Shell.c:1813 > #7 0x000000007d487d59 in ProcessNewSplitCommandLine > (CmdLine=0x7d898398) at ShellPkg/Application/Shell/Shell.c:2121 > #8 0x000000007d488937 in RunShellCommand (CmdLine=0x7e233018, > CommandStatus=0x0) at ShellPkg/Application/Shell/Shell.c:2670 > #9 0x000000007d488b0b in RunCommand (CmdLine=0x7e233018) at > ShellPkg/Application/Shell/Shell.c:2732 > #10 0x000000007d4867c8 in DoShellPrompt () at > ShellPkg/Application/Shell/Shell.c:1349 > #11 0x000000007d48524d in UefiMain (ImageHandle=0x7e24c898, > SystemTable=0x7f5b6018) at ShellPkg/Application/Shell/Shell.c:631 Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Marvin Häuser <Marvin.Haeuser@outlook.com> Cc: Qiu Shumin <shumin.qiu@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Fixes: bd3fc8133b2b17ad2e0427d1bf6b44b08cf2f3b2 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Marvin Häuser <Marvin.Haeuser@outlook.com> (cherry picked from commit 227fe49d5d4fe6513fc09766f1c9f3ff330ea845)
2017-07-12ShellPkg/Shell: clean up bogus member types in SPLIT_LISTLaszlo Ersek
The "SPLIT_LIST.SplitStdOut" and "SPLIT_LIST.SplitStdIn" members currently have type (SHELL_FILE_HANDLE *). This is wrong; SHELL_FILE_HANDLE is already a pointer, there's no need to store a pointer to a pointer. The error is obvious if we check where and how these members are used: - In the RunSplitCommand() function, these members are used (populated) extensively; this function has to be updated in sync. ConvertEfiFileProtocolToShellHandle() already returns the temporary memory file created with CreateFileInterfaceMem() as SHELL_FILE_HANDLE, not as (SHELL_FILE_HANDLE *). - In particular, the ConvertShellHandleToEfiFileProtocol() calls need to be dropped as well in RunSplitCommand(), since EFI_SHELL_PROTOCOL.SetFilePosition() and EFI_SHELL_PROTOCOL.CloseFile() take SHELL_FILE_HANDLE parameters, not (EFI_FILE_PROTOCOL *). Given that ConvertShellHandleToEfiFileProtocol() only performs a type-cast (it does not adjust any pointer values), *and* SHELL_FILE_HANDLE -- taken by EFI_SHELL_PROTOCOL member functions -- is actually a typedef to (VOID *) -- see more on this later --, this conversion error hasn't been caught by compilers. - In the ProcessNewSplitCommandLine() function, RunSplitCommand() is called either initially (passing in NULL / NULL; no update needed), or recursively (passing in Split->SplitStdIn / Split->SplitStdOut; again no update is necessary beyond the RunSplitCommand() modification above). - In the UpdateStdInStdOutStdErr() and RestoreStdInStdOutStdErr() functions, said structure members are compared and assigned to "EFI_SHELL_PARAMETERS_PROTOCOL.StdIn" and "EFI_SHELL_PARAMETERS_PROTOCOL.StdOut", both of which have type SHELL_FILE_HANDLE, *not* (SHELL_FILE_HANDLE *). The compiler hasn't caught this error because of the fatally flawed type definition of SHELL_FILE_HANDLE, namely typedef VOID *SHELL_FILE_HANDLE; Pointer-to-void silently converts to and from most other pointer types; among them, pointer-to-pointer-to-void. That is also why no update is necessary for UpdateStdInStdOutStdErr() and RestoreStdInStdOutStdErr() in this fix. ( Generally speaking, using (VOID *) typedefs for opaque handles is a tragic mistake in all of the UEFI-related specifications; this practice defeats any type checking that compilers might help programmers with. The right way to define an opaque handle is as follows: // // Introduce the incomplete structure type, and the derived pointer // type, in both the specification and the public edk2 headers. Note // that the derived pointer type itself is a complete type, and it can // be used freely by client code. // typedef struct SHELL_FILE *SHELL_FILE_HANDLE; // // Complete the structure type in the edk2 internal C source files. // struct SHELL_FILE { // // list fields // }; This way the structure size and members remain hidden from client code, but the C compiler can nonetheless catch any invalid conversions between incompatible XXX_HANDLE types. ) Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Marvin Häuser <Marvin.Haeuser@outlook.com> Cc: Qiu Shumin <shumin.qiu@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 1bd0bf153ebf4993421afd5084c52a6e57e17fdc)
2017-07-12ShellPkg SmbiosView: Display Type 0 BIOS segment in hexadecimalJeff Westfahl
The SMBIOS Type 0 BIOS segment field is currently displayed in decimal. Since this field is likely to have a value like 0xE800 or 0xF000, using hexadecimal seems like a better choice. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit fed709deb444084594c2e11a1886819fa54afc00)
2017-07-12SecurityPkg: Consume SmmIoLib.Eric Dong
Update code to consume SmmIoLib to pass build. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> (cherry picked from commit 350e9150ccc6db9b1785574c3e7f4b58c28eb45a)
2017-07-12SecurityPkg OpalPasswordSmm: Consume SmmIoLib.Eric Dong
Update code to consume SmmIoLib to check Mmio validation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> (cherry picked from commit 50e6bb98ee64af225e152660db2fa5d8711f359a)
2017-07-12NetworkPkg: Fix PXEv6 boot failure when DhcpBinl offer received.Jiaxin Wu
In case of the DHCP and PXE services on different servers,PXEv6 boot will failure when DhcpBinl offer received. The issue is caused by the following reasons: * PXE Client doesn't append VENDOR_CLASS request parameter, so the offer replied from DHCP service will not contain VENDOR_CLASS option (16). * Once the DhcpBinl offer is selected, the boot discover message should be sent out to request the bootfile by this offer. Current implementation always use servers multi-cast address instead of BootFileUrl address in dhcp6 offer. we should check it first, then decide whether use multi-cast address or not. * If DhcpBinl offer is selected, the boot discover message shouldn't find server ID Option from DhcpBinl offer. That's incorrect because DHCP service and PXE service on different servers. In such a case, we can ignore the Server ID Option. With the above fix in the patch, PXEv6 can boot successfully when DhcpBinl offer received. 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: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> (cherry picked from commit be37315a08047945dcac91176cd99ee3397e151b)
2017-07-12NetworkPkg: Fix bug in iSCSI mode ipv6 when enabling target DHCP.Zhang, Lubo
if the server name expressed as a site local address begain with FEC0 when retrieving from dhcpv6 option 59 boot file url, it incorrectly process it as a dns name. 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 91cdd20f70c5bc739ef45b13e08ae662fbbc55cf)
2017-07-12NetworkPkg: Fix issue the iSCSI client can not send reset packet.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 597cf8a19ff426bf5f8c03425c00acbc7ac8dd63)
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-12MdePkg/dsc: add SmmIoLibJiewen Yao
Cc: Jeff Fan <jeff.fan@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2017-07-12MdePkg/dec: Add SmmIoLib.Jiewen Yao
Cc: Jeff Fan <jeff.fan@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
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-12PeCoffGetEntryPointLib: Fix spelling issueJeff Fan
*Serach* should be *Search* Cc: Liming Gao <liming.gao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> (cherry picked from commit 9e981317be20ab85bb68a670e79735f9685a3348)
2017-07-12UefiCpuPkg/MpLib.c: Set AP state after X2APIC mode enabledJeff Fan
After X2APIC mode is enabled, APs need to be set tp IDLE state, otherwise APs cannot be waken up by MP PPI services. https://bugzilla.tianocore.org/show_bug.cgi?id=505 Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> (cherry picked from commit 59a119f0fcaed5a7cab4829bb19dd7ffa94e16a0)
2017-07-12UefiCpuPkg: Move ProgramVirtualWireMode() to MpInitLibJeff Fan
In PEI phase, BSP did not program vitural wired mode while APs did. Move program virtual wired mode from CpuDxe to MpInitLib, thus it could benefit on both CpuDxe and CpuMpPei. https://bugzilla.tianocore.org/show_bug.cgi?id=496 Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> (cherry picked from commit 9d64a9fd9ee05f0b0228fc1f8b66398dac85e2c9)
2017-07-12UefiCpuPkg/MpInitLib: needn't to allocate AP reset vectorJeff Fan
Because we will always borrow the AP reset vector space for AP waking up. We needn't allocate such range to prevent other module to use it. It could simply the code. https://bugzilla.tianocore.org/show_bug.cgi?id=500 Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> (cherry picked from commit c934a0a5816e38ca5dbdb25936c4f841958a008e)
2017-07-12UefiCpuPkg/MpInitLib: save/restore original contentsJeff Fan
If APs is in HLT-LOOP mode, we need AP reset vector for waking up APs. This updating is to save/restore original contents of AP reset vector around waking up APs always. https://bugzilla.tianocore.org/show_bug.cgi?id=500 Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> (cherry picked from commit 9293d6e42e677e4a38e055258c0993ad8a9df14e)
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-12NetworkPkg/TlsAuthConfigDxe: Close and free the file related resourceJiaxin Wu
v2: * Define one new internal function to clean the file content. TlsAuthConfigDxe open file by FileExplorerLib. It need to close file handler and free file related resource in some cases. * User enrolls Cert by escape the Config page. * The Cert is not X509 type. * User chooses another file after he selected a file. Cc: Zhang Chao B <chao.b.zhang@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: Chao Zhang<chao.b.zhang@intel.com> (cherry picked from commit 8ca417688363da941b329ce134e074971e864c34)
2017-07-12NetworkPkg: Correct the proxy DHCP offer handingJiaxin Wu
When PXE10/WFM11a offer received, we should only cache the first PXE10/WFM11a offer, and discard the others. But Current we discard all PXE10/WFM11a offer. This patch is to fix this issue. 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: Ye Ting <ting.ye@intel.com> (cherry picked from commit 8cdd559be622f7a35731b7f973d8b82d1c9e303e)
2017-07-12NetworkPkg/HttpDxe: Fix HTTP download OS image over 4G size failureJiaxin Wu
UINT32 integer overflow will happen once the download OS image over 4G size. This patch is to fix this issue. 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: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> (cherry picked from commit 6893b16fb9f8afef71ae4e9e3dead6bb685f6994)
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-12NetworkPkg: Fix bug related DAD issue in IP6 driver.Zhang, Lubo
If we set PXEv6 as the first boot option and reboot immediately after the first successful boot, it will assert. the root cause is when we set the policy from manual to automatic in PXE driver, the ip6 Configure item size is already set to zero and other structures are also released, So it is not needed to perform DAD call back function which is invoked by Ip6ConfigSetMaunualAddress. 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: Jiaxin Wu <jiaxin.wu@intel.com> (cherry picked from commit 52cad7d0d8e0ec94ca6152f9f7c56f48ca15825e)
2017-07-12NetworkPkg: Add check logic for iSCSI driver.Zhang, Lubo
Need to check variable of mPrivate whether is null before used and redefine the array length of target address for keyword. 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: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> (cherry picked from commit b28bf4143d00142323d5dd9a9129b9b25d0dff56)
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)