summaryrefslogtreecommitdiff
path: root/Core
AgeCommit message (Collapse)Author
2017-07-12ShellPkg/HandleParsingLib: Open LoadedImageProtocol firstJeff Westfahl
This patch changes the order of operations to make sure we can open the LoadedImageProtocol before getting the format string. This should not affect functionality, and makes the next patch easier to review. 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: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit bbb212afa0f8e33e0b686a1b6ffd85d353eed83d)
2017-07-12ShellPkg/HandleParsingLib: Show LoadedImageProtocol file path as textJeff Westfahl
This patch adds support for displaying a text representation of the file path associated with a LoadedImageProtocol. This is a behavior that was present in the old shell but has been lost in the new shell. For example, using 'dh -v' in the old shell: FilePath......: FvFile(F3331DE6-4A55-44E4-B767-7453F7A1A021) FilePath......: \EFI\BOOT\BOOTX64.EFI vs. the new shell: FilePath......: 3A539018 FilePath......: 3A728718 This seems like useful information for the shell to display. 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: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit c15323ae2e79ee9b0779b030605d5d4c204d624a)
2017-07-12ShellPkg/ShellCommandLib: Update DumpHex to print {|}~Jeff Westfahl
ASCII characters {|}~ should be printed by DumpHex. The problem is that if you have a string like {xizzy}~{foo|bar}~{quux} in the dumped data, it will not appear as such in the *-delimited ASCII column to the right, but as .xizzy...foo.bar...quux. which is less than ideal. Most of the commit message was inspired by/shamelessly stolen from Laszlo's example: https://lists.01.org/pipermail/edk2-devel/2017-April/010266.html 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: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> (cherry picked from commit 4bf3b994e8b207fc919958b4a212a8342aaaa749)
2017-07-12UefiCpuPkg/PiSmmCpuDxeSmm: Fix logic check errorJeff Fan
Cc: Jiewen Yao <jiewen.yao@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: Jiewen Yao <jiewen.yao@intel.com> (cherry picked from commit 29dc8aa861fac78c6d62391dff312db934b755e3)
2017-07-12UefiCpuPkg/PiSmmCpuDxeSmm: Check ProcessorId == INVALID_APIC_IDJeff Fan
If PcdCpuHotPlugSupport is TRUE, gSmst->NumberOfCpus will be the PcdCpuMaxLogicalProcessorNumber. If gSmst->SmmStartupThisAp() is invoked for those un-existed processors, ASSERT() happened in ConfigSmmCodeAccessCheck(). This fix is to check if ProcessorId is valid before invoke gSmst->SmmStartupThisAp() in ConfigSmmCodeAccessCheck() and to check if ProcessorId is valid in InternalSmmStartupThisAp() to avoid unexpected DEBUG error message displayed. Cc: Jiewen Yao <jiewen.yao@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 b7025df8f9102a1698879aa451bf5af592c37bc1)
2017-07-12UefiCpuPkg/SmmCpuFeaturesLib: Correct print levelJeff Fan
Cc: Jiewen Yao <jiewen.yao@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 5d0933f9bab2781bf5df078d12c22d50df165617)
2017-07-12UefiCpuPkg/SmmCpuFeaturesLib: Fix Ia32/SmiEntry.asm build issueJeff Fan
Cc: Jiewen Yao <jiewen.yao@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 6afc643ce0eded9ccbd015a5cd6d2ba0e264b01d)
2017-07-12SecurityPkg: Add TCG Spec info to TCG related modulesZhang, Chao B
Add TCG Spec compliance info to TCG related module INFs. Cc: Qin Long <qin.long@intel.com> Cc: Yao Jiewen <jiewen.yao@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> Reviewed-by: Yao Jiewen <jiewen.yao@intel.com> (cherry picked from commit 6d92ae11d14abe39f2587a360bc5d6c370325cad)
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-12NetworkPkg/IScsiDxe: Switch IP4 configuration policy to Static before DHCPJiaxin Wu
DHCP4 service allows only one of its children to be configured in the active state. If the DHCP4 D.O.R.A started by IP4 auto configuration and has not been completed, the Dhcp4 state machine will not be in the right state for the iSCSI to start a new round D.O.R.A. So, we need to switch it's policy to static. 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 ef810bc807188224a752ffbcf5e7f4b651291cee)
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-12NetworkPkg: Fix issue in dns driver when building DHCP packet.Zhang Lubo
Currently, DNS driver configure the dhcp message type to inform when building dhcp packet to get dns info from, but it not works with dhcp server deployed on linux system. However it works well when changed to request type. 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 b61fda11295b09340c43278fe9425eb71081ac2a)
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-12NetworkPkg: 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 3696ceaecb03fc8d66988649506f5f22a6526d1e)
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)