summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* OvmfPkg/QemuFwCfg: introduce FW_CFG_IO_SELECTOR, adapt the packageLaszlo Ersek2017-02-223-2/+8
| | | | | | | | | | | Introduce the FW_CFG_IO_SELECTOR macro for IO Port 0x510 (the Selector Register), and update all references in OvmfPkg. Cc: Jordan Justen <jordan.l.justen@intel.com> Suggested-by: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/QemuFwCfgLib: move types/macros from lib class to IndustryStandardLaszlo Ersek2017-02-222-69/+97
| | | | | | | | Cc: Jordan Justen <jordan.l.justen@intel.com> Suggested-by: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/AcpiPlatformDxe: update PointerValue comments in "BootScript.c"Laszlo Ersek2017-02-221-6/+8
| | | | | | | | | | | | | | | | | | | | Commit df73df138d9d ("OvmfPkg/AcpiPlatformDxe: replay QEMU_LOADER_WRITE_POINTER commands at S3", 2017-02-09) added "BootScript.c" with such comments on the PointerValue field of CONDENSED_WRITE_POINTER, and on the corresponding PointerValue parameter of SaveCondensedWritePointerToS3Context(), that did not consider the then-latest update of the QEMU_LOADER_WRITE_POINTER structure. (Namely, the introduction of the PointeeOffset field.) The code is fine as-is -- ProcessCmdWritePointer() already calls SaveCondensedWritePointerToS3Context() correctly, and "BootScript.c" itself is indifferent to the exact values --, but the comments in "BootScript.c" should match reality too. Update them. Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/AcpiPlatformDxe: drop double right shift in ADD/WRITE POINTER cmdsLaszlo Ersek2017-02-221-4/+4
| | | | | | | | | | | | | | | | | | | The Count parameter of RShiftU64() must be strictly smaller than 64. ProcessCmdAddPointer() and ProcessCmdWritePointer() currently ensure this by "cleverly" breaking the last bit of a potentially 8-byte right shift out to a separate operation. Instead, exclude the Count==64 case explicitly (in which case the preexistent outer RShiftU64() would return 0), and keep only the inner RShiftU64(), with the direct Count however. This is not a functional change, just style improvement. Cc: Jordan Justen <jordan.l.justen@intel.com> Suggested-by: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* UefiCpuPkg/ExceptionHandlerAsm.S: Fix code length issue with GCC 5.4Jeff Fan2017-02-221-2/+3
| | | | | | | | | | | | | | | | | | | | | | | X64\ExceptionHandlerAsm.S define MARCO to set up 32 IDT entries header. It assume GCC compiler will generate the same code length on the following instrction for each IDT entry. jmp ASM_PFX(CommonInterruptEntry) It works with GCC 4.x. However, GCC 5.4 will generate different code size of IDT entry code per the offset value from CommonInterruptEntry address. We should use DB to make sure each IDT entry header has the same size whatever compiler version. .ASM and .nasm used the different solution and do not have this issue. https://bugzilla.tianocore.org/show_bug.cgi?id=389 Cc: Liming Gao <liming.gao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Michael D 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>
* ArmPkg/ArmMmuLib: AARCH64: add support for modifying only permissionsArd Biesheuvel2017-02-213-36/+67
| | | | | | | | | | | | | | Since the new DXE page protection for PE/COFF images may invoke EFI_CPU_ARCH_PROTOCOL.SetMemoryAttributes() with only permission attributes set, add support for this in the AARCH64 MMU code. Move the EFI_MEMORY_CACHETYPE_MASK macro to a shared location between CpuDxe and ArmMmuLib so we don't have to introduce yet another definition. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* ArmPkg/CpuDxe: ARM: ignore page table updates that only change permissionsArd Biesheuvel2017-02-211-0/+7
| | | | | | | | | | | Currently, we have not implemented support on 32-bit ARM for managing permission bits in the page tables. Since the new DXE page protection for PE/COFF images may invoke EFI_CPU_ARCH_PROTOCOL.SetMemoryAttributes() with only permission attributes set, let's simply ignore those for now. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* ArmPkg/CpuDxe: translate invalid memory types in EfiAttributeToArmAttributeArd Biesheuvel2017-02-212-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The single user of EfiAttributeToArmAttribute () is the protocol method EFI_CPU_ARCH_PROTOCOL.SetMemoryAttributes(), which uses the return value to compare against the ARM attributes of an existing mapping, to infer whether it is actually necessary to change anything, or whether the requested update is redundant. This saves some cache and TLB maintenance on 32-bit ARM systems that use uncached translation tables. However, EFI_CPU_ARCH_PROTOCOL.SetMemoryAttributes() may be invoked with only permission bits set, in which case the implied requested action is to update the permissions of the region without modifying the cacheability attributes. This is currently not possible, because EfiAttributeToArmAttribute () ASSERT()s [on AArch64] on Attributes arguments that lack a cacheability bit. So let's simply return TT_ATTR_INDX_MASK (AArch64) or TT_DESCRIPTOR_SECTION_TYPE_FAULT (ARM) in these cases (or'ed with the appropriate permission bits). This way, the return value is equally suitable for checking whether the attributes need to be modified, but in a way that accommodates the use without a cacheability bit set. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* ArmPkg/CpuDxe: Correct EFI_MEMORY_RO usageJiewen Yao2017-02-214-12/+13
| | | | | | | | | | | Current Arm CpuDxe driver uses EFI_MEMORY_WP for write protection, according to UEFI spec, we should use EFI_MEMORY_RO for write protection. The EFI_MEMORY_WP is the cache attribute instead of memory attribute. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* OvmfPkg/AcpiPlatformDxe: replay QEMU_LOADER_WRITE_POINTER commands at S3Laszlo Ersek2017-02-215-5/+510
| | | | | | | | | | | | | | | | | | | | | | Ultimately, each QEMU_LOADER_WRITE_POINTER command creates a guest memory reference in some QEMU device. When the virtual machine is reset, the device willfully forgets the guest address, since the guest memory is wholly invalidated during platform reset. ... Unless the reset is part of S3 resume. Then the guest memory is preserved intact, and the firmware must reprogram those devices with the original guest memory allocation addresses. This patch accumulates the fw_cfg select, skip and write operations of ProcessCmdWritePointer() in a validated / condensed form, and turns them into an ACPI S3 Boot Script fragment at the very end of InstallQemuFwCfgTables(). Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=359 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/AcpiPlatformDxe: implement the QEMU_LOADER_WRITE_POINTER commandLaszlo Ersek2017-02-211-3/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | The QEMU_LOADER_WRITE_POINTER command instructs the firmware to write the address of a field within a previously allocated/downloaded fw_cfg blob into another (writeable) fw_cfg file at a specific offset. Put differently, QEMU_LOADER_WRITE_POINTER propagates, to QEMU, the address that QEMU_LOADER_ALLOCATE placed the designated fw_cfg blob at, as adjusted for the given field inside the allocated blob. The implementation is similar to that of QEMU_LOADER_ADD_POINTER. Since here we "patch" a pointer object in "fw_cfg file space", not guest memory space, we utilize the QemuFwCfgSkipBytes() and QemuFwCfgWriteBytes() APIs completed in commit range 465663e9f128..7fcb73541299. An interesting aspect is that QEMU_LOADER_WRITE_POINTER creates a host-level reference to a guest memory location. Therefore, if we fail to process the linker/loader script for any reason, we have to clear out those references first, before we release the guest memory allocations in response to the error. Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=359 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/AcpiPlatformDxe: rewrap license block in "QemuFwCfgAcpi.c"Laszlo Ersek2017-02-211-5/+5
| | | | | | | | | | The longest line is currently 84 characters long. Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=359 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/AcpiPlatformDxe: add QEMU_LOADER_WRITE_POINTER definitionsLaszlo Ersek2017-02-211-0/+26
| | | | | | | | Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=359 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg/AcpiPlatformDxe: prepare for QEMU_LOADER_WRITE_POINTER definitionsLaszlo Ersek2017-02-211-5/+5
| | | | | | | | | | | | No functional changes in this patch, just prepare the grounds with some reformatting (trailing comma after the last enumeration constant, horizontal whitespace insertion) so that the next patch can be cleaner. Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=359 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* MdeModulePkg/BMMUiLib: Remove old useless data before new save actionDandan Bi2017-02-212-2/+47
| | | | | | | | | | | | | | | There exits the case that when saving changes in form A, the old saved data in form B are not cleaned, will be saved again with the new save. Thus incorrect UI behavior will be shown. This patch is to remove some useless data. https://bugzilla.tianocore.org/show_bug.cgi?id=385 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>
* MdeModulePkg/HiiDatabase: clean the value before setting default stringDandan Bi2017-02-211-2/+15
| | | | | | | | | | | | | | For string op-code, the default string may not reach the maximum size, so when generating <AltResp> string, we should clean the value before setting the default string. https://bugzilla.tianocore.org/show_bug.cgi?id=375 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>
* MdeMoudlePkg/DisplayEngine: Fix incorrect index used in array "InputText"Dandan Bi2017-02-211-15/+18
| | | | | | | | | | | | | | | | When set value to the array "InputText", the index was used incorrectly. And the array "InputText" is not initialized. These will cause some value in the array is random, so it will be shown incorrectly sometimes. This patch is to fix this issue. https://bugzilla.tianocore.org/show_bug.cgi?id=358 Cc: Eric Dong <eric.dong@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Wang Cloud <winggundum82@163.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>
* SecurityPkg/TpmCommandLib: Add Tpm2ReadPublic.Jiewen Yao2017-02-213-2/+369
| | | | | | | | Cc: Chao Zhang <chao.b.zhang@intel.com> Cc: Long Qin <qin.long@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yao Jiewen <jiewen.yao@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
* MdeModulePkg/PrintLib: Add safe print functions [A|U]ValueToStringSHao Wu2017-02-211-0/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the following 2 APIs: UnicodeValueToStringS AsciiValueToStringS These safe version APIs are used to enhance their counterpart (APIs without trailing 'S' in function names). They perform checks to the input parameters and will return relative status to reflect the check result. Return RETURN_INVALID_PARAMETER when: 1). The input Buffer is NULL. 2). The input BufferSize is greater than (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1) for UnicodeValueToStringS or greater than PcdMaximumAsciiStringLength for AsciiValueToStringS. 3). The input Flags is not set properly. 4). The input Width is not smaller than MAXIMUM_VALUE_CHARACTERS. Return RETURN_BUFFER_TOO_SMALL when: 1). The input BufferSize cannot hold the converted value. These APIs in the MdeModulePkg/DxePrintLibPrint2Protocol instance follow the same rules with MdePkg/BasePrintLib. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/PrintLib: Use EFI_PRINT2S_PROTOCOL for this instanceHao Wu2017-02-213-21/+49
| | | | | | | | | | The commit updates the PrintLib instance MdeModulePkg/Library/DxePrintLibPrint2Protocol to use EFI_PRINT2S_PROTOCOL to implement the APIs. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg: Add the EFI_PRINT2S_PROTOCOLHao Wu2017-02-215-13/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the EFI_PRINT2S_PROTOCOL as a safe version of the EFI_PRINT2_PROTOCOL, the EFI_PRINT2S_PROTOCOL replaces the following 2 services in EFI_PRINT2_PROTOCOL: UNICODE_VALUE_TO_STRING ASCII_VALUE_TO_STRING with: UNICODE_VALUE_TO_STRING_S ASCII_VALUE_TO_STRING_S The 2 new services perform checks to the input parameters and will return relative status to reflect the check result. Return RETURN_INVALID_PARAMETER when: 1). The input Buffer is NULL. 2). The input BufferSize is greater than (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1) for UnicodeValueToStringS or greater than PcdMaximumAsciiStringLength for AsciiValueToStringS. 3). The input Flags is not set properly. 4). The input Width is not smaller than MAXIMUM_VALUE_CHARACTERS. Return RETURN_BUFFER_TOO_SMALL when: 1). The input BufferSize cannot hold the converted value. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BasePrintLib: Add safe print functions [A|U]ValueToStringSHao Wu2017-02-214-0/+514
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add the following 2 APIs: UnicodeValueToStringS AsciiValueToStringS These safe version APIs are used to enhance their counterpart (APIs without trailing 'S' in function names). They perform checks to the input parameters and will return relative status to reflect the check result. Return RETURN_INVALID_PARAMETER when: 1). The input Buffer is NULL. 2). The input BufferSize is greater than (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1) for UnicodeValueToStringS or greater than PcdMaximumAsciiStringLength for AsciiValueToStringS. 3). The input Flags is not set properly. 4). The input Width is not smaller than MAXIMUM_VALUE_CHARACTERS. Return RETURN_BUFFER_TOO_SMALL when: 1). The input BufferSize cannot hold the converted value. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg: Refine the services comments in EFI_PRINT2_PROTOCOLHao Wu2017-02-211-156/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the following 8 services in EFI_PRINT2_PROTOCOL: UNICODE_BS_PRINT UNICODE_S_PRINT UNICODE_BS_PRINT_ASCII_FORMAT UNICODE_S_PRINT_ASCII_FORMAT ASCII_BS_PRINT ASCII_S_PRINT ASCII_BS_PRINT_UNICODE_FORMAT ASCII_S_PRINT_UNICODE_FORMAT They will ASSERT when: 1) The input parameter 'StartOfBuffer' is NULL if 'BufferSize' indicates at least 1 Ascii/Unicode character can be held. 2) The input parameter 'FormatString' is NULL if 'BufferSize' indicates at least 1 Ascii/Unicode character can be held. 3) The input parameter 'FormatString' contains more than PcdMaximum[Ascii|Unicode]StringLength Ascii/Unicode characters. 4) The produced string contains more than PcdMaximum[Ascii|Unicode]StringLength Ascii/Unicode characters. This commits removes the ASSERT case 4) and add the following new ASSERT case: 4) The input parameter 'BufferSize' is greater than (PcdMaximumAsciiStringLength * sizeof (CHAR8)) for Ascii format string or (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1) for Unicode format string. And for those ASSERT cases, 0 will be returned by those services. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/PrintLib: Refine the SPrint functionsHao Wu2017-02-212-225/+344
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the following 12 APIs in MdeModulePkg/DxePrintLibPrint2Protocol: UnicodeVSPrint UnicodeBSPrint UnicodeSPrint UnicodeVSPrintAsciiFormat UnicodeBSPrintAsciiFormat UnicodeSPrintAsciiFormat AsciiVSPrint AsciiBSPrint AsciiSPrint AsciiVSPrintUnicodeFormat AsciiBSPrintUnicodeFormat AsciiSPrintUnicodeFormat They will ASSERT when: 1) The input parameter 'StartOfBuffer' is NULL if 'BufferSize' indicates at least 1 Ascii/Unicode character can be held. 2) The input parameter 'FormatString' is NULL if 'BufferSize' indicates at least 1 Ascii/Unicode character can be held. 3) The input parameter 'FormatString' contains more than PcdMaximum[Ascii|Unicode]StringLength Ascii/Unicode characters. 4) The produced string contains more than PcdMaximum[Ascii|Unicode]StringLength Ascii/Unicode characters. This commits removes the ASSERT case 4) and add the following new ASSERT case: 4) The input parameter 'BufferSize' is greater than (PcdMaximumAsciiStringLength * sizeof (CHAR8)) for Ascii format string or (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1) for Unicode format string. And for those ASSERT cases, 0 will be returned by those 12 APIs. For the following 2 APIs in MdeModulePkg/DxePrintLibPrint2Protocol: SPrintLength SPrintLengthAsciiFormat They will ASSERT when: 1) The input parameter 'FormatString' is NULL. 2) The input parameter 'FormatString' contains more than PcdMaximum[Ascii|Unicode]StringLength Ascii/Unicode characters. And for those ASSERT cases, 0 will be returned by those 2 APIs. Now these APIs in the MdeModulePkg/DxePrintLibPrint2Protocol instance follow the same rules with MdePkg/BasePrintLib. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BasePrintLib: Refine the SPrint functionsHao Wu2017-02-215-428/+598
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the following 12 APIs in MdePkg/BasePrintLib: UnicodeVSPrint UnicodeBSPrint UnicodeSPrint UnicodeVSPrintAsciiFormat UnicodeBSPrintAsciiFormat UnicodeSPrintAsciiFormat AsciiVSPrint AsciiBSPrint AsciiSPrint AsciiVSPrintUnicodeFormat AsciiBSPrintUnicodeFormat AsciiSPrintUnicodeFormat They will ASSERT when: 1) The input parameter 'StartOfBuffer' is NULL if 'BufferSize' indicates at least 1 Ascii/Unicode character can be held. 2) The input parameter 'FormatString' is NULL if 'BufferSize' indicates at least 1 Ascii/Unicode character can be held. 3) The input parameter 'FormatString' contains more than PcdMaximum[Ascii|Unicode]StringLength Ascii/Unicode characters. 4) The produced string contains more than PcdMaximum[Ascii|Unicode]StringLength Ascii/Unicode characters. This commits removes the ASSERT case 4) and add the following new ASSERT case: 4) The input parameter 'BufferSize' is greater than (PcdMaximumAsciiStringLength * sizeof (CHAR8)) for Ascii format string or (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1) for Unicode format string. And for those ASSERT cases, 0 will be returned by those 12 APIs. For the following 2 APIs in MdePkg/BasePrintLib: SPrintLength SPrintLengthAsciiFormat They will ASSERT when: 1) The input parameter 'FormatString' is NULL. 2) The input parameter 'FormatString' contains more than PcdMaximum[Ascii|Unicode]StringLength Ascii/Unicode characters. And for those ASSERT cases, 0 will be returned by those 2 APIs. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/PciBusDxe: Refine code to make it more readableRuiyu Ni2017-02-211-18/+12
| | | | | | | | The patch doesn't impact functionality. 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>
* MdeModulePkg/SdMmc: Avoid assigning 0 to the BlockSize of TrbHao Wu2017-02-213-6/+6
| | | | | | | | | | Refine code to avoid potential divide by zero when calculating block number. Cc: Feng Tian <feng.tian@intel.com> 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>
* NetworkPkg/IpSecDxe: Add check to avoid possible divide by zeroHao Wu2017-02-211-1/+7
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* Security Tcg2Smm: Add missing gEfiTcg2ProtocolGuid dependencyStar Zeng2017-02-211-1/+2
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=380 gEfiTcgProtocolGuid dependency was added in TcgSmm. But gEfiTcg2ProtocolGuid dependency is missing in Tcg2Smm. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Chao Zhang <chao.b.zhang@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>
* SecurityPkg: enhance secure boot Config Dxe & Time Based AuthVariable.Zhang Lubo2017-02-204-18/+35
| | | | | | | | | | | | | | | | V3: code clean up prohibit Image SHA-1 hash option in SecureBootConfigDxe. Timebased Auth Variable driver should ensure AuthAlgorithm is SHA256 before further verification Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Chao Zhang <chao.b.zhang@intel.com> Cc: Long Qin <qin.long@intel.com> Cc: Yao Jiewen <jiewen.yao@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Long Qin <qin.long@intel.com>
* NetworkPkg:Generate the correct operational state of the interface.Zhang Lubo2017-02-201-5/+6
| | | | | | | | | | | | | | Currently, When there are more than 9 Ethernet ports available, 'ifconfig6 -l' is not listing all the ports, only show the ports 0 to 9. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Santhapur Naveen <naveens@amiindia.co.in> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
* MdeModulePkg:Generate the correct operational state of the interface.Zhang Lubo2017-02-201-5/+6
| | | | | | | | | | | | | | Currently, When there are more than 9 Ethernet ports available, 'ifconfig -l' is not listing all the ports, only show the ports 0 to 9. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Santhapur Naveen <naveens@amiindia.co.in> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
* MdeModulePkg/PciBusDxe: Fix IA32 build failureRuiyu Ni2017-02-171-10/+10
| | | | | | | | | | | | Compiler calculates the PciBar[BarIndex] using sizeof (PciBar[0]) * BarIndex, when BarIndex is type of UINT64, the above calculation generates assembly code using _allmul. Change BarIndex to UINTN to avoid the build failure. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
* BaseTools: Fix bug for GUIDED tool path override by DSC [BuildOptions]Yonghong Zhu2017-02-172-22/+68
| | | | | | | | | | | Current the GUIDED tool path can't be override to the different path in the [BuildOptions] of DSC file. This patch fix the bug. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=283 Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* NetworkPkg/HttpBootDxe: Update to check specified media typeJiaxin Wu2017-02-162-3/+13
| | | | | | | | | | | | | | | | IANA has approved below new media type for EFI http(s) boot usage: application/vnd.efi.img application/vnd.efi.iso HTTP boot driver should be updated to check the above media type from Content-Type header field. 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>
* NetworkPkg/HttpBootDxe: Declare the functions as EFIAPI to pass the GCC buildJiaxin Wu2017-02-161-0/+2
| | | | | | | | | | | Cc: Laszlo Ersek <lersek@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.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: Laszlo Ersek <lersek@redhat.com> Build-tested-by: Laszlo Ersek <lersek@redhat.com>
* ArmPlatformPkg/PL061Gpio: fix the offset value in Get functionHaojian Zhuang2017-02-161-1/+1
| | | | | | | | | When call PL061GetPins() or PL061SetPins(), should use GPIO_PIN_MASK(offset) as parameter, not offset. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* ArmPlatformPkg/PL061: remove duplicated PL061_GPIO_DATA_REGHaojian Zhuang2017-02-161-4/+4
| | | | | | | | | | PL061_GPIO_DATA_REG offset is referenced in PL061EffectiveAddress () already. So remove the duplicated reference when invoke PL061GetPins () or PL061SetPins (). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* ShellPkg/pci: Report error when invalid value is specified for "-ec"Ruiyu Ni2017-02-162-7/+16
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* MdeModulePkg UefiBootManagerLib: Correct usages of GUID and ProtocolLiming Gao2017-02-161-25/+29
| | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=316 Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdePkg/BaseLib: Refine logic for (Ascii)StrnLenS to handle MaxSize = 0Hao Wu2017-02-151-4/+4
| | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=378 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>
* NetworkPkg/HttpBootDxe: Request HTTP token notify as a DPC at TPL_CALLBACKJiaxin Wu2017-02-153-3/+38
| | | | | | | | | | | | | | | This patch is to update the HTTP token notify as a DPC at TPL_CALLBACK to align with UEFI Spec. Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.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: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
* NetworkPkg/iSCSIDxe: Update the condition for IScsiStart Aborthegdenag2017-02-152-9/+18
| | | | | | | | | | | | | | Update existing #define and add a new #define used for the PCD PcdIScsiAIPNetworkBootPolicy. Update the code in iScsiStart according to the #define changes in iScsiDriver.h Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg/NetworkPkg.dec: Update comments for the PCDhegdenag2017-02-151-2/+3
| | | | | | | | | | | | Update comment section for the PCD PcdIScsiAIPNetworkBootPolicy. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* BaseTools: Enhance BaseTools supports FixedAtBuild usage in VFR fileYonghong Zhu2017-02-143-3/+38
| | | | | | | | | | | | | | | This patch is to update BaseTools generate Fixed PCD APIs and Value into $(MODULE_NAME)StrDefs.h for VFR only. If the module has VFR files, and it directly consumes FixedAtBuild PCD, BaseTool will generate those FixedAtBuild PCD value into its $(MODULE_NAME)StrDefs.h. FixedPcdGetXX macro are always generated. Every FixedPcd _PCD_VALUE_PcdName will be generated without the postfix U or UL or ULL. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=348 Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg ACPI: Incorrect definition name for ACPI IORT Table signatureStar Zeng2017-02-142-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=363 The definition name for ACPI IO Remapping Table signature is incorrect in Acpi60.h and Acpi61.h as below: EFI_ACPI_6_0_INTERRUPT_SOURCE_OVERRIDE_SIGNATURE EFI_ACPI_6_1_INTERRUPT_SOURCE_OVERRIDE_SIGNATURE The name should be changed to EFI_ACPI_6_0_IO_REMAPPING_TABLE_SIGNATURE EFI_ACPI_6_1_IO_REMAPPING_TABLE_SIGNATURE The comments /// /// "IORT" Interrupt Source Override /// will be also changed to /// /// "IORT" I/O Remapping Table /// Cc: Alexei Fedorov <Alexei.Fedorov@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@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>
* BaseTools: Add NOOPT target in CLANG38 tool chainLiming Gao2017-02-131-9/+25
| | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=310 Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* MdePkg/Pci22.h: Deprecate out-of-Spec IncompatiblePciDevice macrosRuiyu Ni2017-02-101-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | DEVICE_ID_NOCARE is defined as 0xFFFF but Spec says (UINT64) -1 should be used to match any VendorId/DeviceId/RevisionId/ SubsystemVendorId/SubsystemDeviceId. PCI_BAR_OLD_ALIGN/PCI_BAR_EVEN_ALIGN/PCI_BAR_SQUAD_ALIGN/ PCI_BAR_DQUAD_ALIGN are defined but Spec doesn't have such definitions. PCI_BAR_ALL is defined as 0xFF but Spec says (UINT64)-1 should be used to match all BARs. PCI_ACPI_UNUSED and PCI_BAR_NOCHANGE are defined as 0 which compliant with Spec but the name is too general and causes confusing. IncompatiblePciDeviceSupport could directly use 0. All of the above macros are marked as deprecated. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Cc: Jeff Fan <jeff.fan@intel.com>
* OvmfPkg/IncompatiblePci: Do not use deprecated macrosRuiyu Ni2017-02-101-6/+7
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* MdeModulePkg/IncompatiblePci: Use MAX_UINTN to match any IDsRuiyu Ni2017-02-101-5/+5
| | | | | | | | | | | | | | | When the VendorId/DeviceId/RevisionId/SubsystemVendorId /SubsystemDeviceId is MAX_UINTN, IncompatiblePciDeviceSupport driver doesn't use it to match any IDs. The patch fixes this bug. Since PciBus driver always calls IncompatiblePciDeviceSupport using IDs read from HW, MAX_UINTN is never passed to this driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>